/* =============================================
   ZEDEK AUTH — Design System
   Matches the landing page visual identity
============================================= */

/* --- Variables --- */
:root {
  --navy:        #0f172a;
  --green-deep:  #064e3b;
  --green-mid:   #065f46;
  --emerald:     #059669;
  --emerald-lt:  #d1fae5;
  --gold:        #fbbf24;
  --slate-50:    #f8fafc;
  --slate-100:   #f1f5f9;
  --slate-200:   #e2e8f0;
  --slate-400:   #94a3b8;
  --slate-500:   #64748b;
  --slate-600:   #475569;
  --slate-700:   #334155;
  --slate-900:   #0f172a;
  --font-head:   'General Sans', sans-serif;
  --font-body:   'Satoshi', sans-serif;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--slate-100);
  color: var(--slate-900);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
input, select, button, textarea { font-family: var(--font-body); }

/* =============================================
   LAYOUT — Two-column card
============================================= */
.auth-shell {
  width: 100%;
  max-width: 960px;
  min-height: 560px;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(15,23,42,0.12), 0 4px 16px rgba(15,23,42,0.06);
  overflow: hidden;
  display: flex;
}

/* Brand panel — left side, desktop only */
.auth-brand {
  width: 42%;
  flex-shrink: 0;
  background: linear-gradient(160deg, #0d2137 0%, var(--green-deep) 100%);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
/* subtle glow top-left */
.auth-brand::before {
  content: '';
  position: absolute;
  top: -4rem; left: -4rem;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(251,191,36,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -5rem;
  right: -5rem;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(5,150,105,0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Logo — image-based for desktop brand panel */
.auth-logo {
  display: inline-block;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
  background: white;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.auth-logo img {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
}
/* Hide the old text-only name span if ever present */
.auth-logo-name { display: none; }

.brand-headline {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}
.brand-headline span { color: var(--gold); }

.brand-sub {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.65;
  position: relative;
  z-index: 1;
}

.brand-stat {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  position: relative;
  z-index: 1;
}
.brand-stat-number {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  line-height: 1;
  margin-bottom: 0.2rem;
}
.brand-stat-label {
  font-size: 0.72rem;
  color: #6ee7b7;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.brand-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

/* Form panel — right side */
.auth-form-panel {
  flex: 1;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

/* =============================================
   MOBILE LOGO HEADER — shown only on mobile,
   sits above the form panel. Hidden on desktop.
============================================= */
.mobile-logo-header {
  display: none; /* hidden on desktop */
}

/* =============================================
   MOBILE-ONLY layout — Option A
   Brand panel is hidden; real logo floats above form
============================================= */
@media (max-width: 700px) {
  body { padding: 0; align-items: stretch; background: var(--slate-100); }

  .auth-shell {
    flex-direction: column;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
    background: transparent;
  }

  /* Hide the entire brand panel on mobile */
  .auth-brand { display: none; }

  /* Show the mobile logo header */
  .mobile-logo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 1.25rem;
    background: transparent;
  }
  .mobile-logo-header img {
    width: auto;
    height: 52px;
    object-fit: contain;
  }

  /* Form panel becomes a white card below the logo */
  .auth-form-panel {
    flex: 1;
    background: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 2rem 1.5rem 2.5rem;
    box-shadow: 0 -4px 32px rgba(15,23,42,0.08);
    overflow-y: auto;
    /* re-trigger the fade-up on mobile too */
    animation: fadeUp 0.35s ease both;
  }
}

/* =============================================
   FORM ELEMENTS
============================================= */
.form-heading {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--slate-900);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}
.form-subheading {
  font-size: 0.875rem;
  color: var(--slate-500);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--slate-700);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--slate-900);
  background: var(--slate-50);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  outline: none;
}
.input:focus {
  border-color: var(--emerald);
  background: white;
  box-shadow: 0 0 0 3px rgba(5,150,105,0.1);
}
.input::placeholder { color: var(--slate-400); }

select.input {
  appearance: none;
  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='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.2rem;
}

/* Password wrapper */
.pw-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrapper .input { padding-right: 2.75rem; }
.toggle-password {
  position: absolute;
  right: 0.7rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--slate-400);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  font-size: 1.1rem;
}
.toggle-password:hover { color: var(--slate-700); background: var(--slate-100); }
.toggle-password:focus { outline: 2px solid var(--emerald); outline-offset: 2px; }

/* Password strength bar */
.pw-strength-wrap { margin-top: 0.4rem; margin-bottom: 0.1rem; }
.pw-strength-bars { display: flex; gap: 4px; margin-bottom: 0.25rem; }
.pw-bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--slate-200);
  transition: background 0.2s;
}
.pw-bar.weak   { background: #ef4444; }
.pw-bar.medium { background: var(--gold); }
.pw-bar.strong { background: var(--emerald); }
.pw-strength-label { font-size: 0.72rem; color: var(--slate-400); }
.pw-match { font-size: 0.8rem; margin-top: 0.3rem; display: block; min-height: 1.1em; }
.pw-match.ok  { color: var(--emerald); }
.pw-match.err { color: #ef4444; }

/* Phone combo */
.phone-combo {
  display: flex;
  gap: 0.5rem;
}
.phone-combo select.input { width: 38%; flex-shrink: 0; }
.phone-combo input.input  { flex: 1; }
@media (max-width: 380px) {
  .phone-combo { flex-direction: column; }
  .phone-combo select.input { width: 100%; }
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--emerald);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}
.checkbox-group label {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--slate-600);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  line-height: 1.5;
}
.checkbox-group label .error { display: block; color: #ef4444; font-size: 0.75rem; margin-top: 0.2rem; }

/* Buttons */
.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.8rem 1.5rem;
  background: var(--green-deep);
  color: white;
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
  margin-bottom: 0.75rem;
}
.primary-btn:hover  { background: var(--green-mid); }
.primary-btn:active { transform: scale(0.98); }

.secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--slate-600);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  margin-bottom: 0.75rem;
}
.secondary-btn:hover { border-color: var(--slate-400); background: var(--slate-50); }

/* Error display */
.error {
  display: block;
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 0.3rem;
}

/* Divider */
.form-divider {
  height: 1px;
  background: var(--slate-100);
  margin: 1.25rem 0;
}

/* Links row */
.auth-links {
  font-size: 0.85rem;
  color: var(--slate-500);
  text-align: center;
  line-height: 1.6;
}
.auth-links a,
.accent-link {
  color: var(--emerald);
  font-weight: 700;
}
.auth-links a:hover,
.accent-link:hover { text-decoration: underline; }

.forgot-password {
  display: block;
  text-align: right;
  font-size: 0.8rem;
  color: var(--emerald);
  font-weight: 600;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}
.forgot-password:hover { text-decoration: underline; }

/* =============================================
   NOTICE BANNERS
============================================= */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.notice iconify-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.notice-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.notice-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.notice-success { background: var(--emerald-lt); border: 1px solid #a7f3d0; color: #065f46; }

/* Logout/session banners */
.logout-banner {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  margin-bottom: 1rem;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.banner-warning { background: #fffbeb; border: 1px solid #fde68a; color: #7c5f00; }
.banner-info    { background: var(--emerald-lt); border: 1px solid #a7f3d0; color: #1b5e20; }

/* =============================================
   STEP INDICATOR
============================================= */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.5rem;
}
.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--slate-400);
  background: white;
  flex-shrink: 0;
  transition: all 0.2s;
}
.step-dot.active  { border-color: var(--emerald); background: var(--emerald); color: white; }
.step-dot.done    { border-color: var(--emerald); background: var(--emerald-lt); color: var(--emerald); }
.step-line {
  flex: 1;
  height: 2px;
  background: var(--slate-200);
  transition: background 0.3s;
}
.step-line.done { background: var(--emerald); }

/* =============================================
   OTP INPUT GRID
============================================= */
.otp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.otp-box {
  text-align: center;
  padding: 0.75rem 0.5rem;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--slate-900);
  background: var(--slate-50);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  caret-color: var(--emerald);
}
.otp-box:focus {
  border-color: var(--emerald);
  background: white;
  box-shadow: 0 0 0 3px rgba(5,150,105,0.1);
}

/* =============================================
   SUCCESS STATE
============================================= */
.success-wrap {
  text-align: center;
  padding: 1rem 0;
}
.success-icon-circle {
  width: 56px;
  height: 56px;
  background: var(--emerald-lt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald);
  font-size: 1.5rem;
  margin: 0 auto 1rem;
}

/* =============================================
   PASSWORD VALIDATION BOX
============================================= */
.validation-message {
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  display: none;
}
.validation-message.success { background: var(--emerald-lt); color: #065f46; border: 1px solid #a7f3d0; }
.validation-message.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* =============================================
   MESSAGES (Django)
============================================= */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li {
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}
.messages .success { background: var(--emerald-lt); color: #065f46; border: 1px solid #a7f3d0; }
.messages .error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.messages .warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.messages .info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* =============================================
   ANIMATIONS
============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-form-panel { animation: fadeUp 0.35s ease both; }

/* =============================================
   HIDDEN UTILITY
============================================= */
.hidden { display: none !important; }

/* =============================================
   MUTED HELPER TEXT
============================================= */
.muted {
  font-size: 0.75rem;
  color: var(--slate-400);
  display: block;
  margin-top: 0.3rem;
  line-height: 1.5;
}


  body { padding: 1.5rem; }
  @media (max-width: 700px) { body { padding: 0; } }

  /* Fix OTP boxes width */
  .otp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    max-width: 280px;
    margin: 0 auto 1.25rem;
  }

  .otp-box {
    width: 100%;
    aspect-ratio: 1;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
  }

  .banner-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  /* match whatever padding/border-radius your other banners use */
}