/* ==========================================================================
   Hesapla — Tasarım Token'ları ve Ortak Stiller
   Bu dosya sitedeki tüm sayfalarda kullanılan temel tasarım sistemidir.
   Yeni bir hesaplama aracı eklerken bu değişkenleri ve sınıfları kullanın.
   ========================================================================== */

:root {
  /* Renk paleti — sınırlı ve amaca yönelik */
  --bg: #f5f6f2;               /* sayfa zemini */
  --surface: #ffffff;          /* kart / panel zemini */
  --surface-sunken: #eef0ea;   /* girdi kutuları, hafif çukur alanlar */
  --ink: #12161f;              /* birincil metin */
  --ink-muted: #5b6472;        /* ikincil metin */
  --ink-faint: #8b93a1;        /* yardımcı / placeholder metin */
  --line: #e2e5dd;             /* ince ayraç çizgileri */

  --primary: #0f4c3a;          /* marka rengi — koyu orman yeşili, güven */
  --primary-ink: #ffffff;      /* birincil buton üzeri metin */
  --primary-soft: #e6efe9;     /* birincil rengin açık zemin hali */

  --good: #0f4c3a;             /* Rahat durumu */
  --good-soft: #e6efe9;
  --mid: #a5680c;              /* Dengeli durumu */
  --mid-soft: #f7ecd9;
  --risk: #a3372a;             /* Zorlayıcı durumu */
  --risk-soft: #f6e6e3;

  /* Tipografi */
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  /* Ölçü / boşluk */
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --container: 1120px;
  --shadow-card: 0 1px 2px rgba(18, 22, 31, 0.04), 0 8px 24px -12px rgba(18, 22, 31, 0.12);
  --shadow-pop: 0 4px 8px rgba(18, 22, 31, 0.06), 0 16px 40px -16px rgba(18, 22, 31, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Sıfırlama ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Üst menü ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 246, 242, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.logo__mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--primary);
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.logo__mark svg { width: 16px; height: 16px; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav__link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.nav__link:hover { background: var(--surface-sunken); color: var(--ink); }
.nav__link--all {
  color: var(--primary);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 880px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-header.is-open .nav {
    display: flex;
    position: absolute;
    top: 68px;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
    gap: 2px;
  }
  .site-header.is-open .nav__link { padding: 12px 8px; border-radius: 8px; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 44px;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  max-width: 16ch;
  margin-bottom: 14px;
}
.hero__sub {
  color: var(--ink-muted);
  font-size: 1.02rem;
  max-width: 52ch;
  margin-bottom: 30px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 8px 8px 8px 20px;
  box-shadow: var(--shadow-card);
  max-width: 660px;
  transition: border-color 0.15s ease;
}
.search-box:focus-within { border-color: var(--primary); }
.search-box svg { width: 20px; height: 20px; color: var(--ink-faint); flex-shrink: 0; }
.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--ink);
  padding: 12px 0;
  min-width: 0;
}
.search-box input::placeholder { color: var(--ink-faint); }
.search-box button {
  border: 0;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}
.search-box button:hover { opacity: 0.88; }
.search-note {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--ink-muted);
  max-width: 660px;
  min-height: 1.4em;
}
.search-note[data-state="info"] { color: var(--primary); }

/* ---------- Reklam alanı ---------- */
.ad-slot {
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  color: var(--ink-faint);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  margin: 36px 0;
}

/* ---------- Bölüm başlıkları ---------- */
.section { padding: 40px 0; }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.section__head h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
}
.section__head p {
  color: var(--ink-muted);
  font-size: 0.94rem;
}

/* ---------- Kart ızgarası ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 880px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}
.tool-card--soon {
  cursor: default;
  opacity: 0.72;
}
.tool-card--soon:hover { border-color: var(--line); box-shadow: none; transform: none; }
.tool-card__icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
}
.tool-card__icon svg { width: 19px; height: 19px; }
.tool-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
}
.tool-card__desc {
  font-size: 0.87rem;
  color: var(--ink-muted);
}
.badge-soon {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface-sunken);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------- Neden Hesapla ---------- */
.feature-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 720px) { .feature-list { grid-template-columns: 1fr; } }
.feature-list__item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.feature-list__item p {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

/* ---------- Alt bilgi ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 40px;
  margin-top: 24px;
}
.site-footer__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.site-footer__links { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer__links a { text-decoration: none; color: var(--ink-muted); }
.site-footer__links a:hover { color: var(--ink); }

/* ==========================================================================
   Hesaplama aracı sayfaları — ortak yapı
   ========================================================================== */

.breadcrumb {
  font-size: 0.83rem;
  color: var(--ink-faint);
  padding: 18px 0 0;
}
.breadcrumb a { text-decoration: none; color: var(--ink-faint); }
.breadcrumb a:hover { color: var(--ink-muted); }
.breadcrumb__sep { margin: 0 6px; }
.breadcrumb__current { color: var(--ink-muted); }

.tool-hero { padding: 22px 0 8px; }
.tool-hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); max-width: 24ch; }
.tool-hero p { color: var(--ink-muted); margin-top: 10px; max-width: 60ch; font-size: 1rem; }

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0 60px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
}
@media (max-width: 560px) { .panel { padding: 20px 18px; border-radius: var(--radius-md); } }

.panel h2 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}
.panel__hint {
  color: var(--ink-muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

/* Form */
.field { margin-bottom: 18px; }
.field:last-of-type { margin-bottom: 0; }
.field__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.field__optional { font-weight: 400; color: var(--ink-faint); font-size: 0.8rem; }
.field__help {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-top: 6px;
}
.field__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.field__suffix {
  position: absolute;
  right: 14px;
  color: var(--ink-faint);
  font-size: 0.9rem;
  pointer-events: none;
}
.field input {
  width: 100%;
  border: 1.5px solid var(--line);
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  padding: 13px 44px 13px 14px;
  font-size: 1rem;
  font-family: var(--font-mono);
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.field input:hover { border-color: #c9cfc3; }
.field input:focus {
  outline: 0;
  border-color: var(--primary);
  background: var(--surface);
}
.field input[aria-invalid="true"] {
  border-color: var(--risk);
  background: var(--risk-soft);
}
.field__error {
  display: none;
  color: var(--risk);
  font-size: 0.82rem;
  margin-top: 6px;
  font-weight: 500;
}
.field.has-error .field__error { display: block; }
.field.has-error .field__help { display: none; }

.btn-primary {
  width: 100%;
  border: 0;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: 1.02rem;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-top: 6px;
  transition: opacity 0.15s ease, transform 0.05s ease;
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { transform: scale(0.99); }

.form-status {
  font-size: 0.85rem;
  color: var(--risk);
  margin-top: 12px;
  min-height: 1.2em;
}

/* Sonuç paneli */
.result {
  display: none;
}
.result.is-visible { display: block; }

.result__headline {
  text-align: center;
  padding: 6px 0 18px;
}
.result__headline .label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.result__range {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  font-weight: 600;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

/* Gösterge (signature element) */
.gauge { margin: 22px 0 10px; }
.gauge__track {
  position: relative;
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: visible;
  background: var(--surface-sunken);
}
.gauge__zone { height: 100%; }
.gauge__zone:first-child { border-radius: 999px 0 0 999px; }
.gauge__zone:last-child { border-radius: 0 999px 999px 0; }
.gauge__zone--good { background: var(--good); }
.gauge__zone--mid { background: var(--mid); }
.gauge__zone--risk { background: var(--risk); }
.gauge__marker {
  position: absolute;
  top: -7px;
  width: 2px;
  height: 28px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateX(-1px);
  transition: left 0.3s ease;
}
.gauge__marker::after {
  content: attr(data-label);
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  background: var(--surface);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.gauge__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--ink-faint);
  margin-top: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}
.status-pill--good { background: var(--good-soft); color: var(--good); }
.status-pill--mid { background: var(--mid-soft); color: var(--mid); }
.status-pill--risk { background: var(--risk-soft); color: var(--risk); }

/* Detay accordion / bilgi listesi */
.detail-list {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 18px;
}
.detail-list h3 {
  font-size: 0.98rem;
  margin-bottom: 12px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.92rem;
}
.detail-row:last-child { border-bottom: 0; }
.detail-row__label { color: var(--ink-muted); }
.detail-row__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.detail-row--total .detail-row__label,
.detail-row--total .detail-row__value { color: var(--primary); font-weight: 700; }

/* Senaryo tablosu */
.scenario-table {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.scenario-table h3 { font-size: 0.98rem; margin-bottom: 12px; }
.scenario-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.scenario-row__amount { font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Bilmen gerekenler */
.info-block {
  margin-top: 8px;
}
.info-block ul { margin: 0; padding-left: 18px; }
.info-block li { margin-bottom: 10px; color: var(--ink-muted); font-size: 0.92rem; }
.info-block li:last-child { margin-bottom: 0; }
.info-block li strong { color: var(--ink); font-weight: 600; }

@media (min-width: 960px) {
  .tool-layout {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
  }
  .tool-layout .panel--form { position: sticky; top: 88px; }
}
