/* ── Shared styles for /tools/* calculators ─────────────── */
/* Theme-aware defaults use site theme variables;
   dark/dusk/dawn overrides preserve the navy/gold aesthetic. */

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 24px;
  align-items: start;
  margin-top: 12px;
}
@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 1fr; }
}

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 4px 14px rgba(37,99,235,.08), 0 1px 3px rgba(0,0,0,.04);
}
.tool-panel h3 {
  margin: 0 0 14px; font-size: 18px; color: var(--blue); font-weight: 700;
}

.tool-field {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px;
}
.tool-field label {
  font-size: 13px; color: var(--text); font-weight: 600;
}
.tool-field small {
  color: var(--text-2); font-weight: 400; font-size: 11px;
}
.tool-input, .tool-select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 15px;
  min-height: 44px;
  appearance: none;
  -webkit-appearance: none;
}
.tool-select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--blue) 50%),
    linear-gradient(135deg, var(--blue) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.tool-select option { background: var(--surface); color: var(--text); }
.tool-input::placeholder { color: var(--text-2); opacity: .7; }
.tool-input:focus, .tool-select:focus {
  outline: 2px solid var(--blue); outline-offset: 1px;
}
.tool-row {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.tool-row > .tool-field { flex: 1 1 140px; }

.tool-checkbox {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: 14px; color: var(--text);
  cursor: pointer;
}
.tool-checkbox input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--blue);
}

/* Result card */
.tool-result {
  position: sticky; top: 80px;
}
.tool-result .result-big {
  font-size: 40px; font-weight: 800; color: var(--blue); line-height: 1;
  margin: 6px 0;
}
.tool-result .result-sub {
  color: var(--text-2); font-size: 14px; margin-bottom: 16px;
}
.tool-result .result-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.tool-result .result-row:first-of-type { border-top: 0; }
.tool-result .result-row .lbl { color: var(--text-2); }
.tool-result .result-row .val { color: var(--text); font-weight: 600; }
.tool-result .result-row.positive .val { color: #16a34a; }
.tool-result .result-row.negative .val { color: #dc2626; }

.tool-cta {
  display: block; text-align: center; margin-top: 18px;
  padding: 12px 16px; border-radius: 10px;
  background: var(--blue); color: #ffffff;
  text-decoration: none; font-weight: 700;
  transition: background .12s;
}
.tool-cta:hover { background: var(--indigo); }
.tool-cta-sub {
  display: block; text-align: center; margin-top: 8px;
  color: var(--text-2); font-size: 12px;
}

.tool-disclaimer {
  margin-top: 22px; padding: 12px 14px;
  background: var(--surface2);
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  color: var(--text-2); font-size: 12px;
  line-height: 1.55;
}

/* Tools index cards */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.tool-card {
  display: block; text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  color: inherit;
  box-shadow: 0 4px 14px rgba(37,99,235,.10), 0 1px 3px rgba(0,0,0,.05);
  transition: transform .15s, border-color .15s, background .15s, box-shadow .15s;
}
.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(37,99,235,.22), 0 2px 6px rgba(37,99,235,.10);
}
.tool-card .tc-icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: rgba(37,99,235,.10);
  display: grid; place-items: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.tool-card .tc-name {
  font-size: 16px; font-weight: 700; color: var(--text);
  margin-bottom: 4px;
}
.tool-card .tc-desc {
  color: var(--text-2); font-size: 13px; line-height: 1.4;
}
.tool-card .tc-arrow {
  color: var(--blue); font-weight: 700; margin-top: 10px;
  font-size: 13px;
}

.tool-breadcrumb {
  margin: 10px 0 18px;
  font-size: 13px;
  color: var(--text-2);
}
.tool-breadcrumb a { color: var(--blue); text-decoration: none; font-weight: 600; }
.tool-breadcrumb a:hover { text-decoration: underline; }

/* ── Dark / Dusk / Dawn overrides — restore navy/gold aesthetic ─ */
[data-theme="dark"] .tool-panel,
[data-theme="dusk"] .tool-panel,
[data-theme="dawn"] .tool-panel {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
  box-shadow: none;
}
[data-theme="dark"] .tool-panel h3,
[data-theme="dusk"] .tool-panel h3,
[data-theme="dawn"] .tool-panel h3 { color: #ffd87a; }

[data-theme="dark"] .tool-field label,
[data-theme="dusk"] .tool-field label,
[data-theme="dawn"] .tool-field label { color: rgba(255,255,255,.85); }
[data-theme="dark"] .tool-field small,
[data-theme="dusk"] .tool-field small,
[data-theme="dawn"] .tool-field small { color: rgba(255,255,255,.5); }

[data-theme="dark"] .tool-input,
[data-theme="dark"] .tool-select,
[data-theme="dusk"] .tool-input,
[data-theme="dusk"] .tool-select,
[data-theme="dawn"] .tool-input,
[data-theme="dawn"] .tool-select {
  background: #12192f; color: #f3f5fa; border-color: rgba(255,255,255,.18);
}
[data-theme="dark"] .tool-select,
[data-theme="dusk"] .tool-select,
[data-theme="dawn"] .tool-select {
  background-image:
    linear-gradient(45deg, transparent 50%, #ffd87a 50%),
    linear-gradient(135deg, #ffd87a 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
[data-theme="dark"] .tool-select option,
[data-theme="dusk"] .tool-select option,
[data-theme="dawn"] .tool-select option { background: #12192f; color: #f3f5fa; }
[data-theme="dark"] .tool-input::placeholder,
[data-theme="dusk"] .tool-input::placeholder,
[data-theme="dawn"] .tool-input::placeholder { color: rgba(255,255,255,.35); opacity: 1; }
[data-theme="dark"] .tool-input:focus,
[data-theme="dark"] .tool-select:focus,
[data-theme="dusk"] .tool-input:focus,
[data-theme="dusk"] .tool-select:focus,
[data-theme="dawn"] .tool-input:focus,
[data-theme="dawn"] .tool-select:focus { outline-color: #ffd87a; }

[data-theme="dark"] .tool-checkbox,
[data-theme="dusk"] .tool-checkbox,
[data-theme="dawn"] .tool-checkbox { color: rgba(255,255,255,.85); }
[data-theme="dark"] .tool-checkbox input[type="checkbox"],
[data-theme="dusk"] .tool-checkbox input[type="checkbox"],
[data-theme="dawn"] .tool-checkbox input[type="checkbox"] { accent-color: #ffd87a; }

[data-theme="dark"] .tool-result .result-big,
[data-theme="dusk"] .tool-result .result-big,
[data-theme="dawn"] .tool-result .result-big { color: #ffd87a; }
[data-theme="dark"] .tool-result .result-sub,
[data-theme="dusk"] .tool-result .result-sub,
[data-theme="dawn"] .tool-result .result-sub { color: rgba(255,255,255,.75); }
[data-theme="dark"] .tool-result .result-row,
[data-theme="dusk"] .tool-result .result-row,
[data-theme="dawn"] .tool-result .result-row { border-top-color: rgba(255,255,255,.06); }
[data-theme="dark"] .tool-result .result-row .lbl,
[data-theme="dusk"] .tool-result .result-row .lbl,
[data-theme="dawn"] .tool-result .result-row .lbl { color: rgba(255,255,255,.65); }
[data-theme="dark"] .tool-result .result-row .val,
[data-theme="dusk"] .tool-result .result-row .val,
[data-theme="dawn"] .tool-result .result-row .val { color: #fff; }
[data-theme="dark"] .tool-result .result-row.positive .val,
[data-theme="dusk"] .tool-result .result-row.positive .val,
[data-theme="dawn"] .tool-result .result-row.positive .val { color: #59d77a; }
[data-theme="dark"] .tool-result .result-row.negative .val,
[data-theme="dusk"] .tool-result .result-row.negative .val,
[data-theme="dawn"] .tool-result .result-row.negative .val { color: #ff8a6c; }

[data-theme="dark"] .tool-cta,
[data-theme="dusk"] .tool-cta,
[data-theme="dawn"] .tool-cta { background: #ffd87a; color: #12192f; }
[data-theme="dark"] .tool-cta:hover,
[data-theme="dusk"] .tool-cta:hover,
[data-theme="dawn"] .tool-cta:hover { background: #ffc24a; }
[data-theme="dark"] .tool-cta-sub,
[data-theme="dusk"] .tool-cta-sub,
[data-theme="dawn"] .tool-cta-sub { color: rgba(255,255,255,.6); }

[data-theme="dark"] .tool-disclaimer,
[data-theme="dusk"] .tool-disclaimer,
[data-theme="dawn"] .tool-disclaimer {
  background: rgba(255,255,255,.03);
  border-left-color: rgba(255,216,122,.4);
  color: rgba(255,255,255,.65);
}

[data-theme="dark"] .tool-card,
[data-theme="dusk"] .tool-card,
[data-theme="dawn"] .tool-card {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
  box-shadow: none;
}
[data-theme="dark"] .tool-card:hover,
[data-theme="dusk"] .tool-card:hover,
[data-theme="dawn"] .tool-card:hover {
  border-color: rgba(255,216,122,.4);
  background: rgba(255,255,255,.06);
  box-shadow: none;
}
[data-theme="dark"] .tool-card .tc-icon,
[data-theme="dusk"] .tool-card .tc-icon,
[data-theme="dawn"] .tool-card .tc-icon { background: rgba(255,216,122,.14); }
[data-theme="dark"] .tool-card .tc-name,
[data-theme="dusk"] .tool-card .tc-name,
[data-theme="dawn"] .tool-card .tc-name { color: #fff; }
[data-theme="dark"] .tool-card .tc-desc,
[data-theme="dusk"] .tool-card .tc-desc,
[data-theme="dawn"] .tool-card .tc-desc { color: rgba(255,255,255,.6); }
[data-theme="dark"] .tool-card .tc-arrow,
[data-theme="dusk"] .tool-card .tc-arrow,
[data-theme="dawn"] .tool-card .tc-arrow { color: #ffd87a; }

[data-theme="dark"] .tool-breadcrumb,
[data-theme="dusk"] .tool-breadcrumb,
[data-theme="dawn"] .tool-breadcrumb { color: rgba(255,255,255,.55); }
[data-theme="dark"] .tool-breadcrumb a,
[data-theme="dusk"] .tool-breadcrumb a,
[data-theme="dawn"] .tool-breadcrumb a { color: #ffd87a; }
