/* Kasa — ortak tasarım sistemi. Web sitesi, Android uygulaması ve tarayıcı eklentisi bu dosyayı paylaşır.
   Renkler: çelik mavisi gövde + pirinç kadran. Özelleştirmek için aşağıdaki değişkenleri değiştirin. */

:root {
  --bg: #e6ebee;
  --panel: #f6f8f9;
  --raise: #ffffff;
  --line: #c8d2d8;
  --text: #13212a;
  --muted: #536772;
  --brass: #8a6510;
  --brass-ink: #ffffff;
  --brass-soft: #8a65101f;
  --danger: #b3372b;
  --ok: #1f7a4d;
  --shadow: 0 1px 2px #13212a14, 0 8px 24px #13212a14;
  --r-s: 6px;
  --r-m: 10px;
  --r-l: 18px;
  --display: Bahnschrift, "DIN Alternate", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Roboto Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light dark;
}
/* Tema: varsayılan sistem ayarını izler; <html data-theme="dark|light"> ile sabitlenir.
   .steel: her temada koyu çelik kalan yüzeyler (giriş kapısı, yan ray). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) { --bg: #0e181f; --panel: #16242d; --raise: #1e303b; --line: #2c4250; --text: #e8eef0; --muted: #8fa5b0; --brass: #d8b05a; --brass-ink: #1c1503; --brass-soft: #d8b05a24; --danger: #f08477; --ok: #6cc797; --shadow: 0 1px 2px #0006, 0 14px 36px #0006; color-scheme: dark; }
}
:root[data-theme=dark], .steel { --bg: #0e181f; --panel: #16242d; --raise: #1e303b; --line: #2c4250; --text: #e8eef0; --muted: #8fa5b0; --brass: #d8b05a; --brass-ink: #1c1503; --brass-soft: #d8b05a24; --danger: #f08477; --ok: #6cc797; --shadow: 0 1px 2px #0006, 0 14px 36px #0006; color-scheme: dark; }
:root[data-theme=light] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--body);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; line-height: 1.15; letter-spacing: .01em; }
h2 { font-size: 22px; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---------- Düğmeler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--raise);
  font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, translate .1s;
}
.btn:hover { border-color: var(--brass); }
.btn:active { translate: 0 1px; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.brass { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); }
.btn.brass:hover { filter: brightness(1.08); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn.quiet:hover { color: var(--text); background: var(--brass-soft); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn.wide { width: 100%; min-height: 44px; }
.link { padding: 0; border: 0; background: none; color: var(--brass); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Form ---------- */
.field { display: block; margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field > input, .field > textarea, .field > select, .field > .join { margin-top: 5px; }
input:not([type=checkbox], [type=radio]), textarea, select {
  display: block; width: 100%; min-height: 40px; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--bg); color: var(--text); font-weight: 400;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--brass); width: 16px; height: 16px; }
.secret { font-family: var(--mono); letter-spacing: .02em; }
.join { display: flex; gap: 6px; }
.join > input { flex: 1; min-width: 0; }
.error { min-height: 1.4em; margin-top: 10px; color: var(--danger); font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; }

/* ---------- Şifre kadranı: markanın ve "kilit açılıyor" anının imzası ---------- */
.dial {
  --size: 96px;
  position: relative; flex: none;
  width: var(--size); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, var(--raise), var(--panel) 62%);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 calc(var(--size) * .045) var(--bg), var(--shadow);
}
.dial::before { /* çentikli halka */
  content: ""; position: absolute; inset: calc(var(--size) * .09); border-radius: 50%;
  background:
    repeating-conic-gradient(from -1.5deg, var(--brass) 0 3deg, transparent 3deg 30deg),
    repeating-conic-gradient(from -.5deg, var(--muted) 0 1deg, transparent 1deg 6deg);
  -webkit-mask: radial-gradient(closest-side, transparent 76%, #000 77%);
  mask: radial-gradient(closest-side, transparent 76%, #000 77%);
}
.dial::after { /* tutamak */
  content: ""; position: absolute; inset: 29%; border-radius: 50%;
  background: linear-gradient(145deg, var(--raise), var(--bg));
  border: 1px solid var(--line);
  box-shadow: 0 calc(var(--size) * .03) calc(var(--size) * .08) #0004;
}
.dial > span { /* tutamak üzerindeki pirinç işaret */
  position: absolute; z-index: 1; left: 50%; top: 32%; width: calc(var(--size) * .03); height: calc(var(--size) * .12);
  margin-left: calc(var(--size) * -.015); border-radius: 2px; background: var(--brass);
  transform-origin: 50% calc(var(--size) * .18);
}
.dial.turning::before, .dial.turning > span { animation: dial-turn 2.6s var(--ease) infinite; }
.dial.open { animation: dial-open .5s var(--ease); }
@keyframes dial-turn {
  0% { rotate: 0deg; } 28% { rotate: 250deg; } 34% { rotate: 250deg; }
  58% { rotate: 80deg; } 64% { rotate: 80deg; } 92%, 100% { rotate: 360deg; }
}
@keyframes dial-open { 50% { scale: 1.06; box-shadow: inset 0 0 0 4px var(--bg), 0 0 0 6px var(--brass-soft), var(--shadow); } }

/* ---------- PIN tuş takımı ---------- */
.dots { display: flex; justify-content: center; gap: 16px; margin: 20px 0; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); transition: background .12s, border-color .12s, scale .12s; }
.dots i.on { background: var(--brass); border-color: var(--brass); scale: 1.15; }
.dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { translate: -8px 0; } 40%, 80% { translate: 8px 0; } }
.keys { display: grid; grid-template-columns: repeat(3, 68px); gap: 12px; justify-content: center; }
.keys button {
  height: 68px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--raise);
  font: 600 24px var(--display); cursor: pointer;
  transition: background .1s, scale .1s;
}
.keys button:active { scale: .93; background: var(--brass-soft); }
.keys button.aux { border-color: transparent; background: transparent; font-size: 15px; color: var(--muted); }
.keys.busy { opacity: .5; pointer-events: none; }

/* ---------- Bildirim ---------- */
.toast {
  position: fixed; z-index: 50; left: 50%; bottom: 24px; translate: -50% 16px;
  max-width: calc(100vw - 32px); padding: 10px 16px;
  border-radius: var(--r-m); border-left: 3px solid var(--brass);
  background: var(--text); color: var(--bg); font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, translate .2s var(--ease);
}
.toast.show { opacity: 1; translate: -50% 0; }

/* ---------- Kayıt satırı (web listesi ve eklenti aynı satırı kullanır) ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--brass-soft); }
.tag { /* kasa kutusu plakası */
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--bg); color: var(--brass);
  font: 600 17px var(--display); text-transform: uppercase;
}
.row-main { flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.row-main b, .row-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main b { font-weight: 600; }
.row-main span { color: var(--muted); font-size: 13px; }
.row-ops { display: flex; gap: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Ortak ek bileşenler ---------- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--brass); color: var(--brass); font-size: 11px; font-weight: 600; vertical-align: 2px; }
.badge.bad { border-color: var(--danger); color: var(--danger); }
.badge.good { border-color: var(--ok); color: var(--ok); }
.check { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; font-size: 14px; cursor: pointer; }
