/* Container for the whole form to make it look like a floating glass card */
.auth-container {
  max-width: 480px;
  margin: 40px auto;

  /* Solid white so the green text remains easy to read */
  background: var(--white-color);

  padding: 32px 40px;
  border-radius: 20px;
  border: 1px solid #eaeaea;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);

  box-sizing: border-box;
  width: 100%;
}

.auth-header h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--logo-color);
}

.auth-header p {
  text-align: center;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--logo-color);
}

.auth-form {
  display: flex;
  flex-direction: column;
}

/* This restores the missing gaps between the fields inside the steps */
#step-1,
#step-2 {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Base styling for all inputs AND dropdowns */
.auth-form input,
.auth-form select,
.input-dark {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--logo-color);
  background: var(--white-color);
  color: var(--logo-color);
  font-size: 16px;
  /* Crucial: 16px prevents iOS Safari from auto-zooming on focus */
  box-sizing: border-box;
  appearance: none;
}

/* Special styling for dropdown arrows */
.auth-form select,
select.input-dark {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300ff99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Ensure the dropdown list itself is readable when opened */
.auth-form select option,
select.input-dark option {
  background-color: var(--logo-color);
  color: var(--white-color);
  padding: 8px;
}

.auth-form input:focus,
.auth-form select:focus,
.input-dark:focus {
  outline: none;
  box-shadow: 0 0 8px rgba(0, 255, 153, 0.2);
  border-color: var(--logo-color);
}

.auth-form input::placeholder {
  color: var(--logo-color);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 500;
  color: var(--logo-color);
  font-size: 0.95rem;
}

/* Shared Button Styles */
.btn-submit,
.btn-cancel {
  width: 100%;
  padding: 12px;
  /* Matches the inputs perfectly and lets text breathe */
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  line-height: 1.2;
}

/* Primary Green Button */
.btn-submit {
  background: var(--logo-color);
  border: 1px solid var(--logo-color);
  color: var(--white-color);
}

.btn-submit:hover {
  background: var(--logo-color);
  box-shadow: 0 4px 12px var(--logo-color);
}

/* Secondary Cancel/Back Button */
.btn-cancel {
  background: var(--logo-color);
  color: var(--white-color);
  border: 1px solid var(--logo-color);
}

.btn-cancel:hover {
  background: var(--logo-color);
}

/* Flex container for side-by-side buttons on Desktop */
.button-group-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.button-group-row button {
  margin-top: 0;
}

/* --- THE FIX: Give the longer text more room --- */
.button-group-row .btn-cancel {
  flex: 1;
  /* Back button takes up 1/3 of the space */
}

.button-group-row .btn-submit {
  flex: 2;
  /* Submit button takes up 2/3 of the space so text won't wrap! */
}

/* Red box for errors */
.error-msg {
  color: #ff5252;
  margin-top: 12px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255, 82, 82, 0.1);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 82, 82, 0.3);
}

/* Green box for success */
.success-msg {
  color: var(--white-color);
  margin-top: 12px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--logo-color);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--logo-color);
}

.switch-link {
  text-align: center;
  margin-top: 24px;
  font-size: 0.95rem;
  color: var(--logo-color);
}

.switch-link a {
  color: var(--logo-color);
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}

.switch-link a:hover {
  text-shadow: 0 0 8px rgba(0, 255, 120, 0.5);
}

/* ===============================
   EULA CHECKBOX & MODAL STYLES
=============================== */

/* Checkbox Container */
.eula-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--logo-color);
}

/* 1. The Custom Checkbox Base */
.eula-container input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  /* Slightly larger for a more professional look */
  height: 20px;
  margin-top: 1px;
  cursor: pointer;
  border: 2px solid var(--logo-color);
  border-radius: 4px;
  background-color: transparent;
  flex-shrink: 0;
  transition: all 0.2s ease-in-out;
}

/* 2. The Filled State with a Flawless SVG Checkmark */
.eula-container input[type="checkbox"]:checked {
  background-color: var(--logo-color);
  border-color: var(--logo-color);
  /* Using a filled SVG path instead of a stroke. It scales perfectly without clipping. */
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
  background-size: 100% 100%;
  /* Forces the tick to fill the box edge-to-edge perfectly */
  background-position: center;
  background-repeat: no-repeat;
}

.eula-container a {
  color: var(--logo-color);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* EULA Modal Overlay */
.eula-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

/* Modal Content Box */
.eula-modal-content {
  background-color: #ffffff;
  margin: 5% auto;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  display: flex;
  flex-direction: column;
}

.eula-modal-content h2 {
  color: var(--logo-color);
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.5rem;
  padding-right: 30px;
  line-height: 1.3;
}

/* Scrollable Text Area */
.eula-text-box {
  overflow-y: auto;
  padding-right: 15px;
  color: var(--black-color, #333);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* === FORMATTING FIXES (Paragraphs, Lists, Bold Text) === */
.eula-text-box p {
  margin-bottom: 16px;
}

/* Formats the <strong> tags as clear section headers */
.eula-text-box strong {
  display: inline-block;
  margin-top: 15px;
  margin-bottom: 5px;
  color: var(--logo-color);
  font-size: 1.05rem;
}

/* Overrides any global CSS resets blocking the list numbers */
.eula-text-box ol {
  list-style-type: decimal !important;
  padding-left: 30px !important;
  margin-bottom: 20px;
  margin-top: 10px;
}

.eula-text-box li {
  margin-bottom: 8px;
  display: list-item !important;
}

/* Close Button (X) */
.close-eula {
  color: var(--logo-color);
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s ease;
  line-height: 1;
}

.close-eula:hover {
  opacity: 0.7;
  /* Makes it fade slightly on hover so users know it's clickable */
}

/* ===============================
   MOBILE RESPONSIVE LAYOUT
=============================== */
@media screen and (max-width: 768px) {
  .eula-modal-content {
    width: 95%;
    margin: 10% auto;
    /* Centers it better on small screens */
    padding: 20px 15px 20px 20px;
    /* Reduces padding to save space */
    max-height: 80vh;
  }

  .eula-modal-content h2 {
    font-size: 1.25rem;
    /* Slightly smaller title */
    margin-bottom: 15px;
    padding-right: 25px;
    /* Adjusts clearance for the 'X' button */
  }

  .eula-text-box {
    font-size: 0.9rem;
    /* Scales text down for readability */
    padding-right: 10px;
  }

  .eula-text-box ol {
    padding-left: 20px !important;
    /* Pulls lists in tighter */
  }

  .close-eula {
    top: 15px;
    right: 15px;
    font-size: 24px;
  }

  .eula-container {
    font-size: 0.85rem;
  }
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 600px) {
  .auth-container {
    width: 92%;
    margin: 20px auto;
    padding: 24px 20px;
  }

  .auth-header h2 {
    font-size: 1.5rem;
  }

  .form-group label {
    font-size: 0.9rem;
  }

  .button-group-row {
    flex-direction: column-reverse;
    /* Puts "Complete Registration" on top, "Back" on bottom */
    gap: 12px;
  }

  .button-group-row .btn-cancel,
  .button-group-row .btn-submit {
    width: 100%;
  }
}