/* Merkezi giris — tek stil dosyasi, dis kutuphane yok. Renkler ve bicim Moduller (modul.selcuk.edu.tr)
   ile ayni token'lardan; koyu tema prefers-color-scheme ile. Sayfa guvenlik politikasi dis yazi tipine
   izin vermiyor (font-src 'self'): sistem yazi tipi. */
:root {
  --navy: #123a6b;
  --navy-deep: #0c2a50;
  --gold: #f5c542;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-sunken: #eef1f6;
  --text: #17202f;
  --muted: #5b6678;
  --border: #dde3ec;
  --focus: #2f6fdb;
  --danger-bg: #fdeceb;
  --danger-text: #9b1c1c;
  --danger-border: #f5c2c0;
  --warn-bg: #fff6dc;
  --warn-text: #7a5300;
  --warn-border: #f3dc9b;
  --shadow: 0 1px 2px rgba(16, 32, 56, 0.06), 0 10px 30px rgba(16, 32, 56, 0.08);
  --primary: var(--navy);
  --primary-hover: var(--navy-deep);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1520;
    --surface: #182131;
    --surface-sunken: #111927;
    --text: #e7ecf3;
    --muted: #9aa6b8;
    --border: #2a3547;
    --focus: #7fa8ff;
    --danger-bg: #3a1b1d;
    --danger-text: #f6b4b0;
    --danger-border: #5c2a2d;
    --warn-bg: #332a12;
    --warn-text: #f3d68a;
    --warn-border: #54451d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
    --primary: #2b5c9e;
    --primary-hover: #346bb4;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--focus); }

/* giris.js paneli, QR'i ve "Yeni kod" dugmesini hidden ile gizler; display veren siniflar bunu ezmesin. */
[hidden], .d-none { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Sayfa iskeleti: solda marka paneli, sagda kart ─────────────────────── */
.sayfa { min-height: 100vh; display: flex; }

.marka {
  position: relative; overflow: hidden;
  flex: 0 0 42%; max-width: 560px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: 48px 48px 40px;
  color: #fff;
  background:
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(160deg, #1a4a85 0%, var(--navy) 45%, var(--navy-deep) 100%);
  border-right: 4px solid var(--gold);
}

/* Moduller'in marka isaretindeki dort kare, buyuk ve soluk: iki sayfa ayni aileden. */
.marka::after {
  content: ""; position: absolute; right: 40px; bottom: 36px; width: 120px; height: 120px;
  background:
    linear-gradient(var(--gold), var(--gold)) 0 0 / 52px 52px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 68px 0 / 52px 52px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 68px / 52px 52px no-repeat;
  opacity: .22; pointer-events: none;
}

.marka-ust { display: flex; align-items: center; gap: 16px; }
.marka-logo { width: 72px; height: 72px; flex: none; border-radius: 50%; background: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); }
.marka-yazi { display: flex; flex-direction: column; line-height: 1.2; }
.marka-universite { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.marka-baslik { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }

.marka-orta { position: relative; z-index: 1; max-width: 400px; }
.marka-slogan { margin: 0 0 24px; font-size: 28px; font-weight: 700; line-height: 1.25; letter-spacing: -.015em; }
.marka-slogan em { font-style: normal; color: var(--gold); }
.marka-maddeler { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.marka-maddeler li { display: flex; align-items: flex-start; gap: 12px; color: rgba(255, 255, 255, 0.88); }
.marka-maddeler svg { width: 22px; height: 22px; flex: none; margin-top: 1px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.marka-alt { position: relative; z-index: 1; font-size: 13px; color: rgba(255, 255, 255, 0.7); }

.icerik {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 24px 24px;
}

.kart {
  width: 100%; max-width: 440px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 32px;
}

.kart-baslik { margin-bottom: 24px; }
.kart-baslik h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.kart-baslik p { margin: 0; color: var(--muted); }
.kart-baslik.orta { text-align: center; }

/* ── Gelistiren birimler ─────────────────────────────────────────────────── */
.gelistiren { margin-top: 28px; max-width: 440px; text-align: center; font-size: 12.5px; color: var(--muted); }
.gelistiren p { margin: 0; }
.gelistiren-adlar { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 600; color: var(--text); opacity: .8; }
.gelistiren-ayrac { width: 24px; height: 2px; border-radius: 2px; background: var(--gold); }
.gelistiren-not { margin-top: 6px !important; }

/* ── Sekmeler ────────────────────────────────────────────────────────────── */
.giris-sekmeler {
  display: flex; gap: 4px; margin: 0 0 24px; padding: 4px;
  border-radius: 12px; background: var(--surface-sunken); border: 1px solid var(--border);
}
.giris-sekme {
  flex: 1; border: 0; border-radius: 9px; padding: 8px 12px;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.giris-sekme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.giris-sekme:hover { color: var(--text); }
.giris-sekme.aktif { background: var(--surface); color: var(--navy); box-shadow: 0 1px 3px rgba(16, 32, 56, 0.14); }

@media (prefers-color-scheme: dark) {
  .giris-sekme.aktif { color: var(--text); }
}

/* ── Form ────────────────────────────────────────────────────────────────── */
.alan-grup { margin-bottom: 16px; }
.alan-etiket { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }

.alan {
  display: flex; align-items: stretch;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.alan:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }

.alan input, .alan select {
  font: inherit; color: var(--text); background: transparent; border: 0; outline: 0;
  min-height: 44px; padding: 0 14px;
}
.alan input { flex: 1; min-width: 0; }
.alan select {
  flex: none; max-width: 52%; cursor: pointer;
  border-left: 1px solid var(--border); border-radius: 0 10px 10px 0;
  background: var(--surface-sunken); color: var(--muted); font-size: 14px; padding-right: 10px;
}

.parola-goster {
  flex: none; display: grid; place-items: center; width: 44px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 0 10px 10px 0;
}
.parola-goster:hover { color: var(--text); }
.parola-goster svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.parola-goster .goz-kapali { display: none; }
.parola-goster[aria-pressed="true"] .goz-acik { display: none; }
.parola-goster[aria-pressed="true"] .goz-kapali { display: block; }

/* ── Dugmeler ────────────────────────────────────────────────────────────── */
.dugme {
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease;
}
.dugme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dugme-tam { width: 100%; }
.dugme-ana { background: var(--primary); color: #fff; margin-top: 8px; }
.dugme-ana:hover { background: var(--primary-hover); }
.dugme-ana:disabled { opacity: .7; cursor: progress; }
.dugme-ikincil { background: var(--surface); color: var(--text); border-color: var(--border); }
.dugme-ikincil:hover { background: var(--surface-sunken); }

.dugme:focus-visible, .giris-sekme:focus-visible, .parola-goster:focus-visible, .hesap-secenek input:focus-visible + label {
  outline: 3px solid var(--focus); outline-offset: 2px;
}

.dugme-satiri { display: flex; gap: 10px; margin-top: 20px; }
.dugme-satiri .dugme { flex: 1; }

/* ── e-Devlet ────────────────────────────────────────────────────────────── */
.ayirici { display: flex; align-items: center; gap: 12px; margin: 24px 0 16px; color: var(--muted); font-size: 13px; }
.ayirici::before, .ayirici::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.dugme-edevlet { width: 100%; background: var(--surface); color: var(--text); border-color: var(--border); }
.dugme-edevlet:hover { border-color: #e30a17; background: var(--surface-sunken); }
/* Logo kirmizi-beyaz: koyu temada da beyaz zemin uzerinde kalir. */
.edevlet-logo { display: block; height: 30px; width: auto; padding: 5px 8px; background: #fff; border-radius: 6px; }
.edevlet-not { margin: 8px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ── Uyarilar ────────────────────────────────────────────────────────────── */
.uyari { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; border: 1px solid; font-size: 14px; }
.uyari-hata { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-border); }
.uyari-dikkat { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.uyari-ust { margin-top: 16px; margin-bottom: 0; }

/* ── QR ──────────────────────────────────────────────────────────────────── */
.qr-baslik { text-align: center; font-weight: 600; margin: 0 0 12px; }
.qr-kutu {
  display: flex; align-items: center; justify-content: center; min-height: 248px;
  border-radius: 14px; background: var(--surface-sunken); border: 1px dashed var(--border);
}
/* QR her zaman beyaz zemin uzerinde: koyu temada telefon kamerasi okuyamaz. */
.qr-kutu img { width: 220px; height: 220px; padding: 8px; background: #fff; border-radius: 10px; image-rendering: pixelated; }
.qr-durum { text-align: center; min-height: 1.5rem; margin: 12px 0; color: var(--muted); }
.qr-yeni-satir { text-align: center; }
.qr-adimlar { margin: 16px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.qr-adimlar li + li { margin-top: 4px; }

/* ── Telefon onayi, oturum, hata ─────────────────────────────────────────── */
.simge-daire {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-sunken); color: var(--navy);
}
.simge-daire svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { .simge-daire { color: var(--gold); } }

.metin { margin: 0 0 16px; color: var(--muted); text-align: center; }
.sure { text-align: center; margin: 0 0 8px; color: var(--muted); }
.sure strong { display: block; font-size: 32px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: .02em; }

.kisi { text-align: center; margin: 0 0 8px; }
.kisi-ad { display: block; font-size: 17px; font-weight: 650; }
.kisi-kullanici { color: var(--muted); font-size: 14px; }
.bas-harf {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px; font-weight: 700;
  background: var(--navy); color: var(--gold);
}

/* ── e-Devlet hesap secimi (sozlesme 6.4) ────────────────────────────────── */
.hesap-secenekler { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.hesap-secenek { position: relative; }
.hesap-secenek input { position: absolute; opacity: 0; pointer-events: none; }
.hesap-secenek label {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px;
  padding: 12px 14px 12px 42px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  position: relative;
}
.hesap-secenek label::before {
  content: ""; position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  border-radius: 50%; border: 2px solid var(--border); background: var(--surface);
}
.hesap-secenek input:checked + label { border-color: var(--navy); background: color-mix(in srgb, var(--navy) 7%, var(--surface)); }
.hesap-secenek input:checked + label::before { border: 5px solid var(--navy); }
@media (prefers-color-scheme: dark) {
  .hesap-secenek input:checked + label { border-color: var(--focus); background: color-mix(in srgb, var(--focus) 12%, var(--surface)); }
  .hesap-secenek input:checked + label::before { border-color: var(--focus); }
}
.hesap-tur { font-weight: 600; }
.hesap-ayrac { color: var(--muted); }
.hesap-birim { color: var(--muted); }

/* ── Dar ekran: marka paneli ust bara doner (Moduller'in ust bari gibi) ──── */
@media (max-width: 960px) {
  .sayfa { flex-direction: column; }
  .marka {
    flex: none; max-width: none; padding: 14px 20px; gap: 0;
    border-right: 0; border-bottom: 3px solid var(--gold);
  }
  .marka::after, .marka-orta, .marka-alt { display: none; }
  .marka-logo { width: 40px; height: 40px; }
  .marka-universite { font-size: 11px; }
  .marka-baslik { font-size: 18px; }
  .icerik { justify-content: flex-start; padding: 28px 16px 20px; }
}

@media (max-width: 480px) {
  .kart { padding: 24px 20px; border-radius: 14px; }
  .alan select { max-width: 48%; font-size: 13px; padding: 0 6px 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .alan, .dugme { transition: none; }
}
