/* Sesliye Gel ortak tasarim dili. Tanitim, yonetim ve uygulama bunu kullanir.
   Yon (3 Kasim 2026, Engin onayladi; apple-design skill'i):
   - Yalnizca koyu tema: gece mavisi zemin, kemik beyazi metin.
   - Amber (--sinyal) YALNIZCA "konusuyor / canli" demek. Birincil dugme
     kemik beyazi; secili oge kemik beyazi isaretle, amberle degil.
   - Basliklar ve buyuk sayilar Bricolage Grotesque; govde ve kontroller
     sistem yazisi (kucuk boyutta okunakli).
   Kontrastlar (zemin #0d1b2a / yuzey #14273b): metin 14.9 / 13.0,
   ikincil 8.0 / 7.0, soluk 5.8 / 5.0, kenar 3.8 / 3.3, sinyal 9.8 / 8.6,
   hata 7.6 / 6.7, iyi 10.0 / 8.7. Soluk metni --yuzey-2 uzerinde kullanma (4.45). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-0130, U+0132-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --zemin: #0d1b2a;        /* sayfa */
  --zemin-derin: #0a1622;  /* kenar cubugu, alt cubuk */
  --yuzey: #14273b;        /* kart, giris alani */
  --yuzey-2: #1a3049;      /* uzerine gelinmis, secili */
  --metin: #f1ede4;
  --ikincil: #9fb2c4;
  --soluk: #8197ab;
  --kenar: #5f7891;        /* kontrol siniri (3:1 ustu) */
  --cizgi: #22374d;        /* ayirici, dekor */
  --kart-kenar: #263d55;
  --sinyal: #ffb43a;       /* YALNIZCA konusuyor / canli */
  --hata: #ff8a80;
  --iyi: #7fd6a5;
  --lacivert: #0d1b2a;     /* acik zemin ustundeki metin */

  --yazi-baslik: "Bricolage Grotesque", system-ui, sans-serif;
  --yazi-govde: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --yazi-kod: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --kose: .75rem;
  --kose-kucuk: .55rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--zemin);
  color: var(--metin);
  font-family: var(--yazi-govde);
  font-size: 1rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-family: var(--yazi-baslik); letter-spacing: -.015em; line-height: 1.1; }
a { color: inherit; text-underline-offset: .2em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--metin); outline-offset: 2px; border-radius: .3rem; }
::selection { background: var(--metin); color: var(--lacivert); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- metin ---------- */

.hint { color: var(--ikincil); font-size: .875rem; }
.error { color: var(--hata); font-weight: 600; font-size: .9375rem; }
.ok-note { color: var(--iyi); font-weight: 600; }
.kod, code { font-family: var(--yazi-kod); font-size: .9375em; }

/* ---------- kontroller ---------- */

button {
  font: inherit; font-weight: 600; font-size: .9375rem;
  color: var(--metin);
  background: var(--yuzey);
  border: 1px solid var(--kart-kenar);
  border-radius: var(--kose-kucuk);
  min-height: 2.5rem; padding: 0 .95rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  cursor: pointer;
}
button:hover { background: var(--yuzey-2); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--metin); border-color: var(--metin); color: var(--lacivert); font-weight: 700; }
button.primary:hover { background: #ffffff; }
button.quiet { background: transparent; border-color: var(--kart-kenar); }
button.quiet:hover { background: var(--yuzey); }
button.danger { color: var(--hata); border-color: rgba(255, 138, 128, .45); background: transparent; }
button.danger:hover { background: rgba(255, 138, 128, .12); }

input, select, textarea {
  font: inherit; font-size: 1rem;
  color: var(--metin);
  background: var(--yuzey);
  border: 1px solid var(--kenar);
  border-radius: var(--kose-kucuk);
  min-height: 2.75rem; padding: .5rem .8rem;
  width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--soluk); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--metin); outline-offset: 1px; }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; min-height: 0; accent-color: var(--metin); }
input[type="range"] { padding: 0; border: 0; background: none; min-height: 1.75rem; accent-color: var(--metin); cursor: pointer; }
select { appearance: auto; }
label { font-size: .875rem; font-weight: 600; color: var(--ikincil); }

/* Etiketli alan: etiket ustte, alan altta. Yer tutucu etiket yerine gecmez. */
.alan { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.alan .hint { font-weight: 400; }

/* ---------- kart ve liste ---------- */

.card {
  background: var(--yuzey);
  border: 1px solid var(--kart-kenar);
  border-radius: var(--kose);
  padding: .9rem 1rem;
}
.list { display: flex; flex-direction: column; gap: .5rem; }

/* Durum yongasi: renk tek basina anlam tasimiyor, her zaman yazili. */
.yonga {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  padding: .15rem .55rem; border-radius: 999px;
  border: 1px solid var(--kart-kenar); color: var(--ikincil);
}
.yonga.iyi { color: var(--iyi); border-color: rgba(127, 214, 165, .4); }
.yonga.hata { color: var(--hata); border-color: rgba(255, 138, 128, .45); }

/* ---------- isaret (wordmark) ---------- */

.isaret {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--yazi-baslik); font-weight: 700; font-size: 1.0625rem;
  color: var(--metin); text-decoration: none;
}
.isaret-cubuklar { display: inline-flex; align-items: center; gap: 3px; height: 1.15rem; }
.isaret-cubuklar i { display: block; width: 3px; border-radius: 2px; background: currentColor; }
.isaret-cubuklar i:nth-child(1) { height: 35%; }
.isaret-cubuklar i:nth-child(2) { height: 70%; }
.isaret-cubuklar i:nth-child(3) { height: 100%; }
.isaret-cubuklar i:nth-child(4) { height: 60%; }
.isaret-cubuklar i:nth-child(5) { height: 30%; }

/* ---------- giris ekrani (uygulama ve yonetim ortak) ---------- */

.gate {
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  width: 100%; max-width: 26rem; margin: 0 auto;
  padding: 2.5rem 1.25rem;
  gap: 1.75rem;
}
.gate-ust { display: flex; flex-direction: column; gap: .9rem; }
.gate-ust h1 { font-size: clamp(2.25rem, 9vw, 3rem); font-weight: 800; letter-spacing: -.03em; }
.gate-lead { color: var(--ikincil); font-size: 1.0625rem; }
.gate-form { display: flex; flex-direction: column; gap: .9rem; }
.gate-form .alan input { min-height: 3rem; font-size: 1.0625rem; }
.gate-form button[type="submit"] { min-height: 3rem; font-size: 1.0625rem; margin-top: .35rem; }
.gate-form .error { margin: 0; }
.gate-note { color: var(--ikincil); font-size: .9375rem; min-height: 1.4em; }
.gate-alt { color: var(--soluk); font-size: .8125rem; }
.gate-alt a { color: var(--ikincil); }

/* ---------- pencere (pencere.js) ---------- */
/* Tarayicinin prompt()/confirm() kutularinin yerine. Masaustunde ortada kart,
   telefonda alttan acilan yaprak (basparmak erisimi). */

.pencere {
  width: min(27rem, calc(100% - 2rem));
  padding: 0; margin: auto;
  color: var(--metin);
  background: var(--zemin-derin);
  border: 1px solid var(--kart-kenar);
  border-radius: 1rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
}
.pencere::backdrop { background: rgba(5, 12, 20, .7); }
.pencere[open] { animation: pencere-gel .16s ease-out; }
@keyframes pencere-gel { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.pencere-form { display: flex; flex-direction: column; gap: 1rem; padding: 1.4rem 1.4rem 1.25rem; }
.pencere-bas { display: flex; align-items: center; gap: .6rem; }
.pencere-bas h2 { font-size: 1.375rem; font-weight: 800; overflow-wrap: anywhere; }
.pencere-simge { width: 1.5rem; height: 1.5rem; flex: none; color: var(--ikincil); }
.pencere-aciklama { color: var(--ikincil); }
.pencere-girdi { position: relative; display: flex; }
.pencere-secenekler { display: flex; flex-direction: column; gap: .35rem; }
.pencere-secenek {
  display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: .65rem;
  padding: .55rem .75rem; border: 1px solid var(--kart-kenar); border-radius: var(--kose-kucuk);
  background: var(--yuzey); cursor: pointer; font-weight: 600;
}
.pencere-secenek:hover { background: var(--yuzey-2); }
.pencere-secenek:has(input:checked) { border-color: var(--metin); box-shadow: 0 0 0 1px var(--metin); }
.pencere-secenek input { grid-row: span 2; width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--metin); }
.pencere-secenek .secenek-ipucu { grid-column: 2; font-size: .8125rem; font-weight: 400; color: var(--ikincil); }
.pencere-girdi input { min-height: 3rem; font-size: 1.0625rem; }
.pencere-girdi input:has(+ .pencere-goster) { padding-right: 5rem; }
/* Gizli metin (oda sifresi): sifre alani degil, yazilan yine nokta. */
.pencere-girdi input.maskeli { -webkit-text-security: disc; }
.pencere-goster {
  position: absolute; right: .3rem; top: 50%; transform: translateY(-50%);
  min-height: 2.25rem; padding: 0 .7rem; font-size: .8125rem;
  background: transparent; border-color: transparent; color: var(--ikincil);
}
.pencere-goster:hover { background: var(--yuzey-2); color: var(--metin); }
.pencere-hata { margin: -.25rem 0 0; }
.pencere-eylem { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; margin-top: .25rem; }
.pencere-eylem button { min-height: 2.75rem; min-width: 6.5rem; }
/* Geri alinamaz islem: kirmizi dolu dugme (yazili, renk tek basina degil). */
button.danger.dolu { background: var(--hata); border-color: var(--hata); color: var(--lacivert); }
button.danger.dolu:hover { background: #ffa59d; }

@media (max-width: 30rem) {
  .pencere {
    width: 100%; max-width: none; margin: auto 0 0;
    border-radius: 1.1rem 1.1rem 0 0; border-bottom: 0;
  }
  .pencere-form { padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
  .pencere-eylem button { flex: 1 1 0; }
  .pencere[open] { animation-name: pencere-yaprak; }
  @keyframes pencere-yaprak { from { transform: translateY(100%); } }
}

/* ---------- karekod (karekod.js) ---------- */
/* Beyaz zeminli kare: tarayicinin rahat okumasi icin yeterince buyuk. */
.karekod { width: min(14rem, 100%); aspect-ratio: 1; border-radius: var(--kose-kucuk); overflow: hidden; background: #fff; }
.karekod svg { display: block; width: 100%; height: 100%; }
.totp-kurulum { display: flex; flex-direction: column; gap: .6rem; }
.totp-elle summary { cursor: pointer; color: var(--ikincil); font-size: .875rem; min-height: 2rem; display: flex; align-items: center; }
.totp-elle[open] summary { margin-bottom: .4rem; }
.totp-elle summary { list-style: none; gap: .4rem; }
.totp-elle summary::-webkit-details-marker { display: none; }
.totp-elle summary::before { content: "›"; font-size: 1.2rem; line-height: 1; color: var(--metin); transition: transform .15s; }
.totp-elle[open] summary::before { transform: rotate(90deg); }
