/* ============================================================================
   VOTUM — bileşenler
   ============================================================================ */

/* ----------------------------------------------------------------------------
   Düğme

   Metin bağlantısı yerine düğme: oy kabininde ve panelde her eylem
   dokunulabilir bir hedef olmalı. Küçük ekranda 44px, her yerde.
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 44px; padding: .65rem 1.25rem;
  border: 1px solid transparent; border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 580; letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  background: var(--accent); color: var(--accent-fg);
  box-shadow: var(--shadow-accent);
  transition: background var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease),
              translate var(--t-fast) var(--ease),
              opacity var(--t-fast) var(--ease);
}
.btn:hover  { background: var(--accent-hover); color: var(--accent-fg); translate: 0 -1px; }
.btn:active { translate: 0 0; box-shadow: none; }
.btn svg    { width: 1.05em; height: 1.05em; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.btn-lg { min-height: 54px; padding: .85rem 1.9rem; font-size: 1.0625rem; border-radius: var(--r-lg); }
.btn-sm { min-height: 36px; padding: .35rem .85rem; font-size: var(--fs-xs); border-radius: var(--r-sm); }
.btn-block { width: 100%; }

.btn-ghost {
  background: var(--bg-raised); color: var(--fg);
  border-color: var(--border); box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { background: var(--bg-sunken); color: var(--fg); border-color: var(--fg-subtle); }

.btn-quiet {
  background: transparent; color: var(--fg-muted);
  border-color: transparent; box-shadow: none;
}
.btn-quiet:hover { background: var(--bg-sunken); color: var(--fg); }

.btn-danger { background: var(--danger); color: var(--paper-0); box-shadow: none; }
.btn-danger:hover { background: var(--danger-600); color: var(--paper-0); }

.btn-danger-quiet { background: transparent; color: var(--danger); border-color: transparent; box-shadow: none; }
.btn-danger-quiet:hover { background: oklch(0.63 0.21 22 / 0.10); color: var(--danger); }

/* Koyu zeminde düğme */
.on-ink .btn-ghost {
  background: oklch(1 0 0 / 0.07); color: oklch(0.97 0 0);
  border-color: oklch(1 0 0 / 0.16); box-shadow: none;
}
.on-ink .btn-ghost:hover { background: oklch(1 0 0 / 0.13); border-color: oklch(1 0 0 / 0.3); }

/* ----------------------------------------------------------------------------
   İkon düğmesi ve ikonlar
   -------------------------------------------------------------------------- */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-md);
  color: var(--fg-muted); border: 1px solid transparent;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--bg-sunken); color: var(--fg); }
.icon-btn svg { width: 20px; height: 20px; }

.i    { width: 20px; height: 20px; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 26px; height: 26px; }

/* İkon kabı: özellik listelerinde ve adımlarda */
.icon-pad {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--accent-weak); color: var(--accent);
}
.icon-pad.verify { background: oklch(0.66 0.155 158 / 0.13); color: var(--verify); }
.icon-pad.warn   { background: oklch(0.75 0.155 75 / 0.16);  color: var(--warn); }
.icon-pad.plain  { background: var(--bg-sunken); color: var(--fg-muted); }

/* ----------------------------------------------------------------------------
   Kart ve panel
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(1.25rem, 3vw, 1.85rem);
  box-shadow: var(--shadow-sm);
}
.card-lg { border-radius: var(--r-xl); padding: clamp(1.5rem, 4vw, 2.5rem); }
.card-quiet { background: var(--bg-sunken); box-shadow: none; }
.card-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-head h2, .card-head h3 { margin: 0; }

.card-link {
  display: block; text-decoration: none; color: inherit;
  transition: border-color var(--t-mid) var(--ease),
              box-shadow var(--t-mid) var(--ease),
              translate var(--t-mid) var(--ease-out);
}
.card-link:hover {
  color: inherit; border-color: var(--accent);
  box-shadow: var(--shadow-md); translate: 0 -2px;
}

/* Vurgulu kutu */
.callout {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: clamp(1.15rem, 3vw, 1.6rem); background: var(--bg-sunken);
  display: grid; gap: .65rem;
}
.callout-accent { border-color: var(--accent); background: var(--accent-weak); }
.callout-warn   { border-color: var(--warn);   background: oklch(0.75 0.155 75 / 0.09); }
.callout-danger { border-color: var(--danger); background: oklch(0.63 0.21 22 / 0.08); }
.callout h2, .callout h3 { margin: 0; }
.callout-head { display: flex; gap: .7rem; align-items: center; }

/* ----------------------------------------------------------------------------
   Bildirim
   -------------------------------------------------------------------------- */
.flash {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: .9rem 1.1rem; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--bg-raised);
  font-size: var(--fs-sm); box-shadow: var(--shadow-sm);
}
.flash svg { margin-top: .15rem; }
.flash > div { display: grid; gap: .25rem; }
.flash p { margin: 0; }
.flash-success { border-color: var(--verify); background: oklch(0.66 0.155 158 / 0.09); color: var(--fg); }
.flash-success svg { color: var(--verify); }
.flash-error   { border-color: var(--danger); background: oklch(0.63 0.21 22 / 0.08); }
.flash-error svg { color: var(--danger); }
.flash-warn    { border-color: var(--warn); background: oklch(0.75 0.155 75 / 0.10); }
.flash-warn svg { color: var(--warn); }
.flash-info svg { color: var(--accent); }

/* ----------------------------------------------------------------------------
   Rozet ve durum noktası
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .25rem .7rem; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 580; letter-spacing: -0.003em;
  border: 1px solid var(--border); background: var(--bg-raised); color: var(--fg-muted);
  white-space: nowrap;
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .75;
}
.badge-plain::before { display: none; }
.badge-open    { color: var(--verify); border-color: oklch(0.66 0.155 158 / 0.4); background: oklch(0.66 0.155 158 / 0.10); }
.badge-open::before { animation: pulse 2.4s var(--ease) infinite; opacity: 1; }
.badge-closed  { color: var(--warn);   border-color: oklch(0.75 0.155 75 / 0.4);  background: oklch(0.75 0.155 75 / 0.10); }
.badge-tallied { color: var(--accent); border-color: var(--accent-ring); background: var(--accent-weak); }
.badge-archived, .badge-draft, .badge-setup { color: var(--fg-subtle); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50%      { box-shadow: 0 0 0 4px transparent; opacity: .55; }
}

/* ----------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */
.field { display: grid; gap: .4rem; }
.field > label, label.field-label {
  font-size: var(--fs-sm); font-weight: 570; color: var(--fg);
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="datetime-local"], input[type="search"],
input:not([type]), select, textarea {
  width: 100%; min-height: 46px;
  padding: .65rem .85rem;
  background: var(--bg-raised); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--fg-subtle); }
input:hover, select:hover, textarea:hover { border-color: var(--fg-subtle); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
textarea { min-height: 7rem; resize: vertical; line-height: 1.6; }

select {
  appearance: none; padding-inline-end: 2.4rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

input[type="checkbox"], input[type="radio"] {
  width: 1.15rem; height: 1.15rem; min-height: 0;
  accent-color: var(--accent); cursor: pointer;
}

.check {
  display: flex; gap: .7rem; align-items: flex-start;
  font-weight: 400; font-size: var(--fs-sm); cursor: pointer;
}
.check input { margin-top: .22rem; flex: none; }

.field-error { color: var(--danger); font-size: var(--fs-sm); }

fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 1rem; }
legend { padding: 0; font-weight: 620; font-size: var(--fs-h3); }

.form-grid { display: grid; gap: 1.5rem; }
.form-grid > fieldset { border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(1.15rem, 3vw, 1.7rem); background: var(--bg-raised); }
.form-grid legend { padding-inline: .55rem; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .08em; color: var(--fg-subtle); }
.form-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

/* ----------------------------------------------------------------------------
   Tablo
   -------------------------------------------------------------------------- */
.table-wrap {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; background: var(--bg-raised);
}
.table-wrap.scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.data th, .data td { text-align: start; padding: .8rem 1rem; vertical-align: middle; }
.data thead th {
  font-size: var(--fs-label); font-weight: 620; letter-spacing: .07em;
  text-transform: uppercase; color: var(--fg-subtle);
  background: var(--bg-sunken); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data tbody tr { border-top: 1px solid var(--border-soft); }
.data tbody tr:first-child { border-top: 0; }
.data tbody tr:hover { background: var(--bg-sunken); }
.data .num { text-align: end; font-variant-numeric: tabular-nums; }
.data .actions { white-space: nowrap; text-align: end; }
.data .actions form { display: inline; }
.data .actions > * { margin-inline-start: .3rem; }

@media (max-width: 52rem) {
  .data, .data tbody, .data tr, .data td { display: block; width: 100%; }
  .data thead { display: none; }
  .table-wrap { border: 0; background: none; }
  .data tbody tr {
    border: 1px solid var(--border); border-radius: var(--r-lg);
    margin-bottom: .75rem; padding: .35rem .25rem; background: var(--bg-raised);
  }
  .data td { padding: .4rem .85rem; }
  .data .num, .data .actions { text-align: start; }
}

/* ----------------------------------------------------------------------------
   Kod ve parmak izi
   -------------------------------------------------------------------------- */
code:not(pre code) {
  background: var(--bg-sunken); border: 1px solid var(--border-soft);
  border-radius: 6px; padding: .12em .42em; font-size: .875em;
}
pre.block, .fingerprint {
  font-family: var(--mono); font-size: var(--fs-xs); line-height: 1.7;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: .9rem 1.05rem;
  overflow-wrap: anywhere; white-space: pre-wrap; margin: 0;
}
.fingerprint { color: var(--fg-muted); }
code.token {
  font-size: .875rem; letter-spacing: .05em; white-space: nowrap;
  background: var(--bg-sunken);
}

/* ----------------------------------------------------------------------------
   Sayı kartı
   -------------------------------------------------------------------------- */
.stats { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
.stat {
  display: grid; gap: .15rem; padding: 1.1rem 1.2rem;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.stat-n { font-size: clamp(1.7rem, 3.5vw, 2.1rem); font-weight: 660; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.stat-l { font-size: var(--fs-xs); color: var(--fg-muted); }
.stat-accent .stat-n { color: var(--accent); }

/* ----------------------------------------------------------------------------
   Sonuç çubuğu

   Genişlik satır içi `style` ile DEĞİL, nonce'lu bir <style> bloğundan gelen
   --w değişkeniyle verilir: CSP satır içi stil niteliğini engelliyor.
   -------------------------------------------------------------------------- */
.results { display: grid; gap: 1.15rem; list-style: none; padding: 0; margin: 0; }
.result-row { display: grid; gap: .45rem; }
.result-head { display: flex; gap: 1rem; align-items: baseline; justify-content: space-between; }
.result-name { font-weight: 580; }
.result-votes { font-variant-numeric: tabular-nums; font-weight: 680; font-size: 1.1em; }
.result-bar { height: .7rem; border-radius: var(--r-pill); background: var(--bg-sunken); overflow: hidden; }
.result-bar > span {
  display: block; height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent-500), var(--accent-400));
  width: calc(var(--w, 0) * 1%);
  transition: width 900ms var(--ease-out);
}
.result-row.abstain .result-name { color: var(--fg-muted); font-style: italic; }
.result-row.abstain .result-bar > span { background: var(--fg-subtle); }
.result-row.lead .result-name { color: var(--accent); }

/* ----------------------------------------------------------------------------
   Kontrol listesi
   -------------------------------------------------------------------------- */
.checklist { display: grid; gap: .7rem; list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: .7rem; align-items: flex-start; font-size: var(--fs-sm); }
.checklist svg { margin-top: .15rem; }
.checklist .ok   { color: var(--verify); }
.checklist .todo { color: var(--danger); }
.checklist .adv  { color: var(--warn); }

/* ----------------------------------------------------------------------------
   Dil seçici
   -------------------------------------------------------------------------- */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-sunken); border-radius: var(--r-pill); }
.lang-switch a {
  padding: .25rem .6rem; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; text-decoration: none; color: var(--fg-muted);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.lang-switch a:hover { color: var(--fg); }
.lang-switch a.is-on { background: var(--bg-raised); color: var(--fg); box-shadow: var(--shadow-sm); }

/* ----------------------------------------------------------------------------
   Sekme / bölüm listesi
   -------------------------------------------------------------------------- */
.link-list { display: grid; gap: .6rem; list-style: none; padding: 0; margin: 0; }
.link-tile {
  display: flex; align-items: center; gap: .9rem;
  padding: .95rem 1.1rem; border-radius: var(--r-md);
  background: var(--bg-raised); border: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: border-color var(--t-fast) var(--ease),
              translate var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease);
}
.link-tile:hover { color: inherit; border-color: var(--accent); translate: 0 -1px; box-shadow: var(--shadow-sm); }
.link-tile .tile-body { display: grid; gap: .1rem; min-width: 0; }
.link-tile .tile-title { font-weight: 570; }
.link-tile .tile-sub { font-size: var(--fs-xs); color: var(--fg-muted); }
.link-tile .tile-arrow { margin-inline-start: auto; color: var(--fg-subtle); transition: translate var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease); }
.link-tile:hover .tile-arrow { translate: 3px 0; color: var(--accent); }

/* Kontrol listesi ikon renkleri */
.checklist svg.ok  { color: var(--verify); }
.checklist svg.adv { color: var(--warn); }
.checklist svg.todo{ color: var(--danger); }
