/* ==========================================================================
   BrightPath — Auth Layout Stylesheet
   Shared shell used by login.html, forgot-password.html, create-password.html
   Breakpoints follow Bootstrap: sm <576, md 576-991 (tablet), lg 992px+ (desktop)
   ========================================================================== */

:root {
  --primary: #1E3A8A;
  --secondary: #2563EB;
  --accent: #F59E0B;
  --success: #10B981;
  --danger: #DC2626;
  --bg: #F8FAFC;
  --text-dark: #0F172A;
  --text-light: #64748B;
  --white: #FFFFFF;

  --gradient-primary: linear-gradient(155deg, #1E3A8A 0%, #2563EB 100%);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-medium: 0 25px 60px rgba(30, 58, 138, 0.18);

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;

  --font-display: 'Fraunces', 'Poppins', serif;
  --font-body: 'Poppins', sans-serif;
  --transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--bg);
  line-height: 1.6;
}

a { text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: var(--white); }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============ SHELL: split screen on desktop (lg), single card below ============ */
.auth-shell {
  min-height: 100vh;
  display: flex;
}

/* Brand / illustration panel — visible from lg (992px) up */
.auth-brand-panel {
  display: none;
  flex: 0 0 44%;
  position: relative;
  background: var(--gradient-primary);
  color: var(--white);
  padding: 56px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.auth-brand-panel::before,
.auth-brand-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(4px);
}
.auth-brand-panel::before {
  width: 340px; height: 340px;
  background: rgba(245, 158, 11, 0.18);
  top: -100px; right: -100px;
}
.auth-brand-panel::after {
  width: 220px; height: 220px;
  background: rgba(255, 255, 255, 0.08);
  bottom: -60px; left: -60px;
}
.auth-brand-top, .auth-brand-bottom { position: relative; z-index: 1; }
.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
}
.auth-brand-mark {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.auth-brand-quote {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1.35;
  max-width: 420px;
  margin-top: 40px;
}
.auth-brand-quote span { color: var(--accent); }
.auth-brand-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
}
.auth-brand-meta .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.auth-progress-steps {
  display: flex;
  gap: 10px;
}
.auth-progress-steps span {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,0.2);
}
.auth-progress-steps span.done { background: var(--accent); }

/* Form panel */
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
.auth-card-mobile-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 32px;
}
.auth-card-mobile-logo .auth-brand-mark {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 10px;
}
.auth-eyebrow::before {
  content: "";
  width: 20px; height: 2px;
  background: var(--accent);
  display: inline-block;
}
.auth-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin: 0 0 8px;
  color: var(--text-dark);
}
.auth-subtitle {
  color: var(--text-light);
  font-size: 0.95rem;
  margin: 0 0 28px;
}
.auth-subtitle strong { color: var(--text-dark); }

/* Flash message (passed between pages) */
.auth-flash {
  display: none;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 22px;
}
.auth-flash.show { display: flex; }

/* Form elements */
.auth-field { margin-bottom: 20px; }
.auth-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 7px;
}
.auth-input-wrap { position: relative; }
.auth-input {
  width: 100%;
  border: 1.5px solid #E2E8F0;
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--white);
  transition: var(--transition);
}
.auth-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.auth-input.has-icon { padding-right: 46px; }
.auth-input-icon-btn {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border: none;
  background: transparent;
  color: var(--text-light);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: var(--transition);
}
.auth-input-icon-btn:hover { background: #F1F5F9; color: var(--text-dark); }

.auth-field-error {
  display: none;
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 6px;
}
.auth-field.invalid .auth-input { border-color: var(--danger); }
.auth-field.invalid .auth-field-error { display: block; }

.auth-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -6px 0 22px;
  font-size: 0.88rem;
}
.auth-link {
  color: var(--secondary);
  font-weight: 600;
  transition: var(--transition);
}
.auth-link:hover { color: var(--primary); text-decoration: underline; }

.auth-check { display: flex; align-items: center; gap: 8px; color: var(--text-light); }
.auth-check input { width: 16px; height: 16px; accent-color: var(--secondary); }

.auth-btn {
  width: 100%;
  border: none;
  border-radius: 50px;
  padding: 14px 20px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}
.auth-btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-medium); }
.auth-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.auth-btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid #E2E8F0;
}
.auth-btn-ghost:hover { border-color: var(--secondary); color: var(--secondary); }

.auth-divider-text {
  text-align: center;
  color: var(--text-light);
  font-size: 0.88rem;
  margin-top: 26px;
}

/* OTP boxes — signature element */
.otp-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.otp-box {
  width: 100%;
  aspect-ratio: 1;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1.5px solid #E2E8F0;
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text-dark);
  transition: var(--transition);
}
.otp-box:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
  transform: translateY(-2px);
}
.otp-box.filled { border-color: var(--secondary); }

.otp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--text-light);
  margin-bottom: 24px;
}
.otp-resend {
  color: var(--secondary);
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.otp-resend:disabled {
  color: var(--text-light);
  cursor: not-allowed;
}

/* Password strength meter */
.pw-strength {
  display: flex;
  gap: 6px;
  margin: 10px 0 4px;
}
.pw-strength span {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: #E2E8F0;
  transition: var(--transition);
}
.pw-strength-label {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 18px;
  display: block;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 24px;
  transition: var(--transition);
}
.auth-back-link:hover { color: var(--primary); }

/* Toast */
.auth-toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-dark);
  color: var(--white);
  padding: 13px 24px;
  border-radius: 50px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-medium);
  display: flex; align-items: center; gap: 8px;
  opacity: 0;
  transition: var(--transition);
  z-index: 999;
  pointer-events: none;
}
.auth-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ Responsive ============ */
/* md: tablet 576–991px — card only, wider padding */
@media (min-width: 576px) {
  .auth-form-panel { padding: 60px 32px; }
}

/* lg: desktop 992px+ — split screen shell appears */
@media (min-width: 992px) {
  .auth-brand-panel { display: flex; }
  .auth-card-mobile-logo { display: none; }
  .auth-form-panel { padding: 60px; }
}

@media (max-width: 380px) {
  .otp-row { gap: 7px; }
  .otp-box { font-size: 1.1rem; }
}
