:root {
  --brand: #173DED;
  --brand-dark: #0F2BB0;
  --brand-light: #EEF1FF;
  --ink: #0F172A;
  --ink-2: #64748B;
  --ink-3: #94A0B3;
  --line: #E5E7EB;
  --line-soft: #EEF0F3;
  --surface: #FFFFFF;
  --page-bg: #F6F7FB;
  --success: #16A34A;
  --success-bg: #ECFDF3;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  font-family: 'Inter', -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, .brand-num, .hero-amount { font-family: 'Manrope', 'Inter', sans-serif; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-logo {
  height: 26px;
  width: auto;
  display: block;
}
.topbar-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
}
.topbar-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.topbar-secure svg { color: var(--success); flex-shrink: 0; }

/* ---------- Hero: canlı tutar göstergesi ---------- */
.amount-hero {
  max-width: 620px;
  margin: 40px auto 8px;
  padding: 0 16px;
  text-align: center;
}
.amount-hero .eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.hero-amount {
  font-size: 44px;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hero-amount sup { font-size: 20px; font-weight: 700; margin-left: 2px; }

/* ---------- Page / layout ---------- */
.page {
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 16px 72px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.brand-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-head h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
}

.panel-body { padding: 20px 22px 22px; }

.grid-2, .grid-3 {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-2:last-child, .grid-3:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 7px;
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}

.field input::placeholder { color: var(--ink-3); }

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-light);
}

.hint {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0 0 16px;
}

/* ---------- Taksit kartları ---------- */
.installment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.bank-col {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow .15s, border-color .15s;
}

.bank-col.matched {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-light);
}

.bank-col-head {
  padding: 14px 16px;
  font-weight: 700;
  font-size: 15px;
  background: var(--page-bg);
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}

.bank-col-head small {
  display: block;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.bank-col-body { padding: 4px 16px 12px; }

.install-row {
  display: block;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}
.install-row:last-child { border-bottom: none; }

.install-row input {
  margin-right: 9px;
  accent-color: var(--brand);
  width: 15px;
  height: 15px;
  vertical-align: middle;
}

.install-row .total {
  display: block;
  margin-left: 24px;
  margin-top: 3px;
  font-weight: 700;
  color: var(--ink);
  font-size: 14px;
}

.bank-col-empty {
  padding: 20px 16px;
  color: var(--ink-3);
  font-size: 13px;
}

/* ---------- Submit ---------- */
.submit-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 4px;
}

.form-message {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--danger);
}
.form-message.ok { color: var(--success); }

.btn-pay {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 14px 30px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(23, 61, 237, 0.55);
  transition: background .15s, transform .1s;
}
.btn-pay:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-pay:hover:not(:disabled) { background: var(--brand-dark); }
.btn-pay:active:not(:disabled) { transform: scale(0.98); }

/* ---------- 3DS overlay ---------- */
.threeds-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.threeds-overlay[hidden] { display: none; }

.threeds-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  width: min(480px, 92vw);
  max-height: 86vh;
  overflow: auto;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.threeds-box p { color: var(--ink-2); font-size: 14px; margin-top: 0; }

/* ---------- Sonuç sayfası ---------- */
.result-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page-bg);
  font-family: 'Inter', sans-serif;
}
.result-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: min(420px, 92vw);
  text-align: center;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.result-card h1 {
  font-family: 'Manrope', sans-serif;
  font-size: 22px;
  font-weight: 700;
}
.result-icon {
  width: 60px; height: 60px;
  line-height: 60px;
  border-radius: 50%;
  font-size: 26px;
  margin: 0 auto 18px;
  color: #fff;
}
.result-card.ok .result-icon { background: var(--success); }
.result-card.fail .result-icon { background: var(--danger); }
.result-table { width: 100%; margin: 22px 0; border-collapse: collapse; }
.result-table td { padding: 10px 4px; border-bottom: 1px solid var(--line-soft); font-size: 14px; text-align: left; color: var(--ink-2); }
.result-table td:last-child { text-align: right; font-weight: 700; color: var(--ink); }
.btn-back {
  display: inline-block;
  margin-top: 8px;
  padding: 12px 26px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-amount { font-size: 34px; }
  .panel-body { padding: 18px; }
}