/* ── AUTH LAYOUT ── */
.auth-body {
  min-height: 100vh;
  background: var(--gray-light);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ── LEFT PANEL ── */
.auth-left {
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-mid) 60%, #1a3a6e 100%);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(255,107,0,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.auth-left::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(10,191,163,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.auth-left-tagline {
  position: relative;
  z-index: 1;
}

.auth-left-tagline h2 {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.auth-left-tagline h2 span { color: var(--saffron); }

.auth-left-tagline p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
}

.auth-left-stats {
  display: flex;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.als {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
}

.als span {
  display: block;
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--saffron);
  line-height: 1;
  margin-bottom: 2px;
}

/* ── RIGHT PANEL ── */
.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--white);
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 0.5rem 0;
}

/* ── AUTH CARD INTERNALS ── */
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-icon {
  font-size: 2.4rem;
  margin-bottom: 0.75rem;
  display: block;
}

.auth-header h1 {
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

.auth-header p {
  font-size: 0.9rem;
  color: var(--gray-mid);
}

.auth-email-chip {
  display: inline-block;
  background: var(--saffron-pale);
  color: var(--saffron);
  border: 1px solid rgba(255,107,0,0.2);
  border-radius: 50px;
  padding: 4px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* ── FORM ── */
.auth-form { display: flex; flex-direction: column; gap: 1rem; }

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

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy-mid);
  letter-spacing: 0.02em;
}

.auth-form input,
.auth-form select,
.edit-form input,
.edit-form select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #DDE2F0;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--navy);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.auth-form input:focus,
.auth-form select:focus,
.edit-form input:focus,
.edit-form select:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(255,107,0,0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-error {
  font-size: 0.75rem;
  color: #E74C3C;
  font-weight: 500;
}

.form-error--global {
  background: #fdf0ef;
  border: 1px solid #f5c6c2;
  border-radius: 8px;
  padding: 10px 14px;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--gray-mid);
}

/* Password field */
.input-password-wrap {
  position: relative;
}

.input-password-wrap input { padding-right: 42px; }

.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 4px;
}

.toggle-pw:hover { opacity: 1; }

/* Primary button */
.btn-auth-primary {
  width: 100%;
  background: var(--saffron);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  padding: 13px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  margin-top: 0.25rem;
  -webkit-tap-highlight-color: transparent;
}

.btn-auth-primary:hover { background: var(--saffron-light); transform: translateY(-1px); }
.btn-auth-primary:active { transform: translateY(0); }

.btn-auth-secondary {
  width: 100%;
  background: #fff;
  color: var(--saffron);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 11px;
  border-radius: 10px;
  border: 1.5px solid var(--saffron);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-auth-secondary:hover { background: rgba(255,107,0,0.06); transform: translateY(-1px); }
.btn-auth-secondary:active { transform: translateY(0); }
.btn-auth-secondary:disabled { opacity: 0.6; cursor: default; transform: none; }

/* Method buttons */
.auth-choose-label {
  font-size: 0.8rem;
  color: var(--gray-mid);
  text-align: center;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.btn-method {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 1.5px solid #DDE2F0;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-method:hover {
  border-color: var(--saffron);
  background: var(--saffron-pale);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,107,0,0.1);
}

.btn-method-icon { font-size: 1.5rem; flex-shrink: 0; }

.btn-method-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
}

.btn-method-sub {
  font-size: 0.75rem;
  color: var(--gray-mid);
  margin-top: 2px;
}

.btn-method-arrow {
  margin-left: auto;
  color: var(--gray-mid);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Divider / switch / misc */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: var(--gray-mid);
  font-size: 0.78rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E8EBF5;
}

.auth-switch {
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-mid);
}

.auth-switch a {
  color: var(--saffron);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover { text-decoration: underline; }

.auth-forgot-row {
  text-align: right;
  margin-top: -0.25rem;
}

.auth-forgot-row a {
  font-size: 0.8rem;
  color: var(--saffron);
  text-decoration: none;
  font-weight: 500;
}

.auth-resend {
  text-align: center;
  font-size: 0.83rem;
  color: var(--gray-mid);
  margin-top: 0.75rem;
}

.btn-text {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--saffron);
  font-weight: 600;
  font-size: 0.83rem;
  padding: 0 4px;
  font-family: var(--font-body);
}

.btn-text:hover { text-decoration: underline; }

/* Alerts */
.auth-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.auth-alert--success { background: #e8faf2; color: #1a7a4a; border: 1px solid #b8e8d0; }
.auth-alert--error,
.auth-alert--warning { background: #fdf0ef; color: #c0392b; border: 1px solid #f5c6c2; }
.auth-alert--info    { background: #e8f4fd; color: #1a5a8a; border: 1px solid #b8d8f0; }

/* ── RESPONSIVE: TABLET ── */
@media (max-width: 860px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { min-height: 100vh; }
}

@media (max-width: 480px) {
  .auth-right { padding: 1.5rem 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .auth-left-stats { flex-wrap: wrap; }
}
/* ── Submit button loading state (register form) ── */
.btn-auth-primary .btn-spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.45);
  border-top-color: #fff;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  animation: ck-spin 0.7s linear infinite;
}
.btn-auth-primary.is-loading .btn-spinner { display: inline-block; }
.btn-auth-primary.is-loading { opacity: 0.85; cursor: progress; }
.btn-auth-primary.is-loading .btn-label { vertical-align: middle; }
@keyframes ck-spin { to { transform: rotate(360deg); } }

/* ── Back button (top-left, all auth pages) ── */
.auth-back-btn {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 50;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;                       /* sits on the navy left panel on desktop */
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-decoration: none;
  backdrop-filter: blur(4px);
  transition: background 0.15s ease, transform 0.15s ease;
}
.auth-back-btn:hover { background: rgba(255, 255, 255, 0.26); transform: translateX(-2px); }

/* On mobile (≤860px) the navy left panel is hidden and the page bg is
   light — switch to a light chip with dark arrow so it stays visible. */
@media (max-width: 860px) {
  .auth-back-btn {
    background: #fff;
    color: var(--navy, #0D1B3E);
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(13, 27, 62, 0.10);
    top: 14px;
    left: 14px;
  }
  .auth-back-btn:hover { background: #f6f7fb; }
}

/* Desktop: nudge the branding logo right so the back button doesn't
   overlap it (button is fixed at top-left of the navy panel). */
@media (min-width: 861px) {
  .auth-back-btn + .auth-page .auth-logo { margin-left: 52px; }
}