/* ============================================================
   CLIFO — Auth Pages (Login & Register) — Bento Design System
   Same palette & tokens as landing.css
   ============================================================ */

@font-face { font-family:'Druk Wide'; src:url('/fonts/DrukWideBold.ttf') format('truetype'); font-weight:800; font-display:swap; }
@font-face { font-family:'Evolventa';  src:url('/fonts/Evolventa-Regular.ttf') format('truetype'); font-weight:400; font-display:swap; }
@font-face { font-family:'Evolventa';  src:url('/fonts/Evolventa-Bold.ttf')    format('truetype'); font-weight:700; font-display:swap; }

/* ── Tokens ───────────────────────────────────────────────── */
:root {
  --page:    #F2F2F2;
  --card:    #ffffff;
  --dark:    #1a1a1a;
  --accent:  #EA3F2F;
  --accent2: #D13527;
  --alight:  rgba(234,63,47,.09);
  --border:  #F2F2F2;
  --muted:   #888;
  --dim:     #bbb;

  --r-sm: 14px; --r-md: 18px; --r-lg: 22px; --r-xl: 26px; --r-pill: 999px;
  --sh-sm: 0 1px 3px rgba(0,0,0,.04);
  --sh-md: 0 4px 18px rgba(0,0,0,.07);
  --sh-lg: 0 8px 36px rgba(0,0,0,.09);

  --f-display: 'Druk Wide','Evolventa','Arial Black',sans-serif;
  --f-head:    'Evolventa','Segoe UI',sans-serif;
  --f-body:    'Evolventa','Segoe UI',sans-serif;
  --ease: cubic-bezier(.25,.46,.45,.94);
}

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

/* ── Page base ────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--page);
  font-family: var(--f-body);
  color: var(--dark);
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: stretch;
}

/* ── Two-column shell ─────────────────────────────────────── */
.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════
   LEFT — Form Panel
══════════════════════════════════════════════════════════════ */
.auth-form-panel {
  background: var(--card);
  display: flex;
  flex-direction: column;
  padding: clamp(24px,4vw,48px);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

/* Topbar */
.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(28px,5vh,52px);
  flex-shrink: 0;
}

.auth-brand {
  font-family: var(--f-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--dark);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.auth-brand span { color: var(--accent); }

/* Hidden native select kept for JS compatibility */
.auth-language-wrap select { display: none; }

/* ── Custom language dropdown ─────────────────────────────── */
.lang-select { position: relative; }

.lang-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  font-family: var(--f-head);
  font-weight: 700;
  font-size: .82rem;
  line-height: 1;
  color: var(--dark);
  cursor: pointer;
  transition: all .2s var(--ease);
  white-space: nowrap;
  user-select: none;
}
.lang-trigger:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.lang-trigger.open {
  border-color: var(--accent);
  background: var(--alight);
  color: var(--accent);
}
.lang-trigger-chevron {
  width: 14px; height: 14px;
  transition: transform .2s var(--ease);
  flex-shrink: 0;
  opacity: .6;
}
.lang-trigger.open .lang-trigger-chevron { transform: rotate(180deg); }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: 6px;
  min-width: 172px;
  z-index: 200;
  display: none;
  flex-direction: column;
  gap: 2px;
  /* animate in */
  animation: dropIn .15s var(--ease);
}
.lang-dropdown.open { display: flex; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  font-family: var(--f-head);
  font-weight: 700;
  font-size: .84rem;
  color: #555;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  white-space: nowrap;
  width: 100%;
}
.lang-option:hover {
  background: var(--page);
  color: var(--dark);
}
.lang-option.active {
  background: var(--alight);
  color: var(--accent);
}
.lang-option-flag { font-size: .95rem; flex-shrink: 0; line-height: 1; }
.lang-option-name { flex: 1; }
.lang-option-check {
  width: 14px; height: 14px;
  flex-shrink: 0;
  opacity: 0;
}
.lang-option.active .lang-option-check { opacity: 1; }

/* Form body — centered vertically */
.auth-form-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  justify-content: center;
  padding-bottom: 24px;
}

/* Title & subtitle */
.auth-title {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 8px;
  word-break: normal;
  overflow-wrap: break-word;
}

.auth-subtitle {
  font-size: .92rem;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ── Google OAuth button ───────────────────────────────────── */
.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  font-family: var(--f-head);
  font-weight: 700;
  font-size: .92rem;
  line-height: 1;
  color: var(--dark);
  text-decoration: none;
  cursor: pointer;
  transition: all .2s var(--ease);
  margin-bottom: 20px;
}
.auth-google-btn:hover {
  border-color: var(--muted);
  background: rgba(0,0,0,.02);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}
.auth-google-btn svg { flex-shrink: 0; }
.auth-google-btn.btn-disabled { opacity: .45; pointer-events: none; cursor: not-allowed; }

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

/* ── Error alert ──────────────────────────────────────────── */
.auth-error {
  background: rgba(239,68,68,.07);
  border: 1px solid rgba(239,68,68,.2);
  color: #dc2626;
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: .88rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ── Form fields ──────────────────────────────────────────── */
.auth-field { margin-bottom: 16px; }

.auth-field label {
  display: block;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: .82rem;
  color: var(--dark);
  margin-bottom: 6px;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  background: var(--page);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--f-body);
  font-size: .92rem;
  color: var(--dark);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(234,63,47,.1);
  background: var(--card);
}
.auth-field input::placeholder { color: var(--dim); }

/* Password input wrapper with toggle button */
.input-wrap {
  position: relative;
}
.input-wrap input[type="password"],
.input-wrap input[type="text"] {
  padding-right: 44px !important;
}
.password-toggle {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--dim);
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: color .18s;
  line-height: 0;
}
.password-toggle:hover { color: var(--dark); }
.password-toggle:focus-visible { outline: 2px solid var(--accent); }

/* Forgot link */
.auth-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 7px;
}
.auth-forgot-row a {
  font-size: .8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.auth-forgot-row a:hover { color: var(--accent); }

/* ── Consent checkbox ─────────────────────────────────────── */
.auth-consent-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--page);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  cursor: pointer;
}
.auth-consent-wrap input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.auth-consent-wrap span {
  font-size: .82rem;
  color: #555;
  line-height: 1.55;
}
.auth-consent-wrap a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}
.auth-consent-wrap a:hover { text-decoration: underline; }

/* ── Submit button ────────────────────────────────────────── */
.auth-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: all .25s var(--ease);
  box-shadow: 0 4px 14px rgba(234,63,47,.25);
  margin-top: 4px;
}
.auth-submit-btn:hover {
  background: var(--accent2);
  box-shadow: 0 6px 22px rgba(234,63,47,.35);
  transform: translateY(-2px);
}
.auth-submit-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Footer links ─────────────────────────────────────────── */
.auth-footer-links {
  text-align: center;
  margin-top: 22px;
  font-size: .88rem;
  color: var(--muted);
}
.auth-footer-links a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  margin-left: 5px;
}
.auth-footer-links a:hover { text-decoration: underline; }

/* Legal */
.auth-legal-text {
  text-align: center;
  font-size: .75rem;
  color: var(--dim);
  margin-top: 14px;
  line-height: 1.65;
  word-break: break-word;
}
.auth-legal-text a { color: var(--muted); text-decoration: none; }
.auth-legal-text a:hover { color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   RIGHT — Bento Visual Panel
══════════════════════════════════════════════════════════════ */
.auth-visual-panel {
  background: var(--page);
  padding: clamp(24px,4vw,48px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Dark main card */
.auth-visual-main {
  background: var(--dark);
  border: 1px solid var(--dark);
  border-radius: var(--r-xl);
  padding: 36px 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-height: 220px;
  box-shadow: var(--sh-md);
}
.auth-visual-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(234,63,47,.2) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
  pointer-events: none;
}

.auth-brand-badge {
  width: 52px;
  height: 52px;
  background: var(--accent);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1;
  color: #fff;
  margin-bottom: auto;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(234,63,47,.35);
}

.auth-visual-main h2 {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  color: #fff;
  line-height: 1.25;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
  word-break: normal;
  overflow-wrap: break-word;
  margin-top: 28px;
}
.auth-visual-main p {
  font-size: .88rem;
  color: rgba(255,255,255,.6);
  line-height: 1.6;
  position: relative;
  z-index: 1;
  word-break: break-word;
}

/* Stat row */
.auth-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex-shrink: 0;
}

.auth-stat-white,
.auth-stat-orange {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: var(--sh-sm);
}
.auth-stat-orange {
  background: var(--accent);
  border-color: var(--accent);
}

.auth-stat-val {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -.02em;
  color: var(--dark);
  line-height: 1;
}
.auth-stat-orange .auth-stat-val { color: #fff; }

.auth-stat-lbl {
  font-size: .78rem;
  color: var(--muted);
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}
.auth-stat-orange .auth-stat-lbl { color: rgba(255,255,255,.75); }

/* Feature chips row */
.auth-feature-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  box-shadow: var(--sh-sm);
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: .78rem;
  line-height: 1;
  color: #555;
  font-family: var(--f-head);
  font-weight: 700;
}
.auth-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual-panel { display: none; }
  .auth-form-panel {
    border-right: none;
    min-height: 100vh;
  }
  .auth-form-body {
    justify-content: flex-start;
    padding-top: 8px;
  }
}

@media (max-width: 480px) {
  .auth-form-panel { padding: 20px 18px; }
  .auth-title { font-size: 1.35rem; }
  .auth-topbar { margin-bottom: 20px; }
}

/* ══════════════════════════════════════════════════════════════
   ADMIN LOGIN — single-column variant
══════════════════════════════════════════════════════════════ */
.auth-shell--admin {
  grid-template-columns: 1fr;
  max-width: 520px;
  margin: 0 auto;
}
.auth-shell--admin .auth-form-panel {
  border-right: none;
}
.auth-shell--admin .auth-topbar {
  justify-content: center;
}
.auth-shell--admin .auth-brand {
  font-size: 1.6rem;
}

.auth-success {
  background: rgba(34,197,94,.07);
  border: 1px solid rgba(34,197,94,.2);
  color: #16a34a;
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: .88rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.auth-footer-links {
  text-align: center;
  margin-top: 18px;
  font-size: .88rem;
}
.auth-footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.auth-footer-links a:hover {
  text-decoration: underline;
}
.auth-footer-links .sep {
  color: var(--muted);
  margin: 0 6px;
}

/* ── Admin access badge in topbar ─────────────────────────── */
.admin-access-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--alight);
  border: 1.5px solid rgba(234,63,47,.2);
  border-radius: var(--r-pill);
  font-family: var(--f-head);
  font-weight: 700;
  font-size: .72rem;
  color: var(--accent);
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1;
}
