/* Kasa — web sitesi ve mobil uygulama. Renkler ve ortak bileşenler lib/theme.css içindedir.
   Kimlik: çelik gövde, pirinç kadran. Giriş kapısı ve yan ray her temada koyu çeliktir (.steel). */

.sprite { position: absolute; width: 0; height: 0; }
svg use { pointer-events: none; }

/* =====================================================================
   Giriş kapısı
   ===================================================================== */
.gate {
  position: relative; overflow: hidden;
  min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr);
  background: radial-gradient(120% 90% at 28% 45%, #1a2c37 0%, #0f1b23 45%, #080f14 100%);
  color: var(--text);
  transition: opacity .45s;
}
.gate.leaving { opacity: 0; }

.scene {
  position: relative;
  display: flex; flex-wrap: wrap; align-content: center; align-items: center; justify-content: center; gap: clamp(24px, 4vw, 64px);
  padding: 48px clamp(24px, 5vw, 80px);
}
.glow { /* kapının arkasında ağır ağır dönen ışık */
  position: absolute; left: 50%; top: 50%; width: 140vmax; height: 140vmax; translate: -62% -50%;
  background: conic-gradient(from 0deg, transparent 0 20%, #d8b05a12 28%, transparent 36% 62%, #7fb3cc10 72%, transparent 80%);
  animation: spin 48s linear infinite; pointer-events: none;
}
@keyframes spin { to { rotate: 360deg; } }

.door {
  position: relative; flex: none;
  width: clamp(220px, 30vw, 400px); aspect-ratio: 1;
  filter: drop-shadow(0 30px 50px #000a);
  animation: door-in .9s var(--ease) both;
  transition: scale .6s var(--ease), opacity .45s;
}
.door svg { display: block; width: 100%; height: 100%; overflow: visible; }
.door::before, .door::after { /* kapıdan yayılan güvenlik halkası */
  content: ""; position: absolute; inset: 4%; border-radius: 50%;
  border: 1px solid var(--brass); opacity: 0;
  animation: ring 5s ease-out infinite;
}
.door::after { animation-delay: 2.5s; }
@keyframes ring { 0% { scale: .96; opacity: .5; } 70%, 100% { scale: 1.45; opacity: 0; } }
@keyframes door-in { from { opacity: 0; scale: .86; rotate: -8deg; } }

.ticks, .wheel { transform-origin: 200px 200px; }
.ticks.major { animation: spin 140s linear infinite; }
.ticks.fine { animation: spin 200s linear infinite reverse; }
.wheel { rotate: calc(var(--turn, 0) * 1deg); transition: rotate .5s var(--ease); }
.bolt { transition: transform .45s var(--ease); }
.door.turning .wheel { animation: dial-turn 2.6s var(--ease) infinite; }
.door.turning .ticks.major { animation-duration: 6s; }
.door.open .bolt { transform: translateY(30px); }
.door.open .wheel { rotate: 220deg; }
.gate.leaving .door { scale: 1.9; opacity: 0; transition-delay: .25s; }
.door.deny { animation: shake .4s; }

.pitch { position: relative; flex: 1 1 300px; min-width: 280px; max-width: 400px; }
.pitch h1 { font-size: clamp(52px, 6.5vw, 92px); letter-spacing: -.01em; animation: rise .7s .15s var(--ease) both; }
.lead { margin-top: 8px; font-size: 19px; color: var(--muted); animation: rise .7s .25s var(--ease) both; }
.proof { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 18px; }
.proof li { display: flex; gap: 14px; align-items: flex-start; animation: rise .7s var(--ease) both; }
.proof li:nth-child(1) { animation-delay: .4s; }
.proof li:nth-child(2) { animation-delay: .52s; }
.proof li:nth-child(3) { animation-delay: .64s; }
.proof svg { flex: none; width: 26px; height: 26px; margin-top: 2px; fill: none; stroke: var(--brass); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.proof span { color: var(--muted); font-size: 14px; }
.proof span b { display: block; color: var(--text); font-size: 15px; font-weight: 600; }
@keyframes rise { from { opacity: 0; translate: 0 14px; } }

.gate-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 32px clamp(16px, 4vw, 56px); }
.card {
  width: 100%; max-width: 400px; padding: 30px 28px 26px;
  border: 1px solid var(--line); border-top: 3px solid var(--brass); border-radius: var(--r-l);
  background: #14212acc; backdrop-filter: blur(14px);
  box-shadow: 0 2px 4px #0007, 0 24px 60px #0008;
  animation: rise .5s var(--ease) both;
}
.card h2 { margin-bottom: 4px; font-size: 26px; }
.tabs { display: flex; gap: 20px; margin: 16px 0 4px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 0; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.tab.active { color: var(--text); border-color: var(--brass); }
.card .btn.wide { margin-top: 10px; }
.link.below { display: block; margin: 16px auto 0; }
#v-pin { text-align: center; }
#v-pin .link { margin-top: 22px; }
.otp-input { text-align: center; font: 600 28px var(--display) !important; letter-spacing: .2em; min-height: 54px !important; }

.strength { display: flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.strength i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background .25s; }
.strength span { min-width: 92px; text-align: right; }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength[data-score="2"] i:nth-child(-n+2) { background: var(--brass); }
.strength[data-score="3"] i:nth-child(-n+3) { background: var(--ok); }
.strength[data-score="4"] i:nth-child(-n+4) { background: var(--ok); }

/* =====================================================================
   Uygulama kabuğu: çelik yan ray + sahne
   ===================================================================== */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100dvh; animation: fade .5s; }
@keyframes fade { from { opacity: 0; } }

.rail {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 26px; padding: 26px 18px 20px;
  color: var(--text);
  /* fırçalanmış çelik */
  background:
    repeating-linear-gradient(90deg, #ffffff05 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #172630, #0c151b);
  border-right: 1px solid var(--line);
}
.mark { display: flex; align-items: center; gap: 12px; padding: 0 6px; font: 600 26px var(--display); }
.mark .dial { --size: 40px; box-shadow: inset 0 0 0 2px var(--bg); }
.nav { display: grid; gap: 4px; }
.nav button, .dock button { border: 0; background: none; color: var(--muted); cursor: pointer; font-weight: 600; }
.nav button {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px;
  border-radius: var(--r-m); text-align: left; transition: background .15s, color .15s;
}
.nav button::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--brass); scale: 1 0; transition: scale .2s var(--ease); }
.nav button:hover { color: var(--text); background: #ffffff0a; }
.nav button.active { color: var(--text); background: var(--brass-soft); }
.nav button.active::before { scale: 1 1; }
.nav span { flex: 1; }
.nav em { font: 600 13px var(--display); font-style: normal; color: var(--brass); font-variant-numeric: tabular-nums; }
.nav em.bad { color: var(--danger); }
.rail svg, .dock svg, .topbar svg, .view-head .btn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rail-foot { margin-top: auto; display: grid; gap: 8px; }
.rail-foot .btn { justify-content: flex-start; min-height: 44px; }
.rail-label { margin: 0 2px 2px; font-size: 12px; color: var(--muted); }

.stage { min-width: 0; padding: 40px clamp(20px, 4vw, 56px) 80px; }
.view { max-width: 920px; margin: 0 auto; animation: view-in .35s var(--ease); }
@keyframes view-in { from { opacity: 0; translate: 0 10px; } }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.view-head h1 { font-size: clamp(34px, 4vw, 48px); letter-spacing: -.01em; }
.sub { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; color: var(--muted); font-size: 14px; }
.sync::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--ok); }
.sync.busy::before { background: var(--brass); animation: pulse 1s infinite; }
.sync.bad::before { background: var(--danger); }
@keyframes pulse { 50% { opacity: .25; } }

#search { min-height: 48px; margin-bottom: 14px; padding-left: 16px; background: var(--panel); font-size: 16px; }

.panel { margin-bottom: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow); }
.panel.pad { padding: 22px 24px; }
.panel h2 { font-size: 20px; }
.panel h2 + .hint { margin-top: 4px; max-width: 62ch; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel form { margin-top: 6px; }
.panel form.narrow { max-width: 380px; }
.panel form .btn { margin-top: 14px; }
.rows.flush { margin: 12px -24px 0; border-top: 1px solid var(--line); }
.rows.flush:empty { display: none; }
.rows.flush .row { padding-inline: 24px; }
.rows.flush + .rows.flush { margin-top: 0; }

/* Kayıt satırı: solda pirinç vurgu, sağlık noktası */
#vault .row, #health-list .row { position: relative; padding-block: 12px; }
#vault .row::before, #health-list .row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brass); scale: 1 0; transition: scale .2s var(--ease); }
#vault .row:hover::before, #health-list .row:hover::before { scale: 1 1; }
#vault.enter .row { animation: row-in .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes row-in { from { opacity: 0; translate: 0 10px; } }
.row-main span.badge { display: inline-block; color: var(--brass); font-size: 11px; }
.row-main span.badge.good { color: var(--ok); }
.row-main span.badge.bad { color: var(--danger); }
.tag.risk { color: var(--danger); border-color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.inline-ops { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.inline-ops.center { justify-content: center; }

/* ---------- Şifre sağlığı ---------- */
.health-top { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.score { position: relative; aspect-ratio: 1; border-radius: var(--r-l); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 18px; }
.score svg { width: 100%; height: 100%; rotate: -90deg; }
.score circle { fill: none; }
.score-ticks { stroke: var(--muted); stroke-width: 6; stroke-dasharray: 1 6.54; opacity: .5; }
.score-track { stroke: var(--line); stroke-width: 9; }
.score-run { stroke: var(--brass); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 377; stroke-dashoffset: 377; transition: stroke-dashoffset 1.1s var(--ease), stroke .4s; }
.score[data-level=bad] .score-run { stroke: var(--danger); }
.score[data-level=good] .score-run { stroke: var(--ok); }
.score-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score-num b { font: 600 56px/1 var(--display); font-variant-numeric: tabular-nums; }
.score-num span { color: var(--muted); font-size: 13px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; padding: 16px 18px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); color: var(--text); cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, translate .15s; }
.tile:hover { border-color: var(--brass); translate: 0 -2px; }
.tile.active { border-color: var(--brass); background: var(--brass-soft); }
.tile b { font: 600 34px/1 var(--display); font-variant-numeric: tabular-nums; }
.tile.zero b { color: var(--muted); }
.tile:not(.zero) b { color: var(--danger); }
.tile span { color: var(--muted); font-size: 13px; }
.tile span strong { display: block; color: var(--text); font-size: 15px; }

/* ---------- Ayarlar / güvenlik parçaları ---------- */
.setting { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; padding-bottom: 0; }
.setting div { flex: 1; min-width: 0; }
.setting b { display: block; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--r-s); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brass); background: var(--brass-soft); }
.choice:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.choice b { display: block; }
.choice i { font-style: normal; color: var(--muted); font-size: 13px; }
.seg3 { display: inline-grid; grid-auto-flow: column; gap: 4px; margin-top: 12px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg); }
.seg3 button { min-height: 34px; padding: 0 18px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.seg3 button.active { background: var(--brass); color: var(--brass-ink); }
.kit-key { display: block; margin: 16px 0; padding: 16px; border: 1px dashed var(--brass); border-radius: var(--r-m); background: var(--brass-soft); font-size: 17px; line-height: 1.7; text-align: center; word-spacing: .2em; user-select: all; }
.kit-ops { display: grid; gap: 8px; }

/* ---------- Pencereler ---------- */
dialog {
  width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 24px; overflow-y: auto;
  border: 1px solid var(--line); border-top: 3px solid var(--brass); border-radius: var(--r-l);
  background: var(--panel); color: var(--text); box-shadow: var(--shadow);
  opacity: 0; translate: 0 14px;
  transition: opacity .22s, translate .22s var(--ease), display .22s allow-discrete, overlay .22s allow-discrete;
}
dialog[open] { opacity: 1; translate: 0 0; }
@starting-style { dialog[open] { opacity: 0; translate: 0 14px; } }
dialog::backdrop { background: #060c10b3; backdrop-filter: blur(3px); }
dialog.drawer { margin: 0 0 0 auto; width: min(480px, 100vw); height: 100dvh; max-height: none; border-width: 0 0 0 1px; border-radius: 0; translate: 40px 0; }
dialog.drawer[open] { translate: 0 0; }
@starting-style { dialog.drawer[open] { translate: 40px 0; } }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gen { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.gen label { display: flex; align-items: center; gap: 6px; }
.gen input[type=number] { width: 68px; min-height: 30px; padding: 2px 8px; }
.actions { display: flex; gap: 8px; margin-top: 22px; }
.actions .grow { flex: 1; }
.code { margin: 14px 0; text-align: center; font: 600 34px var(--display); letter-spacing: .12em; color: var(--brass); }
.warn { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--brass); background: var(--brass-soft); font-size: 13px; }

.otp { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 22px 0 14px; }
.ring { flex: none; width: 64px; height: 64px; }
.ring circle { fill: none; stroke-width: 5; }
.ring .track { stroke: var(--line); }
.ring .run { stroke: var(--brass); stroke-linecap: round; stroke-dasharray: 175.9; transform: rotate(-90deg); transform-origin: 32px 32px; transition: stroke-dashoffset 1s linear; }
.ring text { fill: var(--text); font: 600 18px var(--display); }
.otp-code { font: 600 clamp(38px, 11vw, 52px) var(--display); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.otp-code.swap { animation: swap .35s var(--ease); }
@keyframes swap { from { opacity: 0; translate: 0 8px; } }

.finder { position: relative; margin-top: 14px; aspect-ratio: 1; border-radius: var(--r-m); overflow: hidden; background: #000; }
.finder video { width: 100%; height: 100%; object-fit: cover; }
.finder::after { content: ""; position: absolute; inset: 14%; border: 3px solid var(--brass); border-radius: var(--r-m); box-shadow: 0 0 0 100vmax #0007; }

.dock, .topbar { display: none; }

/* =====================================================================
   Dar ekran: uygulama düzeni
   ===================================================================== */
@media (max-width: 960px) {
  .gate { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .scene { flex-direction: column; gap: 10px; padding: max(28px, env(safe-area-inset-top)) 20px 6px; text-align: center; }
  .door { width: min(46vw, 190px); }
  .pitch { flex: none; min-width: 0; }
  .pitch h1 { font-size: 40px; }
  .lead { font-size: 15px; margin-top: 2px; }
  .proof { display: none; }
  .gate-panel { align-items: flex-start; padding: 14px 14px 28px; }
  .card { padding: 22px 20px; }
}
@media (max-width: 860px) {
  .shell { display: block; }
  .rail { display: none; }
  .stage { padding: calc(58px + env(safe-area-inset-top)) 14px calc(104px + env(safe-area-inset-bottom)); }
  .topbar { position: fixed; z-index: 6; top: 0; left: 0; right: 0; display: flex; justify-content: flex-end; gap: 6px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
  .topbar svg { width: 16px; height: 16px; }
  .dock {
    position: fixed; z-index: 6; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, #172630, #0c151b); border-top: 1px solid var(--line);
  }
  .dock button { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; padding: 6px 2px; font-size: 11px; }
  .dock svg { width: 22px; height: 22px; }
  .dock button.active { color: var(--brass); }
  .dock button.main { color: var(--brass-ink); }
  .dock button.main svg { width: 50px; height: 50px; padding: 13px; margin-top: -22px; border-radius: 50%; background: var(--brass); box-shadow: 0 6px 18px #000a, 0 0 0 5px #0c151b; }
  .dock button.main span { color: var(--brass); }
  .view-head { align-items: center; }
  .health-top { grid-template-columns: 1fr; }
  .score { max-width: 220px; margin: 0 auto; width: 100%; }
  .two { grid-template-columns: 1fr; gap: 0; }
  .row-ops .user { display: none; }
  .panel.pad { padding: 18px 16px; }
  .rows.flush { margin-inline: -16px; }
  .rows.flush .row { padding-inline: 16px; }
  .panel-head { flex-direction: column; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  dialog:not(.drawer) { margin-bottom: 0; width: 100vw; max-width: none; border-radius: var(--r-l) var(--r-l) 0 0; border-width: 3px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
