/*
 * Hesap Merkezi: tek stil dosyası (docs/AUTH-UI.md, docs/DESIGN.md).
 * Beyaz tema varsayılandır; koyu tema yalnızca html[data-theme="dark"] ile (kullanıcı seçerse, localStorage).
 * Fontlar kendi sunucumuzdan (Geist, OFL); Apple cihazlarda sistem fontu seçilir ve hiçbiri indirilmez.
 * Satır içi stil yok: CSP `style-src-attr 'none'`.
 */

/* ---------------------------------------------------------------- fonts */
@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/geist-latin-ext.824f485b.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 Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/geist-latin.19f9c925.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;
}
@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 {
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Geist Variable", system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Geist Mono Variable", Menlo, monospace;

  --gutter: 20px;
  --radius-card: 28px;
  --radius-field: 14px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --dur-micro: 160ms;
  --dur-standard: 320ms;
  --dur-large: 700ms;

  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --surface-3: #ebebef;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --hairline: rgb(0 0 0 / .08);
  --hairline-strong: rgb(0 0 0 / .16);
  --field: #86868b;
  --accent: #ff5a1f; /* Ember */
  --accent-2: #6e56ff; /* Iris */
  --link: #0066cc;
  --action: #0071e3;
  --action-hover: #0077ed;
  --on-action: #ffffff;
  --island: #000000;
  --island-text: #f5f5f7;
  --island-border: transparent;
  --danger: #d70015;
  --danger-bg: #fff2f1;
  --danger-line: rgb(215 0 21 / .22);
  --ok: #1a7f37;
  --ok-bg: #e8f6ec;
  --warn: #8a5a00;
  --warn-bg: #fff4dd;
  --shadow-card: 0 1px 2px rgb(0 0 0 / .04), 0 8px 24px -12px rgb(0 0 0 / .08);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #111113;
  --surface-2: #1c1c1e;
  --surface-3: #2c2c2e;
  --text: #f5f5f7;
  --muted: #98989d;
  --hairline: rgb(255 255 255 / .1);
  --hairline-strong: rgb(255 255 255 / .2);
  --field: #6e6e73;
  --accent: #ff6a33;
  --accent-2: #8b78ff;
  --link: #2997ff;
  --action: #0a84ff;
  --action-hover: #2b95ff;
  --on-action: #ffffff;
  --island-border: var(--hairline);
  --danger: #ff6961;
  --danger-bg: rgb(255 105 97 / .12);
  --danger-line: rgb(255 105 97 / .3);
  --ok: #30d158;
  --ok-bg: rgb(48 209 88 / .14);
  --warn: #ffd60a;
  --warn-bg: rgb(255 214 10 / .12);
  --shadow-card: none;
}

/* ---------------------------------------------------------------- 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: 17px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1:focus { outline: none; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
p { margin: 0 0 16px; text-wrap: pretty; }
h1 { margin: 0 0 8px; font-size: 32px; line-height: 1.1; font-weight: 600; letter-spacing: -.03em; text-wrap: balance; }
h2 { margin: 0; font-size: 19px; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; }
.lede { margin: 0 0 24px; color: var(--muted); text-wrap: pretty; }
.hint { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.mono { font-family: var(--mono); font-size: .88em; letter-spacing: .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: 8px 16px; border-radius: 999px; background: var(--text); color: var(--bg); text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------------------------------------------------------------- Ada (docs/DESIGN.md) */
.top { display: flex; justify-content: center; padding: 20px var(--gutter) 0; }
.island {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-width: 176px; height: 38px; padding: 0 18px 0 16px; overflow: hidden;
  border: 1px solid var(--island-border); border-radius: 999px;
  background: var(--island); color: var(--island-text); text-decoration: none;
  font-size: 13px; font-weight: 500; letter-spacing: .01em; line-height: 1; white-space: nowrap;
  box-shadow: 0 6px 20px -8px rgb(0 0 0 / .35), inset 0 0 0 .5px rgb(255 255 255 / .08);
  transition: min-width var(--dur-standard) var(--ease-out), transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-standard) var(--ease-out);
  animation: island-in var(--dur-large) var(--ease-out) both;
}
.island:hover { transform: scale(1.035); }
.island:active { transform: scale(.97); }
.island:focus-visible { outline-offset: 4px; border-radius: 999px; }
.island-mark { font: 600 11px/1 var(--mono); letter-spacing: .08em; }
.island-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #30d158; animation: breathe 3.2s ease-in-out infinite; }
.island-label { color: rgb(245 245 247 / .86); }
.island-line { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; opacity: 0; }
.island[data-state="loading"] { min-width: 232px; }
.island[data-state="loading"] .island-dot { background: var(--accent); animation-duration: .9s; }
.island[data-state="loading"] .island-line { opacity: 1; animation: island-load 1.2s var(--ease-in-out) infinite; }
.island[data-state="flash"] { min-width: 232px; }
.island[data-state="flash"] .island-label { color: #fff; }

/* ---------------------------------------------------------------- page stage + Swup transition */
.stage { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 32px var(--gutter) 48px; }
.transition-fade { opacity: 1; transform: none; filter: blur(0); }
html.is-changing .transition-fade { transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out), filter 420ms var(--ease-out); }
html.is-animating .transition-fade { opacity: 0; transform: translateY(-12px); filter: blur(6px); }
html.is-animating.is-leaving .transition-fade { transition-duration: 240ms; }
.page { width: 100%; max-width: 440px; }
.page-wide { max-width: 960px; }

.card {
  width: 100%; padding: 40px 36px 36px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius-card); box-shadow: var(--shadow-card);
}

/* ---------------------------------------------------------------- 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: 14px; font-weight: 500; }
input {
  display: block; width: 100%; height: 48px; padding: 0 16px; border: 1px solid var(--field); border-radius: var(--radius-field);
  background: var(--bg); color: var(--text); font: inherit;
  transition: border-color var(--dur-micro), box-shadow var(--dur-micro);
}
input::placeholder { color: var(--muted); }
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); border-radius: var(--radius-field); }
input[aria-invalid="true"] { border-color: var(--danger); }
input[inputmode="numeric"], input[autocomplete="one-time-code"] { font-family: var(--mono); letter-spacing: .04em; }
.form-inline .field { margin-bottom: 12px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; padding: 0 24px;
  border: 0; border-radius: 999px; font: 500 17px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro), color var(--dur-micro);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--action); color: var(--on-action); }
.btn-primary:hover { background: var(--action-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger-bg); color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger-line); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 18%, var(--bg)); }
.btn-sm { width: auto; height: 36px; padding: 0 16px; font-size: 14px; }
.actions { margin: 24px 0 0; }

.alert, .notice { margin: 0 0 20px; padding: 12px 16px; border-radius: var(--radius-field); font-size: 15px; line-height: 1.45; }
.alert { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line); }
.alert p { margin: 0; }
.notice { background: var(--surface-2); color: var(--text); }
.callout { margin: 0 0 16px; padding: 16px; border-radius: 20px; background: var(--surface-2); }
.callout-label { margin: 0; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.callout-value { margin: 8px 0 0; font: 600 20px/1.2 var(--mono); }

.aside { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--hairline); font-size: 15px; color: var(--muted); }
.aside p { margin: 0 0 8px; }
.aside .form { margin-top: 12px; }
.more { display: inline-block; font-weight: 500; 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: .3em; transition: transform var(--dur-micro) var(--ease-out); }
.more:hover { background-size: 100% 1px; }
.more:hover::after { transform: translateX(2px); }

.steps { display: flex; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.steps li { padding-top: 10px; border-top: 2px solid var(--hairline); flex: 1; }
.steps [aria-current] { color: var(--text); border-top-color: var(--accent); }

.specs { margin: 0 0 16px; border-top: 1px solid var(--hairline); }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.specs dt { color: var(--muted); font: 500 12px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.specs dd { margin: 0; text-align: right; }

.badge { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; 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(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-here { background: var(--surface-2); color: var(--text); }

/* ---------------------------------------------------------------- hesap panosu */
.greeting { margin: 8px 0 32px; }
.greeting h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1; letter-spacing: -.04em; }
.greeting h1 em { font: italic 400 1em/1 ui-serif, "New York", "Instrument Serif", Georgia, serif; letter-spacing: -.02em; }
.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: 1px solid var(--hairline); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: border-color var(--dur-standard) var(--ease-out), transform var(--dur-standard) var(--ease-out);
}
.panel:hover { border-color: var(--hairline-strong); transform: translateY(-1px); }
.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: 12px; 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: 15px; }
.panel-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 16px 0 0; font-size: 15px; }
.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(--hairline); }
.rows > li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.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: 13px; line-height: 1.4; color: var(--muted); }
.row-action { flex: none; font-size: 14px; font-weight: 500; }
.row-action.danger { color: var(--danger); }
.empty { margin: 0; padding: 16px; border-radius: var(--radius-field); background: var(--surface-2); color: var(--muted); font-size: 15px; text-align: center; }

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

.crumb { margin: 0 0 20px; font-size: 14px; }
.crumb a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; }
.crumb a::before { content: "‹"; font-size: 18px; line-height: 1; }
.crumb a:hover { color: var(--text); }
.btn-row { display: grid; gap: 12px; }
.facts { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-field); background: var(--surface-2); font-size: 15px; }
.facts p { margin: 0; }

/* ---------------------------------------------------------------- alt bilgi */
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 16px; padding: 0 var(--gutter) 32px; font: 12px/1.4 var(--mono); letter-spacing: .04em; color: var(--muted); }
.foot p { margin: 0; }
.foot a { color: inherit; text-decoration-color: var(--hairline-strong); }
.foot a:hover { color: var(--text); }
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 1px solid var(--hairline-strong); border-radius: 999px; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; cursor: pointer; transition: transform var(--dur-micro) var(--ease-out), color var(--dur-micro); }
.theme-toggle:hover { color: var(--text); }
.theme-toggle:active { transform: scale(.97); }
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { width: 14px; height: 14px; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }

/* ---------------------------------------------------------------- küçük ekran */
@media (max-width: 520px) {
  .stage { padding: 24px var(--gutter) 40px; }
  .card { padding: 28px 0 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  h1 { font-size: 28px; }
  .panel { padding: 22px; }
}

/* ---------------------------------------------------------------- hareket */
@keyframes island-in { from { opacity: .01; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { opacity: .35; } }
@keyframes island-load { 0% { transform: scaleX(0); transform-origin: left; } 50% { transform: scaleX(1); transform-origin: left; } 51% { transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .btn:active, .island:hover, .island:active, .theme-toggle:active { transform: none; }
  .panel:hover { transform: none; }
  html.is-animating .transition-fade { transform: none; filter: none; }
}
