/* ============================================================
    SHARED STYLING
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:           #eaf5ff;
  --panel-left:   #08233a;
  --panel-middle: #ffffff;
  --accent:       #006dcc;
  --text-dark:    #0d2438;
  --text-mid:     #50616f;
  --text-light:   #f5fbff;
  --border:       #c8d9e8;
  --input-bg:     #fbfdff;
  --radius:       6px;
  --shadow:       0 24px 64px rgba(8, 35, 58, 0.16);
  --card-height:  900px;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(0,109,204,0.13) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(8,35,58,0.08) 0%, transparent 50%);
  font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
  padding: 2rem 1rem;
}

.card {
  display: flex;
  max-width: 880px;
  width: 100%;
  height: var(--card-height);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ── Left panel ─────────────────────────────────────────── */
.panel-left {
  width: 320px;
  flex-shrink: 0;
  background-color: var(--panel-left);
  padding: 3.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.panel-left::before {
  content: '';
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(0,109,204,0.22);
  bottom: -60px; right: -60px;
}

.panel-left::after {
  content: '';
  position: absolute;
  width: 160px; height: 160px;
  border-radius: 50%;
  border: 1px solid rgba(0,109,204,0.15);
  top: 40px; left: -40px;
}

.panel-left-top    { position: relative; z-index: 1; }
.panel-left-bottom { position: relative; z-index: 1; }

.brand-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(0,109,204,0.4);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 2rem;
}

.left-heading {
  font-size: 2.6rem;
  line-height: 1.15;
  color: var(--text-light);
}

.left-heading em {
  font-style: italic;
  color: var(--accent);
}

.left-sub {
  margin-top: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(245,251,255,0.68);
}

.already-label {
  font-size: 0.8rem;
  color: rgba(245,251,255,0.62);
  margin-bottom: 0.65rem;
}

.login-btn {
  display: block;
  width: 100%;
  padding: 0.8rem 1.25rem;
  border: 1px solid rgba(0,109,204,0.5);
  background: transparent;
  color: var(--text-light);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.login-btn:hover {
  background: rgba(0,109,204,0.14);
  border-color: var(--accent);
}

/* ── Form panel ─────────────────────────────────────────── */
#reg-form {
  display: flex;
  flex: 1;
  min-width: 0;
}

.panel-middle {
  flex: 1;
  min-width: 0;
  background-color: var(--panel-middle);
  padding: 3rem 3rem 3.5rem;
  display: flex;
  flex-direction: column;
}

.form-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
}

.form-title {
  font-size: 1.75rem;
  color: var(--text-dark);
}

/* ── Fields and inputs ──────────────────────────────────── */
.form-stack,
.account-details-stack,
.right-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-mid);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-dark);
  transition: border-color 0.18s, box-shadow 0.18s;
  appearance: none;
  -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,109,204,0.16);
}

/* ── Utilities ──────────────────────────────────────────── */
.hidden { display: none !important; }
.is-invisible { visibility: hidden; pointer-events: none; }

/* ── Collapsible animation ─────────────────────────────── */
.collapsible-section {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    opacity            0.28s ease;
}

.collapsible-section > .collapsible-inner {
  min-height: 0;
  overflow: hidden;
}

.collapsible-section.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

/* ============================================================
    REGISTRATION-SPECIFIC
   ============================================================ */

/* ── Step shell keeps button row fixed ───────────────────── */
.step-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.step-container {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.step-section {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  overflow-y: auto;
  padding-right: 0.35rem;
  transition:
    transform 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    opacity   0.32s ease;
}

.step-section::-webkit-scrollbar       { width: 5px; }
.step-section::-webkit-scrollbar-track { background: transparent; }
.step-section::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.step-section.is-active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.step-section.out-right {
  transform: translateX(100%);
  opacity: 0;
}

.step-section.out-left {
  transform: translateX(-100%);
  opacity: 0;
}

.step-section.stage-left {
  transform: translateX(-100%);
  opacity: 0;
  transition: none;
}

.step-section.stage-right {
  transform: translateX(100%);
  opacity: 0;
  transition: none;
}

/* ── Fixed step navigation buttons ───────────────────────── */
.step-nav-fixed {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.75rem;
  margin-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.step-btn {
  min-width: 180px;
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
}

.step-back {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-mid);
}

.step-back:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.step-next {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
}

.step-next:hover {
  background: #005ead;
  border-color: #005ead;
}

.step-btn:active { transform: scale(0.98); }

/* ── Form grid ──────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
}

.full-width { grid-column: 1 / -1; }

.field-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.25rem 1rem;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2350616f' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.25rem;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.field-note {
  font-size: 0.73rem;
  color: var(--text-mid);
  line-height: 1.5;
  margin-top: -0.1rem;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.25rem 0;
  grid-column: 1 / -1;
}

.section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  grid-column: 1 / -1;
}

.section-divider-block {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 1rem;
}

.section-label-block {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.25rem;
  margin-bottom: 0.15rem;
}

.subject-pairs-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mid);
  margin-bottom: 0.65rem;
}

.subject-pairs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

/* ── Submit button ──────────────────────────────────────── */
.submit-btn,
button[type="submit"].step-next {
  background: var(--accent);
  color: #ffffff;
}

.submit-btn {
  width: 100%;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.submit-btn:hover { background: #005ead; }
.submit-btn:active { transform: scale(0.99); }

/* ── Radio buttons ──────────────────────────────────────── */
.radio-field p {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 0.45rem;
}

.radio-options {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-dark);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}

.radio-option input[type="radio"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}



 
 
/* ============================================================
    LOGIN-SPECIFIC
   ============================================================ */
 
/* ── Card sizing ────────────────────────────────────────── */
.card {
  height: 625px;
}
 
/* ── Step layout ────────────────────────────────────────── */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
 
/* a bit more breathing room before the action button */
.form-stack > .submit-btn { margin-top: 0.5rem; }
 
/* ── Read-only email display + Edit pill button ─────────── */
.email-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-dark);
  font-size: 0.88rem;
}
 
.email-display-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
 
.email-edit-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  transition: background 0.18s, border-color 0.18s;
}
 
.email-edit-btn:hover {
  background: rgba(0, 109, 204, 0.1);
  border-color: rgba(0, 109, 204, 0.25);
}

/* Status messages (error) */
.status-message {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.status-message.error {
  background: rgba(229, 72, 72, 0.10);
  border: 1px solid rgba(229, 72, 72, 0.35);
  color: #a82b2b;
}

.status-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.status-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-message.error .status-icon svg { stroke: #a82b2b; }

    /* ============================================================
       PASSWORD-RESET-SPECIFIC
       ============================================================ */
 
    /* Same vertical-stack pattern used on the login page */
    .form-stack {
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
    }
 
    .form-stack > .submit-btn { margin-top: 0.5rem; }
 
    /* Intro line under the form title */
    .form-intro {
      font-size: 0.92rem;
      line-height: 1.6;
      color: var(--text-mid);
      margin-bottom: 1.5rem;
      margin-top: -1rem; /* pull up under the form-header bottom margin */
    }
 
    /* Status messages (success / error) */
    .status-message {
      padding: 1rem 1.1rem;
      border-radius: var(--radius);
      font-size: 0.88rem;
      line-height: 1.55;
      display: flex;
      align-items: flex-start;
      gap: 0.7rem;
    }
 
    .status-message.success {
      background: rgba(43, 187, 94, 0.10);
      border: 1px solid rgba(43, 187, 94, 0.35);
      color: #1a7a3e;
    }
 
    .status-message.error {
      background: rgba(229, 72, 72, 0.10);
      border: 1px solid rgba(229, 72, 72, 0.35);
      color: #a82b2b;
    }
 
    .status-icon {
      flex-shrink: 0;
      width: 20px;
      height: 20px;
      margin-top: 1px;
    }
 
    .status-icon svg {
      width: 100%;
      height: 100%;
      stroke-width: 2.5;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
 
    .status-message.success .status-icon svg { stroke: #1a7a3e; }
    .status-message.error   .status-icon svg { stroke: #a82b2b; }
 
    .status-text strong {
      display: block;
      margin-bottom: 0.2rem;
      font-weight: 700;
    }
 
    /* "Try a different email" link inside the success state */
    .secondary-link {
      background: transparent;
      border: none;
      color: var(--accent);
      font-family: inherit;
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      padding: 0;
      align-self: flex-start;
      text-decoration: underline;
      text-underline-offset: 3px;
    }
 
    .secondary-link:hover { color: #005ead; }

.forgot-link-wrap {
  margin-top: auto;
  padding-top: 1.5rem;
  text-align: right;
}

.forgot-link {
  font-size: 0.82rem;
  color: var(--text-mid);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 0.18s, border-color 0.18s;
}

.forgot-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

 /* ============================================================
       NEW-PASSWORD-SPECIFIC
       (everything else lives in login.css)
       ============================================================ */

    /* Same vertical-stack pattern used on login + reset */
    .form-stack {
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
    }

    .form-stack > .submit-btn { margin-top: 0.5rem; }

    /* Intro line under the form title */
    .form-intro {
      font-size: 0.92rem;
      line-height: 1.6;
      color: var(--text-mid);
      margin-bottom: 1.5rem;
      margin-top: -1rem;
    }


/* Password requirements list */
.password-requirements {
  list-style: none;
  padding: 0;
  margin: -.85rem 0 0.15rem;
  font-size: 0.76rem;
  line-height: 1.35;
  color: #a82b2b;
  display: grid;
  gap: 0.28rem;
}

.password-requirements li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.18s;
}

.password-requirements li::before {
  content: '×';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(229, 72, 72, 0.10);
  border: 1px solid rgba(229, 72, 72, 0.38);
  color: #a82b2b;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-0.5px);
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.password-requirements li.is-met {
  color: #1a7a3e;
}

.password-requirements li.is-met::before {
  content: '✓';
  background: rgba(43, 187, 94, 0.11);
  border-color: rgba(43, 187, 94, 0.42);
  color: #1a7a3e;
}

.password-requirements-title {
  margin: -2rem 0 0.4rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-mid);
  font-weight: 700;
  letter-spacing: 0.02em;
}
    /* Status messages (success / error) */
    .status-message {
      padding: 1rem 1.1rem;
      border-radius: var(--radius);
      font-size: 0.88rem;
      line-height: 1.55;
      display: flex;
      align-items: flex-start;
      gap: 0.7rem;
    }

    .status-message.success {
      background: rgba(43, 187, 94, 0.10);
      border: 1px solid rgba(43, 187, 94, 0.35);
      color: #1a7a3e;
    }

    .status-message.error {
      background: rgba(229, 72, 72, 0.10);
      border: 1px solid rgba(229, 72, 72, 0.35);
      color: #a82b2b;
    }

    .status-icon {
      flex-shrink: 0;
      width: 20px;
      height: 20px;
      margin-top: 1px;
    }

    .status-icon svg {
      width: 100%;
      height: 100%;
      stroke-width: 2.5;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .status-message.success .status-icon svg { stroke: #1a7a3e; }
    .status-message.error   .status-icon svg { stroke: #a82b2b; }

    .status-text strong {
      display: block;
      margin-bottom: 0.2rem;
      font-weight: 700;
    }

    /* Inline secondary link (e.g. "Try again") */
    .secondary-link {
      background: transparent;
      border: none;
      color: var(--accent);
      font-family: inherit;
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      padding: 0;
      align-self: flex-start;
      text-decoration: underline;
      text-underline-offset: 3px;
    }

    .secondary-link:hover { color: #005ead; }

    /* Field-level inline error (under the confirm field) */
    .field-error {
      font-size: 0.78rem;
      color: #a82b2b;
      line-height: 1.4;
      min-height: 1.1em; /* reserves space so layout doesn't jump */
    }


/* ============================================================
    MOBILE — registration page
    Replaces the previous @media (max-width: 820px) block
   ============================================================ */
@media (max-width: 768px) {

  body {
    padding: 1rem 0.75rem;
    align-items: flex-start;
  }

  /* ── Card becomes vertical ── */
  .card {
    flex-direction: column;
    max-width: 100%;
    height: auto;
    border-radius: 14px;
  }

  /* ── Left panel sits on top, compact ── */
  .panel-left {
    width: 100%;
    padding: 2rem 1.5rem 1.75rem;
    min-height: 0;
  }

  .panel-left::before {
    width: 180px;
    height: 180px;
    bottom: -50px;
    right: -50px;
  }

  .panel-left::after {
    width: 110px;
    height: 110px;
    top: 10px;
    left: -40px;
  }

  .brand-tag {
    margin-bottom: 1rem;
    font-size: 0.65rem;
  }

  .left-heading {
    font-size: 1.25rem;
    line-height: 1.2;
  }

  /* let the heading wrap naturally on phones */
  .left-heading br {
    display: none;
  }

  .left-sub {
    font-size: 1rem;
    line-height: 1.55;
    margin-top: 0.45rem;
  }

  /* "Already have an account?" + button sit on one row */
  .panel-left-bottom {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .already-label {
    margin-bottom: 0;
  }

  .login-btn {
    width: auto;
    padding: 0.55rem 1.25rem;
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  /* ── Form panel below ── */
  #reg-form {
    width: 100%;
    min-width: 0;
  }

  .panel-middle {
    /* min-height is required so the absolutely-positioned step
       sections have a container to fill; without it, the step
       slide animation collapses */
    min-height: 680px;
    padding: 1.75rem 1.25rem 2rem;
  }

  .form-header {
    margin-bottom: 1.25rem;
  }

  .form-title {
    font-size: 1.4rem;
  }

  /* ── Grids stack to single column ── */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 1rem 0;
  }

  .field-row-3 {
    grid-template-columns: 1fr;
    gap: 1rem 0;
  }

  /* Subject + PACE pairs stay 2-col since they belong together */
  .subject-pairs-grid {
    gap: 0.7rem 0.75rem;
  }

  /* ── Step nav buttons ── */
  .step-nav-fixed {
    gap: 0.6rem;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
  }

  .step-btn {
    min-width: 0;
    flex: 1 1 0;
    padding: 0.6rem 0.65rem;
    font-size: 0.75rem;
    letter-spacing: 0;
  }

  /* On mobile, hide the back button entirely when invisible
     so Next takes the full width on step 1 */
  .step-back.is-invisible {
    display: none;
  }

  /* ── Section spacing ── */
  .form-stack,
  .account-details-stack,
  .right-section {
    gap: 1rem;
  }

  .radio-options {
    gap: 1rem;
  }

  /* Slightly larger inputs for touch targets */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="number"],
  input[type="tel"],
  select,
  textarea {
    font-size: 0.9rem;
    padding: 0.7rem 0.85rem;
  }
}

/* ── Extra-narrow phones (iPhone SE, older Androids) ── */
@media (max-width: 380px) {

  .panel-left {
    padding: 1.75rem 1.25rem 1.5rem;
  }

  .panel-middle {
    padding: 1.5rem 1rem 1.75rem;
  }

  .left-heading {
    font-size: 1.5rem;
  }

  /* stack the login row on very small screens */
  .panel-left-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .login-btn {
    width: 100%;
  }

  .step-btn {
    font-size: 0.7rem;
    padding: 0.55rem 0.5rem;
  }
}