/* ============================================================
   hesabiniyap.com — Design Tokens & Component Library
   Güven Mavisi primary · Manrope + Inter · tabular-nums
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  /* Primary — Güven Mavisi */
  --primary-50:  #EFF6FF;
  --primary-100: #DBEAFE;
  --primary-200: #BFDBFE;
  --primary-300: #93C5FD;
  --primary-400: #60A5FA;
  --primary-500: #2563EB;   /* ana CTA */
  --primary-600: #1D4ED8;   /* hover */
  --primary-700: #1E40AF;   /* active */
  --primary-900: #1E3A8A;   /* koyu vurgu */

  /* Live-tweakable aliases (Tweaks panel writes here) */
  --primary:        var(--primary-500);
  --primary-hover:  var(--primary-600);
  --primary-active: var(--primary-700);
  --primary-tint:   var(--primary-50);
  --primary-tint-2: var(--primary-100);
  --cta-glow: 37, 99, 235;   /* rgb for colored shadow */

  /* Neutral / Gray */
  --gray-50:  #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* Semantic */
  --success: #10B981; --success-bg: #ECFDF5; --success-border: #A7F3D0; --success-text: #065F46;
  --warning: #F59E0B; --warning-bg: #FFFBEB; --warning-border: #FDE68A; --warning-text: #92400E;
  --danger:  #EF4444; --danger-bg:  #FEF2F2; --danger-border:  #FECACA; --danger-text:  #991B1B;
  --info:    #06B6D4; --info-bg:    #ECFEFF; --info-border:    #A5F3FC; --info-text:    #155E75;

  /* Surfaces */
  --bg:        var(--gray-50);
  --surface:   #FFFFFF;
  --surface-2: var(--gray-100);
  --border:    var(--gray-200);
  --text:      var(--gray-800);
  --text-soft: var(--gray-600);
  --text-mute: var(--gray-400);
  --heading:   var(--gray-900);

  /* Typography */
  --font-head: 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-num:  'Inter', system-ui, sans-serif;

  /* Spacing (4px base) */
  --sp-0_5: 2px; --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-6: 24px;  --sp-8: 32px; --sp-12: 48px; --sp-16: 64px; --sp-24: 96px;

  /* Radius */
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 9999px;
  --radius: var(--r-lg);   /* tweakable default */

  /* Shadows */
  --sh-xs: 0 1px 2px rgba(0,0,0,.04);
  --sh-sm: 0 1px 3px rgba(0,0,0,.06);
  --sh-md: 0 4px 12px rgba(0,0,0,.08);
  --sh-lg: 0 10px 24px rgba(0,0,0,.10);
  --sh-xl: 0 20px 40px rgba(0,0,0,.12);
  --sh-cta: 0 8px 20px rgba(var(--cta-glow), .25);

  /* Motion */
  --t-micro: 150ms cubic-bezier(.2,.6,.3,1);
  --t-std:   250ms cubic-bezier(.4,0,.2,1);
}

/* ---------- 2. BASE ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv01","cv03","ss01";
}
.tnum { font-variant-numeric: tabular-nums; font-family: var(--font-num); }

/* ---------- 3. TYPE SCALE ---------- */
.t-display { font-family: var(--font-head); font-weight: 800; font-size: 52px; line-height: 1.08; letter-spacing: -.02em; color: var(--heading); margin: 0; }
.t-h1 { font-family: var(--font-head); font-weight: 700; font-size: 36px; line-height: 1.2;  letter-spacing: -.015em; color: var(--heading); margin: 0; }
.t-h2 { font-family: var(--font-head); font-weight: 700; font-size: 28px; line-height: 1.25; letter-spacing: -.01em;  color: var(--heading); margin: 0; }
.t-h3 { font-family: var(--font-head); font-weight: 700; font-size: 22px; line-height: 1.3;  color: var(--heading); margin: 0; }
.t-h4 { font-family: var(--font-head); font-weight: 600; font-size: 18px; line-height: 1.4;  color: var(--heading); margin: 0; }
.t-body-l { font-size: 18px; line-height: 1.6; }
.t-body   { font-size: 16px; line-height: 1.6; }
.t-body-s { font-size: 14px; line-height: 1.5; }
.t-caption{ font-size: 12px; line-height: 1.4; color: var(--text-mute); }
.t-overline { font-size: 12px; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--text-soft); }
@media (max-width: 768px) {
  .t-display { font-size: 38px; }
  .t-h1 { font-size: 28px; }
}

/* ---------- 4. BUTTONS ---------- */
.btn {
  --btn-h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: var(--btn-h); padding: 0 var(--sp-6);
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background var(--t-micro), border-color var(--t-micro), box-shadow var(--t-micro), transform var(--t-micro);
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn .lucide { width: 18px; height: 18px; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--sh-sm); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--sh-cta); }
.btn-primary:active { background: var(--primary-active); }

.btn-secondary { background: var(--surface); color: var(--primary); border-color: var(--primary-200); }
.btn-secondary:hover { background: var(--primary-tint); border-color: var(--primary-300); }

.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }

.btn-lg { --btn-h: 54px; font-size: 17px; padding: 0 var(--sp-8); border-radius: var(--radius); }
.btn-sm { --btn-h: 36px; font-size: 14px; padding: 0 var(--sp-4); }
.btn-block { width: 100%; }
.btn-icon { width: var(--btn-h); padding: 0; }

/* ---------- 5. FORM FIELDS ---------- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field-label { display: flex; align-items: center; gap: var(--sp-1); font-size: 14px; font-weight: 600; color: var(--gray-700); }
.field-label .req { color: var(--danger); }
.field-hint { font-size: 13px; color: var(--text-mute); }
.field-error { font-size: 13px; color: var(--danger-text); display: flex; align-items: center; gap: 6px; }

.input {
  width: 100%; height: 48px; padding: 0 var(--sp-4);
  font-family: var(--font-body); font-size: 16px; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  transition: border-color var(--t-micro), box-shadow var(--t-micro);
}
.input::placeholder { color: var(--text-mute); }
.input:hover { border-color: var(--gray-300); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--cta-glow), .18); }
.input.is-error { border-color: var(--danger); }
.input.is-error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.18); }

/* affix inputs (currency / percent) */
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix .input { padding-left: 40px; }
.input-affix.suffix .input { padding-left: var(--sp-4); padding-right: 44px; }
.input-affix .affix {
  position: absolute; display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: var(--text-soft); pointer-events: none; font-variant-numeric: tabular-nums;
}
.input-affix .affix.pre { left: 0; width: 40px; border-right: 1px solid var(--border); height: 26px; }
.input-affix.suffix .affix { right: var(--sp-4); }
.input.tnum { font-variant-numeric: tabular-nums; }

/* select */
.select { position: relative; }
.select select {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 48px; padding: 0 40px 0 var(--sp-4);
  font-family: var(--font-body); font-size: 16px; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color var(--t-micro), box-shadow var(--t-micro);
}
.select select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--cta-glow), .18); }
.select::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--gray-500); border-bottom: 2px solid var(--gray-500);
  transform: translateY(-65%) rotate(45deg); pointer-events: none;
}

/* radio group (segmented + list) */
.radio-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.radio {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--border); border-radius: var(--radius); cursor: pointer;
  transition: border-color var(--t-micro), background var(--t-micro);
}
.radio:hover { border-color: var(--primary-300); }
.radio input { accent-color: var(--primary); width: 18px; height: 18px; }
.radio.is-checked { border-color: var(--primary); background: var(--primary-tint); }
.radio .radio-title { font-weight: 600; font-size: 15px; }

/* tab switcher */
.tabs {
  display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2);
  border-radius: var(--radius); border: 1px solid var(--border);
}
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--text-soft);
  padding: 9px 18px; border-radius: calc(var(--radius) - 3px); transition: all var(--t-micro);
}
.tab.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--sh-sm); }

/* slider */
.slider { width: 100%; -webkit-appearance: none; appearance: none; height: 6px; border-radius: var(--r-full); background: var(--gray-200); outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); border: 3px solid #fff; box-shadow: var(--sh-md); cursor: pointer; }
.slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); border: 3px solid #fff; box-shadow: var(--sh-md); cursor: pointer; }

/* checkbox */
.check { display: flex; align-items: center; gap: var(--sp-2); font-size: 15px; cursor: pointer; }
.check input { accent-color: var(--primary); width: 18px; height: 18px; }

/* ---------- 6. CARDS ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-md); padding: var(--sp-6); }
.calc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-lg); padding: var(--sp-8); }

/* ---------- 7. RESULT ---------- */
.result-card {
  background: linear-gradient(160deg, var(--primary-900), var(--primary-700));
  color: #fff; border-radius: var(--r-xl); padding: var(--sp-8); box-shadow: var(--sh-lg);
}
.result-label { font-size: 14px; font-weight: 600; opacity: .8; letter-spacing: .01em; }
.result-number { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 800; font-size: 52px; line-height: 1.05; letter-spacing: -.02em; margin: 6px 0; }
.result-sub { font-size: 14px; opacity: .85; }

.breakdown { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.breakdown th { text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); font-weight: 700; padding: 0 0 var(--sp-3); }
.breakdown td { padding: var(--sp-3) 0; border-top: 1px solid var(--border); font-size: 15px; }
.breakdown td:last-child { text-align: right; font-weight: 600; }
.breakdown tr.is-deduct td:last-child { color: var(--danger-text); }
.breakdown tr.is-total td { border-top: 2px solid var(--gray-300); font-weight: 800; font-size: 17px; color: var(--heading); padding-top: var(--sp-4); }

/* ---------- 8. BADGES & TRUST ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 600; }
.badge .lucide { width: 13px; height: 13px; }
.badge-primary { background: var(--primary-tint); color: var(--primary-700); }
.badge-gray { background: var(--surface-2); color: var(--text-soft); }
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); }

.trust-strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-6); }
.trust-item { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.trust-item .lucide { width: 16px; height: 16px; color: var(--success); }
.source-cite { font-size: 12px; color: var(--text-mute); }
.source-cite b { color: var(--text-soft); font-weight: 600; }

/* ---------- 9. CALLOUTS ---------- */
.callout { display: flex; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--radius); border: 1px solid; font-size: 14.5px; line-height: 1.55; }
.callout .lucide { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.callout strong { display: block; margin-bottom: 2px; }
.callout.info    { background: var(--info-bg);    border-color: var(--info-border);    color: var(--info-text); }
.callout.success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.callout.warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
.callout.danger  { background: var(--danger-bg);  border-color: var(--danger-border);  color: var(--danger-text); }
.callout.info .lucide { color: var(--info); }
.callout.success .lucide { color: var(--success); }
.callout.warning .lucide { color: var(--warning); }
.callout.danger .lucide { color: var(--danger); }

/* ---------- 10. FORMULA BOX ---------- */
.formula {
  background: var(--gray-900); color: #E5E7EB; border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-6); font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px; line-height: 1.7; overflow-x: auto;
}
.formula .fx-op { color: #93C5FD; }
.formula .fx-var { color: #FCD34D; }
.formula .fx-comment { color: var(--gray-500); }

/* ---------- 11. FAQ ACCORDION ---------- */
.faq { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: 0; }
.faq summary { list-style: none; cursor: pointer; padding: var(--sp-4) var(--sp-6); font-weight: 600; font-size: 16px; color: var(--heading); display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { width: 20px; height: 20px; color: var(--text-mute); transition: transform var(--t-std); flex-shrink: 0; }
.faq details[open] summary .chev { transform: rotate(180deg); color: var(--primary); }
.faq .faq-body { padding: 0 var(--sp-6) var(--sp-4); color: var(--text-soft); font-size: 15px; line-height: 1.65; }

/* ---------- 12. BREADCRUMB ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--text-mute); }
.breadcrumb a { color: var(--text-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--gray-300); }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* ---------- 13. TOOLTIP ---------- */
.tip { position: relative; display: inline-flex; }
.tip .tip-trigger { width: 16px; height: 16px; color: var(--text-mute); cursor: help; }
.tip .tip-bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
  background: var(--gray-900); color: #fff; font-size: 12.5px; line-height: 1.45; font-weight: 500;
  padding: 8px 10px; border-radius: var(--r-md); width: max-content; max-width: 220px;
  opacity: 0; pointer-events: none; transition: opacity var(--t-micro), transform var(--t-micro); z-index: 20;
}
.tip .tip-bubble::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--gray-900); }
.tip:hover .tip-bubble { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 14. TOAST ---------- */
.toast { display: inline-flex; align-items: center; gap: var(--sp-2); background: var(--gray-900); color: #fff; padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--sh-lg); font-size: 14px; font-weight: 500; }
.toast .lucide { width: 18px; height: 18px; }
.toast.ok .lucide { color: #6EE7B7; }

/* ---------- 15. AD SLOTS ---------- */
.ad-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: repeating-linear-gradient(135deg, var(--gray-50), var(--gray-50) 12px, var(--gray-100) 12px, var(--gray-100) 24px);
  border: 1px dashed var(--gray-300); border-radius: var(--r-md); color: var(--text-mute);
}
.ad-slot .ad-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.ad-slot .ad-dim { font-size: 12px; font-variant-numeric: tabular-nums; }
.ad-leaderboard { height: 90px; }
.ad-rectangle  { height: 250px; width: 300px; }
.ad-inline     { height: 120px; }

/* ---------- 16. RELATED CARD ---------- */
.rel-card { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); text-decoration: none; color: inherit; transition: border-color var(--t-micro), box-shadow var(--t-micro), transform var(--t-micro); }
.rel-card:hover { border-color: var(--primary-200); box-shadow: var(--sh-md); transform: translateY(-2px); }
.rel-card .rel-ico { width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center; background: var(--primary-tint); color: var(--primary); border-radius: var(--r-md); }
.rel-card .rel-ico .lucide { width: 22px; height: 22px; }
.rel-card .rel-title { font-weight: 600; font-size: 15px; color: var(--heading); }
.rel-card .rel-sub { font-size: 13px; color: var(--text-mute); }

/* ---------- 17. SKELETON ---------- */
.skel { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 37%, var(--gray-100) 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: var(--r-md); }
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- 18. UTILITIES ---------- */
.container { max-width: 1200px; margin: 0 auto; padding-left: var(--sp-6); padding-right: var(--sp-6); }
.container-narrow { max-width: 720px; }
.container-calc { max-width: 1080px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.hr { height: 1px; background: var(--border); border: 0; margin: 0; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
