/* ==========================================================================
   BiFatura — Giriş ekranı (AKIS_SPEC 6.22, Lane 6)
   Yalnız Akış tokenları (tokens.css + base.css + components.css yüklenir).
   Renk değişmezi yok (D11); koyu kip tokens.css'in html.akis bloklarından gelir.
   Kontratlar (testler): .auth-form[hidden], .demo-banner[hidden],
   .demo-login[hidden] kuralları; login.js'in kullandığı kimlikler login.html'de.
   ========================================================================== */

.auth-shell { min-height: 100vh; min-height: 100dvh; background: var(--bg); }

.auth-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh; min-height: 100dvh;
  animation: auth-fade var(--dur-2) var(--ease) both;
}
@keyframes auth-fade { from { opacity: 0; } to { opacity: 1; } }

/* --- Sol: tanıtım ------------------------------------------------------- */
.auth-stage {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-10);
  padding: clamp(32px, 5vw, 64px);
  padding-left: max(clamp(32px, 5vw, 64px), env(safe-area-inset-left));
  background: var(--surface-2); border-right: 1px solid var(--line); color: var(--fg);
}
.auth-brand, .auth-mobile-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand b, .auth-mobile-brand b { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.02em; color: var(--fg); }
.auth-mark {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--r-md);
  background: var(--primary); color: var(--on-primary);
}
.auth-mark svg { width: 20px; height: 20px; }

.auth-pitch { display: grid; gap: var(--sp-8); max-width: 520px; }
.auth-pitch h1 {
  margin: 0; font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem); line-height: 1.15; font-weight: 750;
  letter-spacing: -.03em; color: var(--fg); text-wrap: balance;
}
.auth-points { display: grid; gap: var(--sp-4); margin: 0; padding: 0; list-style: none; }
.auth-points li { display: flex; align-items: flex-start; gap: 14px; color: var(--fg-2); font-size: var(--fs-md); line-height: 1.5; }
.auth-points li b { display: block; color: var(--fg); font-weight: 650; }
.auth-point-icon {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--r-md);
  background: var(--surface); color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--line);
}
.auth-point-icon svg { width: 18px; height: 18px; }
.auth-trust { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.auth-trust svg { width: 16px; height: 16px; flex: none; }

/* --- Sağ: giriş kartı --------------------------------------------------- */
.auth-panel {
  display: grid; place-items: center; padding: clamp(24px, 4vw, 56px);
  padding-right: max(clamp(24px, 4vw, 56px), env(safe-area-inset-right));
}
.auth-card { display: grid; gap: var(--sp-5); width: min(420px, 100%); }
.auth-mobile-brand { display: none; }

.auth-heading { display: grid; gap: 6px; }
.auth-eyebrow { margin: 0; font-size: var(--fs-sm); font-weight: 650; color: var(--primary-ink); }
.auth-heading h2 { margin: 0; font-size: var(--fs-h1); line-height: 1.15; font-weight: 700; letter-spacing: -.025em; color: var(--fg); }
.auth-heading p:last-child { margin: 0; color: var(--fg-2); font-size: var(--fs-md); }

.auth-message {
  margin: 0; padding: 10px 14px; border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 600; line-height: 1.45;
}
.auth-message[hidden] { display: none; }
.auth-message.is-error { background: var(--bad-soft); color: var(--bad); }
.auth-message.is-success { background: var(--ok-soft); color: var(--ok); }

.auth-form { display: grid; gap: var(--sp-5); }
.auth-form[hidden] { display: none; } /* davet formu; display:grid hidden'ı eziyordu */
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

/* Simgeli girdi: simge solda, göster/gizle düğmesi sağda. */
.field-control { position: relative; display: flex; align-items: center; }
.field-control > svg {
  position: absolute; left: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
.auth-shell .field-control > input { min-height: var(--h-lg); padding-left: 42px; }
.auth-shell .field-control > input:has(+ .icon-button) { padding-right: 52px; }
.icon-button {
  position: absolute; right: 4px; display: inline-grid; place-items: center; width: 40px; height: 40px;
  padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg-2); cursor: pointer;
}
.icon-button:hover { background: var(--surface-2); color: var(--fg); }
.icon-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 0; }
.icon-button svg { width: 18px; height: 18px; }

.caps-hint { display: none; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-xs); font-weight: 600; color: var(--warn); }
.caps-hint[data-visible="true"] { display: flex; }
.caps-hint svg { width: 14px; height: 14px; }

.strength-meter { display: grid; gap: 6px; }
.strength-meter[hidden] { display: none; }
.strength-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength-bar span { height: 4px; border-radius: var(--r-pill); background: var(--surface-3); }
.strength-bar span.f1 { background: var(--bad); }
.strength-bar span.f2 { background: var(--warn); }
.strength-bar span.f3, .strength-bar span.f4 { background: var(--ok); }
.strength-text { margin: 0; font-size: var(--fs-xs); font-weight: 600; color: var(--fg-2); }

.spin-icon { animation: auth-spin 1s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.setup-note {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--info-soft); color: var(--fg); font-size: var(--fs-sm); line-height: 1.5;
}
.setup-note[hidden] { display: none; }
.setup-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--info); }
.setup-note p { margin: 0; }

.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--fs-sm); }
.auth-or[hidden] { display: none; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-legal { margin: 0; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }

/* --- Demo şeridi ve demo girişi (yalnız setup-status demo.enabled iken) --- */
.demo-banner {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: var(--r-md);
  background: var(--warn-soft); color: var(--fg); font-size: var(--fs-sm); font-weight: 500; line-height: 1.45;
}
.demo-banner[hidden] { display: none; } /* display:flex hidden özniteliğini eziyordu: canlıda (demo kapalı) şerit görünüyordu */
.demo-banner svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; color: var(--warn); }
.demo-login { gap: 8px; }
.demo-login[hidden] { display: none; }

/* --- Telefon: marka satırı + kart, boş üst alan yok ------------------------ */
@media (max-width: 819px) {
  .auth-grid { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .auth-stage { display: none; }
  .auth-panel {
    place-items: start center;
    padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  .auth-card { gap: var(--sp-4); }
  .auth-mobile-brand { display: flex; margin-bottom: var(--sp-2); }
  .icon-button { width: 44px; height: 44px; right: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-grid { animation: none; }
  .spin-icon { animation: none; }
}
