/* login — arayüz. Inline stil yok (CSP style-src 'self'). */
:root {
  --bg: #eef0f4;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #4338ca;
  --accent-ink: #ffffff;
  --accent-soft: #eef2ff;
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --warn: #9a3412;
  --warn-soft: #fff7ed;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 8px 24px rgba(17, 24, 39, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12; --surface: #151821; --surface-2: #1b1f2a; --ink: #e5e7eb; --muted: #9ca3af; --line: #262a36;
    --accent: #818cf8; --accent-ink: #0b0d12; --accent-soft: #1e1b4b; --ok: #34d399; --ok-soft: #062e22;
    --warn: #fdba74; --warn-soft: #2a1a0e; --danger: #f87171; --danger-soft: #2b1111;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d12; --surface: #151821; --surface-2: #1b1f2a; --ink: #e5e7eb; --muted: #9ca3af; --line: #262a36;
  --accent: #818cf8; --accent-ink: #0b0d12; --accent-soft: #1e1b4b; --ok: #34d399; --ok-soft: #062e22;
  --warn: #fdba74; --warn-soft: #2a1a0e; --danger: #f87171; --danger-soft: #2b1111;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100vh; min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.3; margin: 0 0 6px; letter-spacing: -.3px; }
h2 { font-size: 17px; margin: 0 0 12px; letter-spacing: -.2px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1; min-width: 0; }
.center-page { display: flex; align-items: center; justify-content: center; padding: 24px 16px; min-height: 100vh; min-height: 100dvh; }

/* ---------- Marka ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.3px; color: var(--ink); margin-bottom: 22px; }
.logo { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); position: relative; flex: none; }
.logo::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--accent-ink); }

/* ---------- Kart ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.card.narrow { width: 100%; max-width: 420px; }
.card.flat { box-shadow: none; }
.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.section h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- Form ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--ink); }
.field { margin-bottom: 14px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], textarea, select {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 84px; resize: vertical; font-family: var(--mono); font-size: 13px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input.code { font-family: var(--mono); font-size: 26px; letter-spacing: 8px; text-align: center; padding: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 400; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ---------- Düğme ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; font: inherit; font-weight: 600;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { opacity: .92; }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.block { width: 100%; }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.link { border: none; background: none; padding: 0; color: var(--accent); font-weight: 500; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.links { margin-top: 18px; }
.card > .row:first-of-type + p, .card .row + p { margin-top: 14px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Mesaj ---------- */
.alert { padding: 11px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--accent-soft); color: var(--ink); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- Sekmeler / yöntem seçici ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: 1; padding: 8px 12px; font: inherit; font-size: 13px; font-weight: 600; border: none; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Pano yerleşimi ---------- */
.shell { max-width: 1040px; margin: 0 auto; padding: 20px 16px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.topbar .brand { margin: 0; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.nav a { padding: 10px 12px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.nav a.on { color: var(--ink); border-bottom-color: var(--accent); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: none; padding-top: 4px; }
.list .title { font-weight: 600; }
.list .meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.icon { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 15px; }
.icon.app { background: var(--accent-soft); color: var(--accent); }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; font-weight: 600; color: var(--muted); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.stat .v { font-size: 20px; font-weight: 700; margin-top: 4px; }
.banner { background: var(--warn-soft); color: var(--warn); padding: 10px 16px; font-size: 14px; font-weight: 600; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- Onay sayısı / karekod ---------- */
.number { font-family: var(--mono); font-size: 64px; font-weight: 700; text-align: center; letter-spacing: 4px; margin: 10px 0 4px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.choices button { font-family: var(--mono); font-size: 34px; font-weight: 700; padding: 20px 0; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.choices button:hover, .choices button:focus { border-color: var(--accent); }
.qr { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 14px; border: 1px solid var(--line); margin: 6px auto 12px; width: 100%; max-width: 260px; aspect-ratio: 1; }
.qr svg { width: 100%; height: 100%; }
.scanner { position: relative; width: 100%; aspect-ratio: 1; background: #000; border-radius: 16px; overflow: hidden; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.recovery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: var(--mono); font-size: 15px; background: var(--surface-2); padding: 14px; border-radius: 10px; }
.secret { font-family: var(--mono); font-size: 13px; word-break: break-all; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; }
.progress { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width 1s linear; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Modal / bildirim ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); overflow: auto; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-size: 14px; z-index: 60; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

/* ---------- Mobil ---------- */
@media (max-width: 560px) {
  .card { padding: 22px 18px; }
  .center-page { padding: 12px; align-items: flex-start; }
  .section { padding: 16px; }
  .list > li { flex-wrap: wrap; }
  .number { font-size: 54px; }
  .hide-sm { display: none; }
}
