/* ==========================================================================
   Paranın Bugünkü Değeri Widget — Tasarım Sistemi
   Referans: Örnek Tasarım UI HTML.html (Archivo + Figtree)
   ========================================================================== */

/* ---------- CSS Değişkenleri ---------- */
:root {
  --bg: #f7f7f6;
  --surface: #ffffff;
  --ink: #181a1f;
  --ink-2: #54565c;
  --muted: #8b8d94;
  --line: #e7e7e4;
  --line-soft: #f0f0ee;
  --brand: #d6001c;
  --brand-dark: #a80016;
  --brand-soft: #fdeef0;
  --blue: #2a78d6;
  --blue-soft: #edf4fc;
  --orange: #eb6834;
  --orange-soft: #fdf1ea;
  --good: #006300;
  --good-soft: #ecf5ec;
  --purple: #6c5ce7;
  --purple-soft: #f0eefb;
  --radius: 14px;
  --display: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--brand);
}

/* ---------- Header ---------- */
header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  max-width: 1080px;
  margin: 0 auto;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
}

.site-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 52px 0 34px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
}

h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.08;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.hero p.lede {
  margin-top: 14px;
  font-size: 17px;
  color: var(--ink-2);
}

/* How details */
details.how {
  margin-top: 16px;
  max-width: 62ch;
}

details.how summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand);
  font-size: 14.5px;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

details.how summary::-webkit-details-marker {
  display: none;
}

details.how summary::after {
  content: "▾";
  transition: transform .15s;
}

details.how[open] summary::after {
  transform: rotate(180deg);
}

details.how .how-body {
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--ink-2);
  border-left: 3px solid var(--line);
  padding-left: 14px;
  display: grid;
  gap: 10px;
}

/* ---------- Calculator Layout ---------- */
.calc-section {
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.card h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.01em;
  margin-bottom: 18px;
}

/* ---------- Form Fields ---------- */
.fields {
  display: grid;
  gap: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.field label small {
  font-weight: 500;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  font: inherit;
  font-variant-numeric: tabular-nums;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  transition: border-color .15s, outline-color .15s;
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}

.field .hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* 3 Sütunlu Parametreler Grid'i (En solda Genel Parametreler, Ortada İskonto, Sağda Tutar) */
.params-3col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 860px) {
  .params-3col-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.params-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.params-col-fields {
  display: grid;
  gap: 8px;
}

.params-col-fields .field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 4px;
  display: block;
}

.params-col-fields .field input,
.params-col-fields .field select {
  padding: 7.5px 10px;
  font-size: 13.5px;
  border-radius: 8px;
}

/* Yıl bazlı iskonto/tutar tablosu */
.year-grid {
  display: grid;
  gap: 8px;
}

.year-grid .year-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  align-items: center;
}

.year-grid .year-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--line-soft);
  border-radius: 7px;
  padding: 8px 6px;
  text-align: center;
}

.year-grid input {
  font: inherit;
  font-variant-numeric: tabular-nums;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: border-color .15s, outline-color .15s;
}

.year-grid input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}

/* Section divider in form */
.form-divider {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: 4px 0;
}

.form-section-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.005em;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-label small {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
}

.form-section-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  display: inline-block;
}

/* ---------- Result Panel (Alt Kısım) ---------- */
.results-section {
  margin-bottom: 24px;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 820px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
}

.punch {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: var(--radius);
  padding: 26px 28px;
}

.punch .k {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.punch .line {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(20px, 2.6vw, 27px);
  line-height: 1.3;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.punch .line b {
  color: var(--blue);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  font-size: 13px;
  font-weight: 600;
  background: var(--line-soft);
  border-radius: 99px;
  padding: 5px 12px;
  color: var(--ink-2);
}

.chip b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Verdict */
.verdict {
  background: var(--blue-soft);
  border: 1px solid #c4daf0;
  border-radius: var(--radius);
  padding: 22px 26px;
}

.verdict .head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.verdict .head .txt {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.01em;
}

.verdict .head .txt b {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  background: #fff;
  border: 1px solid #c4daf0;
  border-radius: 99px;
  padding: 3px 11px;
  font-variant-numeric: tabular-nums;
}

.verdict .sub {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 4px;
}

/* Bar comparison */
.bars {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.bar-row .bar-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
  margin-bottom: 5px;
}

.bar-row .bar-top .name {
  font-weight: 600;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.bar-row .bar-top .val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.track {
  height: 14px;
  background: transparent;
}

.fillbar {
  height: 14px;
  border-radius: 0 4px 4px 0;
  min-width: 4px;
  transition: width .5s ease;
}

.fill-blue {
  background: var(--blue);
}

.fill-purple {
  background: var(--purple);
}

.fill-orange {
  background: var(--orange);
}

/* ---------- Section scaffolding ---------- */
section {
  margin-top: 26px;
}

.sec-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.015em;
}

.sec-sub {
  font-size: 14px;
  color: var(--ink-2);
  margin-top: 3px;
}

/* ---------- Chart ---------- */
.chart-card {
  position: relative;
}

.legend {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--ink-2);
  margin: 14px 0 6px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}

.chart-wrap {
  position: relative;
  overflow-x: auto;
}

svg text {
  font-family: var(--body);
}

.tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  border-radius: 8px;
  padding: 8px 11px;
  line-height: 1.5;
  opacity: 0;
  transition: opacity .1s;
  white-space: nowrap;
  z-index: 5;
}

.tooltip .tt-k {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tooltip b {
  font-variant-numeric: tabular-nums;
}

/* ---------- Info cards (Sonuçları Nasıl Okumalı) ---------- */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

@media (max-width: 700px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
}

.info-card {
  padding: 20px 22px;
}

.info-card h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}

.info-card ul {
  list-style: none;
  display: grid;
  gap: 12px;
  font-size: 14.5px;
}

.info-card li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.info-card li .ic {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  margin-top: 2px;
}

.ic-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.ic-purple {
  background: var(--purple-soft);
  color: var(--purple);
}

.info-card li .term {
  font-weight: 700;
  color: var(--ink);
  display: block;
}

.info-card li .desc {
  color: var(--ink-2);
  font-size: 13.5px;
  display: block;
  margin-top: 2px;
}

/* ---------- Detail table ---------- */
details.detail-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

details.detail-panel summary {
  cursor: pointer;
  padding: 18px 24px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

details.detail-panel summary::-webkit-details-marker {
  display: none;
}

details.detail-panel summary .hint {
  font-family: var(--body);
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
}

details.detail-panel summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--muted);
}

details.detail-panel[open] summary::after {
  transform: rotate(180deg);
}

.detail-body {
  padding: 0 24px 22px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead th {
  background: var(--line-soft);
  font-weight: 600;
  color: var(--ink-2);
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  letter-spacing: .02em;
  position: sticky;
  top: 0;
  border-bottom: 2px solid var(--line);
}

.data-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}

.data-table tbody tr:hover {
  background: #fafaf9;
}

.data-table tbody tr:nth-child(even) {
  background: #fcfcfb;
}

.data-table tbody tr:nth-child(even):hover {
  background: #f6f6f4;
}

.data-table .num {
  text-align: right;
}

.data-table .year-change {
  border-top: 2px solid var(--line);
}

.table-wrap {
  max-height: 500px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
}

/* ---------- Summary box ---------- */
.summary-box {
  background: var(--blue-soft);
  border: 1px solid #c4daf0;
  border-radius: 10px;
  padding: 18px 22px;
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.6;
  margin-top: 16px;
}

.summary-box p {
  margin-bottom: 6px;
}

.summary-box p:last-child {
  margin-bottom: 0;
  color: var(--ink-2);
}

/* ---------- CTA ---------- */
.cta {
  background: var(--brand);
  border-radius: var(--radius);
  color: #fff;
  padding: 34px 36px;
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.cta .cta-txt {
  flex: 1 1 340px;
}

.cta h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.cta p {
  margin-top: 6px;
  font-size: 14.5px;
  opacity: .92;
  max-width: 52ch;
}

.cta .btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  border-radius: 10px;
  padding: 13px 22px;
  cursor: pointer;
  border: 0;
  transition: background .15s, border-color .15s;
}

.btn-primary {
  background: #fff;
  color: var(--brand);
}

.btn-primary:hover {
  background: #ffe9ec;
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .65);
}

.btn-ghost:hover {
  border-color: #fff;
}

.btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ---------- Footer / Assumptions ---------- */
.assump {
  margin: 26px 0 46px;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 78ch;
}

.assump b {
  color: var(--ink-2);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}