/* VERA bağış — Çeşme Kitabesi
   Kireç taşı zemin, kitabe levhası, kömür lento, kiremit eylem, su mavisi odak. */

:root {
  color-scheme: light;

  --stone: #e9e5dd;          /* zemin: kireç taşı */
  --slab: #f4f1ea;           /* kitabe levhası */
  --field: #fbfaf7;          /* giriş alanı */
  --joint: #cfc9bd;          /* taş derzi */
  --joint-soft: #ddd8ce;
  --ink: #212322;            /* kömür: metin, lento */
  --ink-2: #5f625e;          /* ikincil metin (4.9:1 zemin üstünde) */
  --ink-3: #6b6e69;          /* placeholder (5:1 alan üstünde) */
  --olive: #899064;          /* rozet, süs */
  --water: #a6bbc8;          /* su çizgisi, odak halkası */
  --water-deep: #4f6b7c;
  --clay: #c66e4e;           /* marka kiremidi: yazısız vurgu */
  --clay-action: #a9553a;    /* buton zemini (beyazla 5.2:1) */
  --clay-press: #96492f;
  --error: #9f4a2f;
  --ok: #556b3e;

  --font-ui: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--joint) var(--stone);
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--stone);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-ui);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--water); color: var(--ink); }

input, button, select, textarea { font: inherit; color: inherit; caret-color: var(--clay); }

a { color: var(--ink); text-decoration-color: var(--water-deep); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--water); outline-offset: 2px; }

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

/* ---------- çerçeve ---------- */

.test-band {
  background: var(--ink);
  color: var(--slab);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 6px var(--space-4);
}

.masthead {
  display: flex;
  justify-content: center;
  padding: var(--space-6) var(--space-4) var(--space-5);
}
.masthead a { display: block; line-height: 0; }
.masthead img { width: 64px; height: auto; }

.page {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-7);
  flex: 1;
}

.page-wide { max-width: 1180px; }

.colophon {
  max-width: 460px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-6);
  font-size: 13px;
  color: var(--ink-2);
  text-align: center;
}
.colophon p { margin: 0 0 var(--space-1); }

/* ---------- kitabe ---------- */

.kitabe {
  position: relative;
  background: var(--slab);
  border-top: 6px solid var(--ink);
  /* dış derz + levhaya oyulmuş iç çerçeve (10px içeride kıl çizgisi) */
  box-shadow:
    inset 0 0 0 1px var(--joint-soft),
    inset 0 0 0 10px var(--slab),
    inset 0 0 0 11px var(--joint);
  padding: var(--space-7) var(--space-6) var(--space-6);
  text-align: center;
}

/* köşe rozetleri: içi dolu eşkenar dörtgen */
.kitabe::before,
.kitabe::after {
  content: "";
  position: absolute;
  top: 20px;
  width: 13px;
  height: 13px;
  padding: 3px;
  border: 1px solid var(--olive);
  background: var(--olive);
  background-clip: content-box;
  transform: rotate(45deg);
}
.kitabe::before { left: 22px; }
.kitabe::after { right: 22px; }

.kitabe-amount {
  display: block;
  margin: 0 0 var(--space-5);
  min-height: 56px;
  font: 600 48px/1.15 var(--font-ui);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  color: var(--ink);
}
.kitabe-amount.amt-m { font-size: 40px; line-height: 56px; }
.kitabe-amount.amt-s { font-size: 34px; line-height: 56px; }

/* Schibsted'in ₺ glifi £'e benzediği için büyük tutarda çizilmiş ₺ kullanılır (büyük harf yüksekliğinde) */
.lira {
  display: inline-block;
  width: 0.46em;
  height: 0.7em;
  margin-left: 0.2em;
  vertical-align: baseline;
  overflow: visible;
}

/* boş yuva: oyulmayı bekleyen tutar yeri */
.blank {
  display: inline-block;
  width: 2.6em;
  height: 0.7em;
  border-bottom: 1px solid var(--ink-3);
  vertical-align: baseline;
}
.kitabe-amount.is-empty { color: var(--ink-3); }
.kitabe-amount.is-carved { animation: carve 520ms var(--ease-out); }

@keyframes carve {
  from { letter-spacing: 0.12em; opacity: 0.15; filter: blur(3px); }
  to { letter-spacing: -0.02em; opacity: 1; filter: blur(0); }
}

/* su çizgisi: levhanın altındaki ince su */
.waterline {
  height: 3px;
  background: var(--water);
  margin: 0 var(--space-3);
}

/* ---------- tutar seçimi ---------- */

.amounts {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.chip { position: relative; display: block; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border: 1px solid var(--joint);
  background: var(--field);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.chip input:hover + span { border-color: var(--ink); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--slab); }
.chip input:focus-visible + span { outline: 3px solid var(--water); outline-offset: 2px; }

.other-amount { grid-column: span 3; }
.other-amount .control { position: relative; }
.other-amount .suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-2);
  pointer-events: none;
}
.other-amount input { padding-right: 36px; text-align: left; }

/* ---------- form ---------- */

.donate { display: block; }

.group {
  border: 0;
  margin: var(--space-6) 0 0;
  padding: 0;
}
.group > legend {
  float: left;
  width: 100%;
  margin: 0 0 var(--space-3);
  padding: 0 0 var(--space-2);
  border-bottom: 1px solid var(--joint);
  font: 600 18px/1.3 var(--font-ui);
  color: var(--ink);
}
.group > legend + * { clear: both; }

.field { margin-bottom: var(--space-4); }
.field:last-child { margin-bottom: 0; }
.field > label,
.field > .label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field .hint { font-weight: 400; color: var(--ink-2); font-size: 13px; }

.input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--joint);
  border-radius: 0;
  background: var(--field);
  font-size: 17px; /* iOS yakınlaştırmasını önler */
  font-variant-numeric: tabular-nums;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.45; resize: vertical; }
.input::placeholder { color: var(--ink-3); opacity: 1; }
.input:hover { border-color: #b5ae9f; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--water); }
.input[aria-invalid="true"] { border-color: var(--error); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px #e7c3b5; }

.select {
  padding-right: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23212322' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.installment-note { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.installment-note:empty { display: none; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }

.card-number { position: relative; }
.card-number .input { padding-right: 104px; letter-spacing: 0.04em; }
.brand {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  pointer-events: none;
}

.field-error {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--error);
}
.field-error:empty { display: none; }

.notice {
  margin: var(--space-5) 0 0;
  padding: var(--space-3) var(--space-4);
  background: var(--slab);
  border-top: 3px solid var(--error);
  font-size: 14px;
}
.notice ul { margin: 0; padding-left: 18px; }
.notice li + li { margin-top: 2px; }

.consent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: var(--space-3);
  align-items: start;
  margin: var(--space-5) 0 0;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
}
.consent input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--ink);
  cursor: pointer;
}

/* ---------- eylem ---------- */

.action { margin-top: var(--space-6); }

.pay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 58px;
  padding: 0 var(--space-5);
  border: 0;
  border-radius: 0;
  background: var(--clay-action);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.pay:hover { background: var(--clay-press); }
.pay:active { transform: translateY(1px); }
.pay[disabled] { background: var(--clay-press); cursor: progress; } /* yönlendirilirken metin okunur kalsın (6.4:1) */
.pay .num { font-variant-numeric: tabular-nums; }

.assurance {
  margin: var(--space-3) auto 0;
  max-width: 34ch;
  font-size: 13px;
  color: var(--ink-2);
  text-align: center;
  text-wrap: balance;
}
.assurance svg { display: inline-block; vertical-align: -2px; margin-right: 4px; }

.btn-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-5);
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.btn-quiet:hover { background: var(--ink); color: var(--slab); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 var(--space-5);
  background: var(--clay-action);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.btn-primary:hover { background: var(--clay-press); }

/* ---------- sonuç ---------- */

.inscription { padding: var(--space-7) var(--space-5) var(--space-6); }
.inscription .donor {
  margin: 0 0 var(--space-3);
  font: 600 clamp(30px, 9vw, 44px)/1.15 var(--font-ui);
  letter-spacing: -0.02em;
  text-wrap: balance;
  animation: carve 700ms var(--ease-out) 120ms both;
}
.inscription .gift {
  margin: 0 auto;
  max-width: 30ch;
  font-size: 16px;
  color: var(--ink);
  text-wrap: balance;
}
.inscription .gift strong { font-variant-numeric: tabular-nums; }
.inscription .dates {
  margin: var(--space-5) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--joint);
  font: 400 14px/1.5 var(--font-ui);
  color: var(--ink-2);
}

.kitabe.is-pending { border-top-color: var(--water-deep); }
.kitabe.is-failed { border-top-color: var(--error); }

.state-title {
  margin: var(--space-3) 0 var(--space-3);
  font: 600 24px/1.25 var(--font-ui);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.state-text { margin: 0 auto; max-width: 32ch; color: var(--ink-2); text-wrap: pretty; }
.state-note { margin-top: var(--space-3); }

.ledger {
  margin: var(--space-5) 0 0;
  border-top: 1px solid var(--joint);
}
.ledger div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--joint);
  font-size: 14px;
}
.ledger dt { color: var(--ink-2); }
.ledger dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; word-break: break-all; }

.after { display: flex; justify-content: center; margin-top: var(--space-6); }

/* ---------- bankaya yönlendirme ---------- */

.flow {
  height: 3px;
  margin: 0 var(--space-3);
  background: linear-gradient(90deg, var(--water) 0 35%, var(--water-deep) 35% 50%, var(--water) 50%) 0 0 / 200% 100%;
  animation: flow 1.4s linear infinite;
}
@keyframes flow { to { background-position: -200% 0; } }

/* ---------- yönetim paneli ---------- */

.panel {
  background: var(--slab);
  border-top: 6px solid var(--ink);
  padding: var(--space-5);
}
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3); }
.panel-head h1 { margin: 0; font: 600 24px/1.2 var(--font-ui); letter-spacing: -0.01em; }
.panel .summary { color: var(--ink-2); margin: var(--space-2) 0 0; }
.panel .summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.flash { margin: var(--space-4) 0 0; padding: var(--space-3) var(--space-4); background: var(--field); border-top: 3px solid var(--water-deep); font-size: 14px; }

.filters, .pager { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-4) 0; }
.filters a, .pager a {
  padding: 6px 12px;
  border: 1px solid var(--joint);
  background: var(--field);
  font-size: 13px;
  text-decoration: none;
  color: var(--ink);
}
.filters a.active, .pager a.active { background: var(--ink); border-color: var(--ink); color: var(--slab); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--joint); vertical-align: top; }
th { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
td small { color: var(--ink-2); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
code { font-size: 13px; }

.actions form { display: inline-flex; gap: 4px; margin: 0 4px 4px 0; }
.mini {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.mini:hover { background: var(--ink); color: var(--slab); }
a.mini { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }

.badge { display: inline-block; padding: 2px 8px; font-size: 12px; font-weight: 600; background: var(--field); border: 1px solid var(--joint); }
.badge.paid { color: var(--ok); border-color: #b7c0a0; }
.badge.failed, .badge.reversed { color: var(--error); border-color: #dcb8aa; }
.badge.unknown, .badge.processing { color: var(--water-deep); border-color: var(--water); }

/* ---------- geniş ekran ---------- */

@media (min-width: 720px) {
  .masthead { padding-top: var(--space-7); }
  .masthead img { width: 76px; }
  .kitabe { padding-left: var(--space-6); padding-right: var(--space-6); }
}

@media (prefers-reduced-motion: reduce) {
  .kitabe-amount.is-carved, .flow, .inscription .donor { animation: none; }
  .chip span, .input, .pay { transition: none; }
}
.date { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- metin sayfası ---------- */

.prose { max-width: 62ch; margin: 0 auto; }
.prose h1 { font: 600 26px/1.25 var(--font-ui); letter-spacing: -0.01em; margin: 0 0 var(--space-4); text-wrap: balance; }
.prose h2 { font: 600 18px/1.3 var(--font-ui); margin: var(--space-6) 0 var(--space-2); }
.prose p { margin: 0 0 var(--space-3); color: var(--ink); }
.prose .placeholder { padding: var(--space-2) var(--space-3); background: var(--slab); border-top: 3px solid var(--water-deep); color: var(--error); font-size: 14px; }
.prose .back { margin-top: var(--space-6); }
.prose .draft-mark { margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4); background: var(--slab); border-top: 3px solid var(--water-deep); font-size: 14px; color: var(--ink); }
.prose.is-draft h1, .prose.is-draft h2, .prose.is-draft p:not(.draft-mark):not(.back) { color: var(--ink-2); }
