/* ============================================================
   BiFatura — Giriş ekranı
   Kendi kendine yeten stil. Gövde sınıfı `auth-shell`; eski
   `.auth-page` kuralları bu sayfaya HİÇ uygulanmaz, özgüllük
   savaşı yok. Renkler design.css'teki tek paletten gelir.
   ============================================================ */

.auth-shell {
  margin: 0;
  min-height: 100dvh;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  min-height: 100dvh;
}

/* ---------- Sol: markanın sahnesi ---------- */
.auth-stage {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 44px 56px;
  color: #eaf7f4;
  background:
    radial-gradient(120% 90% at 12% 8%, #0e4a46 0%, transparent 55%),
    radial-gradient(100% 80% at 88% 96%, #06333c 0%, transparent 58%),
    linear-gradient(152deg, #072a2c 0%, #0a3a39 46%, #05242c 100%);
}

/* Yumuşak ışık lekeleri: derinlik verir, hiçbir görsel dosya gerektirmez. */
.auth-stage::before,
.auth-stage::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  pointer-events: none;
}
.auth-stage::before {
  width: 460px; height: 460px;
  top: -140px; left: -120px;
  background: radial-gradient(circle, rgba(45, 212, 191, .34), transparent 68%);
  animation: auth-drift-a 18s ease-in-out infinite alternate;
}
.auth-stage::after {
  width: 520px; height: 520px;
  right: -180px; bottom: -200px;
  background: radial-gradient(circle, rgba(56, 189, 248, .22), transparent 68%);
  animation: auth-drift-b 22s ease-in-out infinite alternate;
}
@keyframes auth-drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(40px, 52px, 0) scale(1.12); }
}
@keyframes auth-drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.06); }
  to   { transform: translate3d(-46px, -38px, 0) scale(1); }
}

/* İnce doku: düz gradyanın "plastik" görünmesini engeller. */
.auth-stage .stage-grain {
  position: absolute;
  inset: 0;
  opacity: .22;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.auth-stage > * { position: relative; z-index: 1; }

.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 13px;
  color: #04312f;
  background: linear-gradient(140deg, #5eead4, #14b8a6);
  box-shadow: 0 10px 28px rgba(20, 184, 166, .42), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.auth-brand .mark svg { width: 21px; height: 21px; }
.auth-brand b { font-size: 21px; font-weight: 700; letter-spacing: -.03em; color: #fff; }
.auth-brand small { display: block; margin-top: 2px; font-size: 11px; color: rgba(214, 240, 236, .62); }

.auth-pitch { max-width: 520px; }
.auth-pitch h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 3.6vw, 50px);
  line-height: 1.08;
  letter-spacing: -.035em;
  font-weight: 650;
  color: #fff;
}
.auth-pitch h1 .accent {
  background: linear-gradient(100deg, #5eead4, #7dd3fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-pitch p {
  margin: 0;
  max-width: 440px;
  font-size: 15.5px;
  line-height: 1.75;
  color: rgba(214, 240, 236, .74);
}

/* ---------- Cam defter kartı ---------- */
.auth-ledger {
  margin-top: 34px;
  max-width: 460px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .055);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 28px 70px rgba(2, 18, 22, .5);
  overflow: hidden;
}
.auth-ledger-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  font-size: 12px;
  color: rgba(214, 240, 236, .74);
}
.auth-ledger-head b { color: #fff; font-weight: 600; }
.auth-ledger-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  font-size: 13px;
}
.auth-ledger-row .d { color: rgba(214, 240, 236, .5); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.auth-ledger-row .t { color: rgba(236, 250, 247, .9); overflow-wrap: anywhere; }
.auth-ledger-row .v { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.auth-ledger-row .v.in { color: #5eead4; }
.auth-ledger-row .v.out { color: #fca5a5; }
.auth-ledger-row .v.mid { color: rgba(214, 240, 236, .72); }
.auth-ledger-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px;
  background: rgba(255, 255, 255, .05);
  font-size: 13px;
}
.auth-ledger-foot span { color: rgba(214, 240, 236, .74); }
.auth-ledger-foot b { font-size: 17px; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.auth-trust {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  font-size: 11.5px;
  color: rgba(214, 240, 236, .6);
}
.auth-trust .dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); }
.auth-trust .sep { width: 1px; height: 11px; background: rgba(255, 255, 255, .2); }

/* ---------- Sağ: form ---------- */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--surface);
}
.auth-card { width: 100%; max-width: 384px; }

.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 32px; }
.auth-mobile-brand .mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 11px; color: #fff;
  background: linear-gradient(140deg, var(--teal), var(--teal-dark));
}
.auth-mobile-brand .mark svg { width: 18px; height: 18px; }
.auth-mobile-brand b { font-size: 18px; letter-spacing: -.02em; }

.auth-heading { margin-bottom: 26px; }
.auth-heading .eyebrow {
  margin: 0 0 10px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--teal);
}
.auth-heading h2 { margin: 0 0 8px; font-size: 27px; line-height: 1.22; letter-spacing: -.03em; font-weight: 650; }
.auth-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.auth-message {
  display: flex; align-items: flex-start; gap: 9px;
  margin-bottom: 18px; padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 13px; line-height: 1.5;
  border: 1px solid transparent;
}
.auth-message[hidden] { display: none; }
.auth-message.is-error { background: var(--rose-soft); border-color: #fbc9d2; color: #9f1239; }
.auth-message.is-success { background: var(--teal-soft); border-color: #99f6e4; color: var(--teal-dark); }

.auth-form { display: grid; gap: 20px; }
.field-group { display: grid; gap: 7px; min-width: 0; }
.field-group[hidden] { display: none; }
.field-group label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-label-row span { font-size: 11px; color: var(--muted); }

.field-control {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.field-control:focus-within {
  border-color: var(--teal);
  background: var(--surface);
  box-shadow: var(--ring);
}
.field-control > svg { width: 17px; height: 17px; color: var(--muted-2); flex: none; transition: color .16s ease; }
.field-control:focus-within > svg { color: var(--teal); }
.field-control input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-size: 14px; color: var(--ink);
}
.field-control input::placeholder { color: var(--muted-2); }

.icon-button {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--muted-2);
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.icon-button:hover { color: var(--teal); background: var(--teal-soft); }
.icon-button svg { width: 16px; height: 16px; }

.caps-hint {
  display: none;
  align-items: center; gap: 6px;
  margin: 0; font-size: 11.5px; color: #b45309;
}
.caps-hint[data-visible="true"] { display: flex; }
.caps-hint svg { width: 14px; height: 14px; }

/* Parola gücü — yalnızca ilk kurulum modunda görünür. */
.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: 99px;
  background: var(--line);
  transition: background .2s ease;
}
.strength-bar span.f1 { background: #f43f5e; }
.strength-bar span.f2 { background: #f59e0b; }
.strength-bar span.f3 { background: #22c55e; }
.strength-bar span.f4 { background: var(--teal); }
.strength-text { margin: 0; font-size: 11.5px; color: var(--muted); }

.primary-action {
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; height: 48px;
  margin-top: 2px;
  border: 0; border-radius: var(--r-md);
  background: linear-gradient(135deg, #14b8a6, var(--teal-dark));
  color: #fff; font-size: 14px; font-weight: 650; letter-spacing: -.01em;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(13, 148, 136, .34);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.primary-action:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(13, 148, 136, .42); }
.primary-action:active { transform: translateY(0); }
.primary-action:disabled { opacity: .65; cursor: progress; transform: none; }
.primary-action svg { width: 17px; height: 17px; }
/* Üzerinden geçen ışık: yalnızca hover'da, tek seferlik. */
.primary-action::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .28) 50%, transparent 62%);
  transform: translateX(-110%);
}
.primary-action:hover::after { transform: translateX(110%); transition: transform .75s ease; }

.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;
  margin-top: 20px; padding: 13px 15px;
  border: 1px solid var(--blue-soft);
  border-radius: var(--r-md);
  background: #f5f8ff;
  color: #1e3a8a; font-size: 12.5px; line-height: 1.55;
}
.setup-note[hidden] { display: none; }
.setup-note svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.setup-note p { margin: 0; }

.auth-legal { margin: 24px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }

/* ---------- Giriş animasyonu ---------- */
.auth-rise { animation: auth-rise .55s cubic-bezier(.2, .7, .3, 1) both; }
.auth-rise:nth-child(2) { animation-delay: .06s; }
.auth-rise:nth-child(3) { animation-delay: .12s; }
@keyframes auth-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Duyarlı ---------- */
@media (max-width: 1080px) {
  .auth-stage { padding: 36px 40px; }
  .auth-panel { padding: 40px 32px; }
}
@media (max-width: 900px) {
  .auth-grid { grid-template-columns: minmax(0, 1fr); }
  /* Sahne mobilde gizlenir: küçük ekranda formun önüne geçmemeli. */
  .auth-stage { display: none; }
  .auth-panel { min-height: 100dvh; padding: 32px 22px; align-items: flex-start; }
  .auth-card { padding-top: 12px; }
  .auth-mobile-brand { display: flex; }
  .auth-heading h2 { font-size: 24px; }
}

/* Hareket azaltma tercihi: ışık lekeleri ve giriş animasyonu durur. */
@media (prefers-reduced-motion: reduce) {
  .auth-stage::before,
  .auth-stage::after,
  .auth-rise,
  .spin-icon { animation: none; }
  .primary-action::after { display: none; }
  .primary-action, .field-control, .icon-button { transition: none; }
}
