/* ─────────────────────────────────────────────────────────────────────────────
   NexPrep Auth Pages — Login / Register / Forgot / Reset
   Design: Deep navy left panel + clean white right form
───────────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #0d1b2a;
  --navy-mid:   #1a2f45;
  --teal:       #0ea5a0;
  --teal-light: #14c4be;
  --teal-pale:  #e0f7f6;
  --cream:      #f8f6f1;
  --white:      #ffffff;
  --text:       #0d1b2a;
  --muted:      #778899;
  --border:     #e2e8f0;
  --danger:     #dc2626;
  --success:    #16a34a;
  --font:       'Sora', system-ui, -apple-system, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(13,27,42,.08), 0 1px 4px rgba(13,27,42,.04);
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

/* ── Hide header/footer on auth pages ─────────────────────────────────────── */
.nex-auth-body .nex-header,
.nex-auth-body .nex-footer,
.nex-auth-body .nex-bottom-nav,
.nex-auth-body .nex-drawer,
.nex-auth-body .nex-drawer-overlay,
.nex-auth-body #wpadminbar { display: none !important; }
.nex-auth-body { margin-top: 0 !important; padding-top: 0 !important; }

/* ── Full-page wrapper ─────────────────────────────────────────────────────── */
.nex-auth-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.nex-auth-wrap--centered {
  grid-template-columns: 1fr;
  place-items: center;
  background: linear-gradient(135deg, #0d1b2a 0%, #1a3a5c 50%, #0ea5a0 100%);
  padding: 24px 16px;
}

/* ── Left: Brand panel ─────────────────────────────────────────────────────── */
.nex-auth-brand {
  background: linear-gradient(160deg, #0d1b2a 0%, #0f2235 50%, #0a1628 100%);
  display: flex;
  flex-direction: column;
  padding: 40px 48px;
  position: relative;
  overflow: hidden;
}
.nex-auth-brand::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(14,165,160,.15) 0%, transparent 70%);
  pointer-events: none;
}
.nex-auth-brand::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(14,165,160,.08) 0%, transparent 70%);
  pointer-events: none;
}

.nex-auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-bottom: auto;
}
.nex-auth-logo--center {
  justify-content: center;
  margin-bottom: 32px;
}
.nex-auth-logo-mark {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--teal), #0b8a86);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(14,165,160,.4), 0 4px 16px rgba(14,165,160,.2);
  flex-shrink: 0;
}
.nex-auth-logo-mark--teal {
  background: linear-gradient(135deg, var(--teal), #0b8a86);
}
.nex-auth-logo-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--white);
  letter-spacing: -.02em;
}
.nex-auth-logo-text--dark { color: var(--text); }

.nex-auth-brand-content {
  margin-top: auto;
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}
.nex-auth-brand-content h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3rem);
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 16px;
  font-weight: 400;
}
.nex-auth-brand-content p {
  font-size: .95rem;
  color: rgba(232,244,243,.65);
  line-height: 1.6;
  max-width: 320px;
  margin-bottom: 32px;
}

.nex-auth-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.nex-auth-stat {
  display: flex;
  flex-direction: column;
}
.nex-auth-stat span {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--teal-light);
  font-family: 'Courier New', monospace;
  line-height: 1;
}
.nex-auth-stat small {
  font-size: .72rem;
  color: rgba(232,244,243,.5);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 3px;
}

.nex-auth-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nex-auth-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  color: rgba(232,244,243,.8);
}
.nex-auth-features li svg {
  width: 18px; height: 18px;
  color: var(--teal-light);
  flex-shrink: 0;
}

.nex-auth-brand-footer {
  font-size: .72rem;
  color: rgba(14,165,160,.5);
  letter-spacing: .05em;
  text-transform: uppercase;
  position: relative; z-index: 1;
}

/* ── Right: Form panel ─────────────────────────────────────────────────────── */
.nex-auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: var(--cream);
  overflow-y: auto;
}

.nex-auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* Centered layout (forgot/reset pages) */
.nex-auth-wrap--centered .nex-auth-form-wrap {
  background: transparent;
  width: 100%;
  max-width: 480px;
  padding: 0;
}
.nex-auth-wrap--centered .nex-auth-card {
  width: 100%;
  max-width: 480px;
}

.nex-auth-card-header {
  text-align: center;
  margin-bottom: 28px;
}
.nex-auth-card-header h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text);
  margin-bottom: 6px;
  font-weight: 400;
}
.nex-auth-card-header p {
  font-size: .9rem;
  color: var(--muted);
}

.nex-auth-icon-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--teal-pale);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.nex-auth-icon-circle svg { width: 28px; height: 28px; color: var(--teal); }
.nex-auth-icon-circle--red { background: #fee2e2; }
.nex-auth-icon-circle--red svg { color: var(--danger); }

/* ── Alert box ─────────────────────────────────────────────────────────────── */
.nex-auth-alert {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: .875rem;
  line-height: 1.6;
  margin-bottom: 20px;
  display: block;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}
.nex-auth-alert b,
.nex-auth-alert strong {
  font-weight: 700;
  word-break: break-all;
}
.nex-auth-alert a {
  display: inline;
  word-break: break-word;
}
.nex-auth-alert.is-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.nex-auth-alert.is-success { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }

/* ── Form fields ───────────────────────────────────────────────────────────── */
.nex-auth-form { display: flex; flex-direction: column; gap: 16px; }

.nex-auth-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.nex-auth-field { display: flex; flex-direction: column; gap: 6px; }
.nex-auth-field label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nex-auth-field-link {
  font-weight: 500;
  color: var(--teal);
  text-decoration: none;
  font-size: .78rem;
}
.nex-auth-field-link:hover { color: #0b8a86; text-decoration: underline; }

.nex-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.nex-auth-input-wrap input,
.nex-auth-input-wrap select {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 44px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
}
.nex-auth-input-wrap input:focus,
.nex-auth-input-wrap select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14,165,160,.12);
}
.nex-auth-input-wrap input::placeholder { color: #b0bec5; }
.nex-auth-input-wrap input:not(:placeholder-shown):valid { border-color: #a7f3d0; }
.nex-auth-select-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  width: 10px; height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px);
  pointer-events: none;
}

.nex-auth-icon {
  position: absolute;
  left: 14px;
  width: 18px; height: 18px;
  color: var(--muted);
  pointer-events: none;
  flex-shrink: 0;
}
.nex-auth-toggle-pass {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.nex-auth-toggle-pass:hover,
.nex-auth-toggle-pass:active {
  color: var(--teal);
  background: rgba(14,165,160,.08);
}
.nex-auth-toggle-pass svg { width: 18px; height: 18px; }

/* Password strength meter */
.nex-pw-strength {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.nex-pw-bars {
  display: flex;
  gap: 4px;
  flex: 1;
}
.nex-pw-bars div {
  height: 4px;
  flex: 1;
  background: var(--border);
  border-radius: 2px;
  transition: background .2s;
}
.nex-pw-label {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
}
.nex-pw-strength.pw-1 .nex-pw-bars div:nth-child(1) { background: var(--danger); }
.nex-pw-strength.pw-2 .nex-pw-bars div:nth-child(-n+2) { background: #f97316; }
.nex-pw-strength.pw-3 .nex-pw-bars div:nth-child(-n+3) { background: #eab308; }
.nex-pw-strength.pw-4 .nex-pw-bars div { background: var(--success); }

/* ── Checkbox ──────────────────────────────────────────────────────────────── */
.nex-auth-row { display: flex; align-items: center; justify-content: space-between; }
.nex-auth-check {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.5;
}
.nex-auth-check input[type="checkbox"] {
  width: 18px; height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--teal);
}
.nex-auth-check a { color: var(--teal); text-decoration: none; }
.nex-auth-check a:hover { text-decoration: underline; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.nex-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  width: 100%;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 600;
  font-family: var(--font);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  background: linear-gradient(135deg, var(--teal) 0%, #0b8a86 100%);
  color: var(--white);
  box-shadow: 0 2px 16px rgba(14,165,160,.25);
  -webkit-tap-highlight-color: transparent;
}
.nex-auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(14,165,160,.35);
  color: var(--white);
}
.nex-auth-btn:active { transform: translateY(0); }
.nex-auth-btn[disabled] { opacity: .6; pointer-events: none; cursor: not-allowed; }

.nex-auth-btn-outline {
  background: var(--white);
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
  margin-top: 0;
}
.nex-auth-btn-outline:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-pale);
  transform: none;
  box-shadow: none;
}

/* Spinner */
.nex-spin {
  animation: nexSpin .8s linear infinite;
  width: 20px; height: 20px;
}
@keyframes nexSpin { to { transform: rotate(360deg); } }

/* ── Divider ────────────────────────────────────────────────────────────────── */
.nex-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: .8rem;
  color: var(--muted);
}
.nex-auth-divider::before,
.nex-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Back link */
.nex-auth-back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: .875rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
  padding: 8px;
}
.nex-auth-back-link:hover { color: var(--text); }
.nex-auth-back-link svg { width: 16px; height: 16px; }

/* ── Mobile responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Switch to single column, hide brand panel */
  .nex-auth-wrap {
    grid-template-columns: 1fr;
    overflow-x: hidden;
  }
  .nex-auth-brand { display: none !important; }

  /* Form wrap: full viewport */
  .nex-auth-form-wrap {
    padding: 0;
    min-height: 100vh;
    width: 100%;
    background: #ffffff;
    align-items: flex-start;
    overflow-x: hidden;
  }

  /* Card: full width, no border/shadow — IS the page on mobile */
  .nex-auth-card {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    padding: 0 0 40px;
    box-shadow: none;
    border: none;
    background: #ffffff;
  }

  /* Mobile logo show */
  .nex-auth-mobile-logo { display: flex !important; }

  /* Header alignment */
  .nex-auth-card-header {
    padding: 28px 24px 20px;
    text-align: left;
    margin-bottom: 0;
  }
  .nex-auth-card-header h1 {
    font-size: 1.75rem;
    text-align: left;
    margin-bottom: 4px;
  }
  .nex-auth-card-header p { text-align: left; }

  /* Alert */
  .nex-auth-alert {
    margin: 12px 20px;
    font-size: .82rem;
    line-height: 1.6;
    padding: 14px 16px;
    display: block;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* The form itself */
  .nex-auth-form {
    padding: 0 24px;
    gap: 16px;
  }

  /* Inputs — prevent iOS zoom (font-size must be ≥16px) */
  .nex-auth-input-wrap input,
  .nex-auth-input-wrap select {
    font-size: 16px !important;
    height: 52px;
  }

  /* First/Last name row becomes stacked */
  .nex-auth-field-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Submit button */
  .nex-auth-btn {
    height: 54px;
    font-size: 1rem;
    border-radius: 14px;
    width: calc(100% - 48px);
    margin-left: 24px;
    margin-right: 24px;
    box-sizing: border-box;
  }

  /* Divider */
  .nex-auth-divider {
    margin: 16px 24px;
  }

  /* Back link */
  .nex-auth-back-link {
    margin: 4px 24px 20px;
    justify-content: flex-start;
  }

  /* Row (remember me) */
  .nex-auth-row { padding: 0; }
}

@media (max-width: 380px) {
  .nex-auth-card-header { padding: 24px 20px 16px; }
  .nex-auth-form { padding: 0 20px; }
  .nex-auth-btn { margin-left: 20px; margin-right: 20px; width: calc(100% - 40px); }
  .nex-auth-divider { margin: 14px 20px; }
  .nex-auth-alert { margin: 10px 16px; display: block; word-wrap: break-word; overflow-wrap: break-word; }
}

/* ── Register page nursing illustration ────────────────────────────────────── */
.nex-auth-brand-illustration {
  width: 100%;
  padding: 20px 24px 8px;
  display: flex;
  justify-content: center;
}
.nex-auth-brand-illustration svg {
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.2));
  animation: float-nurse 4s ease-in-out infinite;
}
@keyframes float-nurse {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
@media (max-width: 768px) {
  .nex-auth-brand-illustration { display: none; }
}

/* ── Auth brand illustration ─────────────────────────────────────────────────── */
.nex-auth-brand-illustration {
  margin: 20px 0 16px;
  padding: 0 16px;
}

/* ── Testimonial widget on login brand panel ─────────────────────────────────── */
.nex-auth-testimonial {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(14,165,160,.2);
  border-radius: 14px;
  padding: 16px;
  margin-top: 16px;
}
.nex-auth-testimonial__stars {
  color: #f59e0b;
  font-size: 1rem;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.nex-auth-testimonial__text {
  color: rgba(232,244,243,.85);
  font-size: .875rem;
  line-height: 1.55;
  margin: 0 0 12px;
  font-style: italic;
}
.nex-auth-testimonial__author {
  display: flex; align-items: center; gap: 10px;
}
.nex-auth-testimonial__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #0ea5a0, #0b8a86);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.nex-auth-testimonial__name {
  font-size: .8rem; font-weight: 600; color: #fff;
}
.nex-auth-testimonial__badge {
  font-size: .65rem; font-weight: 700; color: #4ade80;
  text-transform: uppercase; letter-spacing: .06em;
}

/* Kill any floating toast on auth pages — only inline alert should show */
#nex-toast,
.nex-toast,
[id="nex-toast"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}
