/* ==========================================================================
   SignLater Design 2.0 — Start Calculator (production)
   Page-specific styles. Requires: tokens.css, motion.css, components.css.
   ========================================================================== */

/* ============ TOOL HEADER ============ */
.tool-head {
  position: relative; padding: 72px 0 40px; overflow: hidden;
  background:
    radial-gradient(1000px 480px at 80% -10%, rgba(180,83,9,.10), transparent 65%),
    radial-gradient(800px 500px at 5% 110%, rgba(60,70,90,.08), transparent 60%),
    linear-gradient(180deg, var(--field1) 0%, var(--paper) 100%);
}
.tool-head .wrap { position: relative; z-index: 2; }
.tool-head h1 {
  font-size: 48px; font-weight: var(--fw-bold); letter-spacing: -.03em;
  line-height: 1.1; max-width: 820px; margin: 18px 0 14px;
}
.tool-head h1 .amber-w { color: var(--amber); }
.tool-head .sub { color: var(--muted); font-size: 18.5px; max-width: 640px; }

/* State switcher */
.switcher { margin-top: 34px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.switcher .sw-label {
  font-size: 12px; letter-spacing: .12em; font-weight: var(--fw-bold);
  color: var(--faint); margin-right: 6px;
}
.sw-pill {
  font-size: 14px; font-weight: var(--fw-bold); padding: 10px 18px;
  border-radius: var(--r-6); cursor: pointer;
  border: 1.5px solid var(--hairline); background: #fff; color: var(--muted);
  transition: all .2s var(--ease); min-height: 44px;
}
.sw-pill:hover { border-color: var(--ink); color: var(--ink); }
.sw-pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ============ STATE BANNERS ============ */
.state-banner { display: none; margin: 0 auto 28px; max-width: 1280px; padding: 0 48px; }
.state-banner.show { display: block; }
.banner-in {
  border-radius: var(--r-8); padding: 20px 28px; font-size: 15px; line-height: 1.6;
  display: flex; gap: 16px; align-items: flex-start;
}
.banner-in .bi { font-size: 20px; flex: none; line-height: 1.4; }
.banner-stale .banner-in { background: #F1EFE6; border: 1px solid #DDD9C6; color: #4A4A42; }
.banner-stale b { color: var(--ink); }
.banner-unsupported .banner-in { background: var(--field1); border: 1px dashed #C9C4AE; color: #4A4A42; }
.banner-invalid-note .banner-in { background: var(--red-wash); border: 1px solid #F0CFCF; color: #7A1F1F; }

/* ============ WORKSPACE ============ */
.workspace { padding: 20px 0 90px; }
.ws-grid {
  display: grid; grid-template-columns: 5fr 6fr; gap: 36px; align-items: start;
  max-width: 1280px; margin: 0 auto; padding: 0 48px;
}

/* Control panel */
.controls {
  background: #fff; border: 1px solid var(--hairline);
  border-radius: var(--r-8); box-shadow: var(--sh-tool); overflow: hidden;
}
.controls-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 36px; border-bottom: 1px solid var(--hairline);
}
.controls-title {
  font-size: 11.5px; letter-spacing: .12em; font-weight: var(--fw-bold);
  color: var(--faint); text-transform: uppercase;
}
.controls-body { padding: 8px 36px 12px; }
.controls-foot {
  padding: 20px 36px; border-top: 1px solid var(--hairline); background: #FBFAF5;
  display: flex; justify-content: space-between; align-items: center;
}
.controls-foot .hint { font-size: 13.5px; color: var(--muted); }
.controls-foot .free {
  font-size: 13.5px; font-weight: var(--fw-bold); color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; flex: none; }

/* Result panel */
.result {
  background: linear-gradient(180deg, #FFFDF6, #FBF3E2);
  border: 1px solid #EAD9BC; border-radius: var(--r-8);
  box-shadow: var(--sh-result); overflow: hidden; position: relative;
  transition: box-shadow .3s var(--ease);
}
.result::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, var(--amber), var(--amber-soft));
}
.result-in { padding: 38px 44px 34px; }
.r-label {
  font-size: 11.5px; letter-spacing: .14em; font-weight: var(--fw-bold);
  color: var(--muted); margin-bottom: 8px;
}
.r-first { font-size: 20px; color: var(--muted); font-weight: var(--fw-medium); }
.r-first small { font-size: 13px; color: var(--faint); font-weight: var(--fw-medium); }
.r-second {
  font-size: 104px; font-weight: var(--fw-black); letter-spacing: -.045em; line-height: 1;
  color: var(--amber); margin: 12px 0 4px;
  text-shadow: 0 2px 24px rgba(180,83,9,.16);
}
.r-cap {
  font-size: 13px; letter-spacing: .1em; font-weight: var(--fw-bold);
  color: var(--amber); margin-bottom: 20px;
}
.qv-row { margin-bottom: 14px; }
.qv-top { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 7px; }
.qv-top .q { color: var(--muted); font-weight: var(--fw-medium); }
.qv-track { height: 14px; border-radius: 7px; background: #EFEAD9; overflow: hidden; position: relative; }
.qv-fill { height: 100%; border-radius: 7px; transition: width .6s var(--ease); background: #3A3A36; }
.qv-gap {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--amber), var(--amber-soft));
  border-radius: 0 7px 7px 0; transition: left .6s var(--ease), width .6s var(--ease);
}
.qv-note { font-size: 13px; color: var(--muted); margin: 12px 0 26px; }
.qv-note b { color: var(--amber); }
.donut-block {
  display: flex; gap: 28px; align-items: center; margin: 6px 0 26px;
  padding: 24px; border: 1px solid #EAD9BC; border-radius: var(--r-8);
  background: rgba(255,255,255,.55);
}
.donut-block .donut-slot { width: 168px; flex: none; }
.d-legend { flex: 1; display: grid; gap: 10px; min-width: 0; }
.d-leg { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.d-leg .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.d-leg .v { margin-left: auto; font-weight: var(--fw-bold); white-space: nowrap; }
.d-leg .n { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.explain {
  font-size: 16.5px; line-height: 1.65; border-left: 3px solid var(--amber);
  padding: 4px 0 4px 20px; margin: 0 0 8px; color: var(--ink);
}
.r-foot {
  border-top: 1px solid #EAD9BC; padding: 16px 44px;
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--muted); background: rgba(255,255,255,.5);
  flex-wrap: wrap; gap: 8px;
}

/* ============ BREAKDOWN ============ */
.breakdown { padding: 30px 0 90px; }
.breakdown .wrap { max-width: 1280px; }
.bd-head { margin-bottom: 36px; }
.bd-head h2 { font-size: 34px; font-weight: var(--fw-bold); letter-spacing: -.025em; margin: 14px 0 8px; }
.bd-head p { color: var(--muted); font-size: 17px; max-width: 620px; }
.bd-card {
  background: #fff; border: 1px solid var(--hairline);
  border-radius: var(--r-8); box-shadow: var(--sh-card); overflow: hidden;
}
.bd-row {
  display: grid; grid-template-columns: 1fr 200px; gap: 32px; align-items: center;
  padding: 26px 40px; border-bottom: 1px solid var(--hairline);
}
.bd-row:last-child { border-bottom: none; }
.bd-row.total { background: var(--amber-wash); border-top: 2px solid var(--amber); }
.bd-info .bd-name { font-size: 16.5px; font-weight: var(--fw-bold); }
.bd-info .bd-formula { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.bd-info .bd-tag { font-size: 11px; letter-spacing: .1em; font-weight: var(--fw-bold); color: var(--faint); margin-top: 6px; }
.bd-val { text-align: right; }
.bd-val b { font-size: 24px; font-weight: var(--fw-black); letter-spacing: -.02em; }
.bd-row.total .bd-val b { color: var(--amber); font-size: 30px; }
.bd-bar { grid-column: 1/-1; height: 10px; border-radius: 5px; background: #F1EEE2; overflow: hidden; margin-top: 2px; }
.bd-bar i { display: block; height: 100%; border-radius: 5px; background: #3A3A36; transition: width .7s var(--ease); width: 0; }
.bd-row.total .bd-bar i { background: linear-gradient(90deg, var(--amber), var(--amber-soft)); }

/* ============ PROOF (assumptions + methodology) ============ */
.proof { padding: 0 0 90px; }
.proof-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px;
  max-width: 1280px; margin: 0 auto; padding: 0 48px;
}
.assume-list { list-style: none; display: grid; gap: 14px; }
.assume-list li { display: flex; gap: 12px; font-size: 15px; line-height: 1.55; }
.assume-list .ak { font-weight: var(--fw-bold); flex: none; min-width: 170px; }
.assume-list .av { color: var(--muted); }
.assume-list .av .assumed-tag { margin-left: 8px; }
.lineage { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--hairline); font-size: 13.5px; color: var(--muted); }
.lineage b { color: var(--ink); }

/* ============ BEFORE YOU SIGN ============ */
.bys-actions { margin-top: 44px; display: flex; gap: 14px; flex-wrap: wrap; }
.btn-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: #fff; font-size: 14.5px; font-weight: var(--fw-bold);
  padding: 14px 26px; border-radius: var(--r-6);
  transition: all .3s var(--ease); pointer-events: none; z-index: 100;
}
.btn-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ TRUST ============ */
.trust { padding: 90px 0; }
.trust-grid { margin-top: 36px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .ws-grid { grid-template-columns: 1fr; }
  .proof-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .controls-head { flex-wrap: wrap; gap: 10px; }
  .tool-head { padding: 48px 0 32px; }
  .tool-head h1 { font-size: 32px; }
  .ws-grid { padding: 0 20px; gap: 24px; }
  .controls-head { padding: 18px 22px; }
  .controls-body { padding: 4px 22px 8px; }
  .controls-foot { padding: 16px 22px; flex-direction: column; gap: 8px; align-items: flex-start; }
  .result-in { padding: 28px 24px 24px; }
  .r-second { font-size: 76px; }
  .r-foot { padding: 14px 24px; }
  .donut-block { flex-direction: column; }
  .donut-block .donut-slot { width: 200px; }
  .bd-row { grid-template-columns: 1fr; gap: 8px; padding: 22px 24px; }
  .bd-val { text-align: left; }
  .proof-grid { padding: 0 20px; }
  .state-banner { padding: 0 20px; }
  .breakdown .wrap { padding: 0 20px; }
}

/* ============ START-SPECIFIC: state select + segmented choices ============ */
.state-sel {
  width: 100%; appearance: none; -webkit-appearance: none;
  padding: 14px 44px 14px 16px; min-height: 52px;
  border: 1.5px solid var(--hairline); border-radius: var(--r-6); background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231B1B19' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
  font-size: 16px; font-weight: var(--fw-bold); color: var(--ink); cursor: pointer;
}
.state-sel:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(27,27,25,.10); }
.fee-readouts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.fee-ro {
  background: var(--field1); border: 1px solid var(--hairline);
  border-radius: var(--r-6); padding: 10px 14px;
}
.fee-ro .k {
  font-size: 11px; letter-spacing: .1em; font-weight: var(--fw-bold);
  color: var(--faint); text-transform: uppercase;
}
.fee-ro .v { font-size: 17px; font-weight: var(--fw-black); margin-top: 2px; }
.fee-ro .v .tag { margin-left: 8px; vertical-align: 2px; }

/* Segmented choice group */
.seg {
  display: flex; background: var(--field1); border: 1.5px solid var(--hairline);
  border-radius: var(--r-6); padding: 4px; gap: 4px;
}
.seg button {
  flex: 1 1 0; border: none; background: transparent; padding: 10px 6px;
  border-radius: var(--r-3); font-size: 14px; font-weight: var(--fw-bold);
  color: var(--muted); cursor: pointer; min-height: 52px; line-height: 1.25;
  transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.seg button small { display: block; font-size: 12px; font-weight: var(--fw-medium); color: var(--faint); margin-top: 3px; }
.seg button:hover { color: var(--ink); }
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(27,27,25,.18); }
.seg button.active small { color: var(--muted); }
.seg button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ============ START-SPECIFIC: year timeline chart ============ */
.chart-slot { margin: 26px 0 6px; }
.chart-slot svg { width: 100%; height: auto; display: block; }
.chart-fallback { font-size: 14px; color: var(--muted); background: var(--field1); border: 1px dashed #C9C4AE; border-radius: var(--r-6); padding: 16px 20px; line-height: 1.6; }
.yr-legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.yr-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 8px; vertical-align: -1px; }
.chart-cap { font-size: 13px; color: var(--muted); margin: 10px 0 24px; line-height: 1.6; }

@media (max-width: 640px) {
  .seg { flex-direction: column; }
  .seg button { min-height: 48px; }
  .fee-readouts { grid-template-columns: 1fr 1fr; }
}
