/*
 * Hesap Merkezi: tek stil dosyası (docs/AUTH-UI.md, docs/AUTH.md "Görünüm").
 * Görsel dil sitenin "Biçim" dilidir. Tokenların kaynağı apps/web/src/styles/tokens.css ve
 * docs/DESIGN.md §4: aynı adlar burada kopyalanır; sitede değişirse buraya da kopyalanır.
 * Açık/koyu sistemi izler (color-scheme + light-dark()); açık seçim html[data-theme] ile (localStorage).
 * Fontlar kendi sunucumuzdan (Google Sans Flex + Geist Mono, OFL). Satır içi stil yok: CSP style-src-attr 'none'.
 */

/* ---------------------------------------------------------------- fonts */
@font-face {
  font-family: 'Google Sans Flex Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 1 1000;
  src: url("/assets/fonts/google-sans-flex-latin-ext-rond.0ed59478.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Google Sans Flex Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 1 1000;
  src: url("/assets/fonts/google-sans-flex-latin-rond.6d659cd3.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Stand-in for Google Sans Flex while it loads (Arial metrics, as on the site). */
@font-face {
  font-family: 'Google Sans Flex Fallback';
  font-weight: 100 549;
  src: local('Arial'), local('ArialMT'), local('Helvetica Neue'), local('Helvetica'), local('Liberation Sans');
  size-adjust: 103%;
  ascent-override: 93%;
  descent-override: 25%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Google Sans Flex Fallback';
  font-weight: 550 900;
  src: local('Arial Bold'), local('Arial-BoldMT'), local('Helvetica Neue Bold'), local('Helvetica-Bold'), local('Liberation Sans Bold');
  size-adjust: 99%;
  ascent-override: 96%;
  descent-override: 26%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Geist Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/geist-mono-latin-ext.1a189eb9.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/geist-mono-latin.684ad5b5.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light dark;

  --bg: light-dark(oklch(0.99 0.002 260), oklch(0.13 0.004 260));
  --surface: light-dark(oklch(0.965 0.003 260), oklch(0.185 0.005 260));
  --surface-2: light-dark(oklch(0.935 0.004 260), oklch(0.235 0.006 260));
  --text: light-dark(oklch(0.2 0.006 260), oklch(0.96 0.003 260));
  --text-2: light-dark(oklch(0.45 0.006 260), oklch(0.74 0.005 260));
  --text-3: light-dark(oklch(0.5 0.006 260), oklch(0.64 0.005 260));
  --line: color-mix(in oklch, var(--text) 10%, transparent);
  --line-strong: color-mix(in oklch, var(--text) 22%, transparent);
  --primary: var(--text);
  --on-primary: var(--bg);
  --danger: light-dark(oklch(0.5 0.19 27), oklch(0.74 0.15 25));
  --scrim: light-dark(oklch(0.2 0.006 260 / 0.4), oklch(0 0 0 / 0.6));

  --c-blue: light-dark(oklch(0.62 0.19 262), oklch(0.74 0.15 262));
  --c-blue-soft: light-dark(oklch(0.93 0.055 262), oklch(0.3 0.06 262));
  --c-blue-ink: light-dark(oklch(0.3 0.1 262), oklch(0.92 0.05 262));
  --c-yellow: light-dark(oklch(0.84 0.16 95), oklch(0.86 0.15 95));
  --c-yellow-soft: light-dark(oklch(0.95 0.09 95), oklch(0.3 0.06 95));
  --c-yellow-ink: light-dark(oklch(0.3 0.1 95), oklch(0.92 0.05 95));
  --c-green: light-dark(oklch(0.62 0.19 155), oklch(0.74 0.15 155));
  --c-green-soft: light-dark(oklch(0.93 0.055 155), oklch(0.3 0.06 155));
  --c-green-ink: light-dark(oklch(0.3 0.1 155), oklch(0.92 0.05 155));

  --font-sans: 'Google Sans Flex Variable', 'Google Sans Flex Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono Variable', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --rond: 30;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --gutter: 20px;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 40px;
  --r-full: 999px;

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring-fast: linear(0, 0.018, 0.065, 0.131, 0.21, 0.294, 0.381, 0.465, 0.545, 0.619, 0.686, 0.746, 0.799, 0.844, 0.883, 0.915, 0.942, 0.963, 0.98, 0.993, 1.003, 1.01, 1.015, 1.018, 1.019, 1.02, 1.02, 1.019, 1.017, 1.016, 1.014, 1.012, 1);
  --spring: linear(0, 0.028, 0.1, 0.2, 0.314, 0.433, 0.548, 0.655, 0.75, 0.832, 0.9, 0.953, 0.995, 1.025, 1.045, 1.057, 1.062, 1.063, 1.06, 1.055, 1.048, 1.041, 1.033, 1.026, 1.02, 1.014, 1.009, 1.005, 1.002, 1, 0.998, 0.997, 1);
  --dur-fast: 350ms;
  --dur: 550ms;
  --dur-micro: 160ms;
  --dur-standard: 320ms;
}
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-width: thin; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--c-blue-soft); color: var(--c-blue-ink); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
h1:focus { outline: none; }
a { color: var(--text); text-decoration-line: underline; text-decoration-thickness: 1px; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: text-decoration-color var(--dur-micro); }
a:hover { text-decoration-color: currentColor; }
p { margin: 0 0 16px; text-wrap: pretty; }
h1, h2 { font-variation-settings: 'ROND' var(--rond); }
h1 { margin: 0 0 8px; font-size: 2rem; line-height: 1.12; font-weight: 600; letter-spacing: -0.03em; text-wrap: balance; }
h2 { margin: 0; font-size: 1.1875rem; line-height: 1.25; font-weight: 600; letter-spacing: -0.015em; }
.lede { margin: 0 0 28px; color: var(--text-2); text-wrap: pretty; }
.hint { margin: 8px 0 0; font-size: 0.8125rem; line-height: 1.45; color: var(--text-2); }
.mono { font-family: var(--font-mono); font-size: 0.88em; letter-spacing: 0.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 10; padding: 10px 18px; border-radius: var(--r-full); background: var(--primary); color: var(--on-primary); font-size: 0.9375rem; font-weight: 500; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------------------------------------------------------------- header: Çift nokta + page label */
.top { padding: 24px var(--gutter) 0; }
.island { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 440px; margin: 0 auto; }
body:has(.page-wide) .island { max-width: 960px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1; text-decoration: none; padding: 4px 8px; margin: -4px -8px; border-radius: var(--r-sm); }
.brand-mark { flex: none; width: 28px; height: 28px; color: var(--c-blue); }
.island-label { display: inline-flex; align-items: center; gap: 8px; max-width: 60%; padding: 6px 12px; border-radius: var(--r-full); background: var(--surface); color: var(--text-3); font-size: 0.8125rem; line-height: 1.2; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.island[data-state="loading"] .island-label::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: pulse 1.2s ease-in-out infinite; }
.island[data-state="flash"] .island-label { color: var(--text); }

/* ---------------------------------------------------------------- stage + Swup fade */
.stage { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 32px var(--gutter) 48px; }
.transition-fade { opacity: 1; }
html.is-changing .transition-fade { transition: opacity 360ms var(--ease-out); }
html.is-animating .transition-fade { opacity: 0; }
html.is-animating.is-leaving .transition-fade { transition-duration: 200ms; }
.page { width: 100%; max-width: 440px; animation: rise 400ms var(--ease-out) both; }
.page-wide { max-width: 960px; }

.card { width: 100%; padding: 40px; background: var(--surface); border-radius: var(--r-lg); }

/* ---------------------------------------------------------------- forms */
.form { margin: 0; }
.form + .form, .alert + .form, .callout + .form { margin-top: 16px; }
.field { margin-bottom: 16px; }
label { display: block; margin-bottom: 8px; font-size: 0.875rem; font-weight: 500; }
input {
  display: block; width: 100%; height: 52px; padding: 0 16px; border: 1px solid transparent; border-radius: 16px;
  background: var(--surface-2); color: var(--text); font: inherit;
  transition: box-shadow var(--dur-micro);
}
input::placeholder { color: var(--text-3); }
input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--danger); }
input:-webkit-autofill { -webkit-text-fill-color: var(--text); box-shadow: 0 0 0 100px var(--surface-2) inset; }
input[inputmode="numeric"], input[autocomplete="one-time-code"] { font-family: var(--font-mono); letter-spacing: 0.04em; }
.form-inline .field { margin-bottom: 12px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 0 24px;
  border: 0; border-radius: var(--r-full); font: 500 1.0625rem/1.2 var(--font-sans); text-decoration: none; cursor: pointer;
  transition: transform var(--dur-fast) var(--spring-fast), border-radius var(--dur-fast) var(--spring-fast), background-color var(--dur-micro);
}
.btn:active { border-radius: 14px; transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: color-mix(in oklch, var(--primary) 86%, var(--bg)); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-secondary:hover { background: color-mix(in oklch, var(--surface-2) 88%, var(--text)); }
.btn-danger { background: var(--surface-2); color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--surface-2) 88%, var(--danger)); }
.btn-sm { width: auto; min-height: 40px; padding: 0 18px; font-size: 0.875rem; }
.actions { margin: 24px 0 0; }

.alert, .notice { margin: 0 0 24px; padding: 14px 16px; border-radius: var(--r-sm); font-size: 0.9375rem; line-height: 1.45; }
.card > .hint { margin: 16px 0 24px; }
.alert { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--danger); font-weight: 500; box-shadow: inset 3px 0 0 var(--danger); }
.alert p { margin: 0; }
.notice { background: var(--surface-2); color: var(--text); }
.callout { margin: 0 0 16px; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface-2); }
.callout-label { margin: 0; font-size: 0.8125rem; line-height: 1.2; font-weight: 500; color: var(--text-2); }
.callout-value { margin: 6px 0 0; font: 600 1.25rem/1.2 var(--font-mono); letter-spacing: 0.01em; }

.aside { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.9375rem; color: var(--text-2); }
.aside p { margin: 0 0 8px; }
.aside .form { margin-top: 12px; }
.aside + .aside { margin-top: 0; padding-top: 0; border-top: 0; }
.more { display: inline-block; font-weight: 500; color: var(--text); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size var(--dur-standard) var(--ease-out); }
.more::after { content: "›"; display: inline-block; margin-left: 0.3em; transition: transform var(--dur-micro) var(--ease-out); }
.more:hover { background-size: 100% 1px; }
.more:hover::after { transform: translateX(2px); }

.steps { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 24px; padding: 0; list-style: none; font-size: 0.8125rem; font-weight: 500; line-height: 1.2; color: var(--text-3); }
.steps li { padding: 6px 10px; border-radius: var(--r-full); }
.steps [aria-current] { background: var(--c-blue-soft); color: var(--c-blue-ink); }

.specs { margin: 0 0 16px; border-top: 1px solid var(--line); }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--text-2); font-size: 0.875rem; font-weight: 500; }
.specs dd { margin: 0; text-align: right; }

.badge { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 3px 10px; border-radius: var(--r-full); background: var(--surface-2); color: var(--text-2); font-size: 0.75rem; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--c-green-soft); color: var(--c-green-ink); }
.badge-warn { background: var(--c-yellow-soft); color: var(--c-yellow-ink); }
.badge-here { background: var(--surface-2); color: var(--text); }

/* ---------------------------------------------------------------- hesap panosu */
.greeting { margin: 8px 0 32px; }
.greeting h1 { font-size: clamp(1.875rem, 5vw, 2.75rem); line-height: 1.05; letter-spacing: -0.035em; }
.greeting h1 em { font-style: normal; font-weight: 500; color: var(--text-2); }
.greeting .lede { margin: 12px 0 0; max-width: 56ch; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: stretch; }
.panel { padding: 28px; background: var(--surface); border-radius: var(--r-lg); }
.panel-head { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.panel-head h2 { flex: 1; }
.panel-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); }
.panel-icon svg { width: 20px; height: 20px; }
.panel .specs { margin-bottom: 8px; }
.panel .specs div:last-child { border-bottom: 0; }
.panel .lede { margin-bottom: 16px; font-size: 0.9375rem; }
.panel-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 16px 0 0; font-size: 0.9375rem; }
.panel-foot p, .panel-foot .form { margin: 0; }
.panel-foot .btn { width: auto; }

.rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rows > li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { margin: 0; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.row-meta { margin: 2px 0 0; font-size: 0.8125rem; line-height: 1.4; color: var(--text-2); }
.row-action { flex: none; font-size: 0.875rem; font-weight: 500; }
.row-action.danger { color: var(--danger); }
.empty { margin: 0; padding: 16px; border-radius: 16px; background: var(--surface-2); color: var(--text-2); font-size: 0.9375rem; text-align: center; }

.confirm { display: grid; gap: 12px; margin-top: 8px; }

.crumb { margin: 0 0 20px; font-size: 0.875rem; }
.crumb a { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; }
.crumb a::before { content: "‹"; font-size: 1.125rem; line-height: 1; }
.crumb a:hover { color: var(--text); }
.btn-row { display: grid; gap: 12px; }
.facts { margin: 0 0 20px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-size: 0.9375rem; }
.facts p { margin: 0; }

/* ---------------------------------------------------------------- alt bilgi */
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; padding: 0 var(--gutter) 32px; font-size: 0.8125rem; line-height: 1.4; color: var(--text-3); }
.foot p { margin: 0; }
.foot a { color: inherit; text-decoration-color: var(--line-strong); }
.foot a:hover { color: var(--text); }
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-full); background: var(--surface); color: var(--text-2); font: 500 0.8125rem/1 var(--font-sans); cursor: pointer; transition: transform var(--dur-fast) var(--spring-fast), color var(--dur-micro); }
.theme-toggle:hover { color: var(--text); }
.theme-toggle:active { transform: scale(0.97); }
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { width: 14px; height: 14px; }
.theme-toggle .i-moon { display: none; }
.theme-toggle[data-mode="dark"] .i-sun { display: none; }
.theme-toggle[data-mode="dark"] .i-moon { display: block; }

/* ---------------------------------------------------------------- küçük ekran */
@media (max-width: 520px) {
  .stage { padding: 20px var(--gutter) 40px; }
  .card { padding: 28px 24px; }
  h1 { font-size: 1.75rem; }
  .panel { padding: 24px 20px; }
}

/* ---------------------------------------------------------------- hareket */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: 0.35; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .btn:active, .theme-toggle:active { transform: none; border-radius: var(--r-full); }
}
