/*
 * components.css — Threshr
 *
 * Shared UI components used across two or more pages: site header, auth
 * buttons, sign-in dropdown, section cards, form controls, info boxes,
 * toggle pills, tax panels, accordion, metrics, verdict, flags, conversion
 * banner, disclaimer, export bar, modal, and splash screen.
 *
 * Page-specific layout lives in calculator.css / auth.css / dashboard.css.
 * Design tokens live in base.css.
 */

/* ─── Site header ─────────────────────────────────────────────────────────── */

.site-header {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-lockup { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.site-brand,
.site-brand:visited,
.site-brand:hover,
.site-brand:focus {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}
.site-brand .site-toolname { text-decoration: none; }

.site-logo {
  width: 46px;
  height: 46px;
  border-radius: 9px;
  background: #E6E4EE;
  flex-shrink: 0;
}

.site-toolname {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.site-credit {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 600;
  padding-left: calc(46px + 0.85rem);
}

/* ─── Auth buttons (header) ───────────────────────────────────────────────── */

.site-auth { display: flex; align-items: center; gap: 8px; }

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.auth-btn.outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.auth-btn.outline:hover { background: var(--accent-soft); }

.auth-btn.solid {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #FFFFFF;
}
.auth-btn.solid:hover { background: var(--accent-press); border-color: var(--accent-press); }

/* ─── Sign-in dropdown ────────────────────────────────────────────────────── */

.signin-wrap { position: relative; }

.signin-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(26,23,38,0.16);
  padding: 1.4rem;
  z-index: 60;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.signin-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.signin-dropdown .signin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.signin-dropdown h4 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0;
}
.signin-dropdown .signin-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  border: none;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.signin-dropdown .signin-close:hover { background: var(--accent-soft); color: var(--accent); }

.signin-dropdown label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.signin-dropdown input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  padding: 11px 13px;
  margin-bottom: 12px;
}
.signin-dropdown input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(90,67,217,0.18);
}
.signin-dropdown .signin-submit {
  width: 100%;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  border-radius: 9999px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 2px;
}
.signin-dropdown .signin-submit:hover { background: var(--accent-press); }

.signin-dropdown .signin-foot {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 0.9rem;
  text-align: center;
  font-weight: 500;
}
.signin-dropdown .signin-foot a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.signin-dropdown .signin-foot a:hover { text-decoration: underline; }

/* ─── Section card ────────────────────────────────────────────────────────── */

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 1.85rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 6px 28px rgba(26,23,38,0.05);
}

.section-head {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 1.35rem;
}

/* ─── Form fields ─────────────────────────────────────────────────────────── */

.field { margin-bottom: 1.6rem; }
.field:last-child { margin-bottom: 0; }

.field-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-weight: 500;
}
.field-label strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ─── Form inputs ─────────────────────────────────────────────────────────── */

select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  padding: 13px 14px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A43D9' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(90,67,217,0.18); }
select optgroup { background: #FFFFFF; color: var(--text-tertiary); font-weight: 700; }
select option  { background: #FFFFFF; color: var(--text-primary); font-weight: 500; }

input[type=range] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  height: 6px;
}

input[type=number] {
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  padding: 9px 12px;
  width: 110px;
  text-align: right;
}
input[type=number]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(90,67,217,0.18); }

/* ─── Info box ────────────────────────────────────────────────────────────── */

.info {
  background: var(--surface-2);
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-weight: 500;
}

/* ─── Toggle pill buttons (tax rate, property extras) ─────────────────────── */

.rate-toggle { display: flex; gap: 8px; margin-bottom: 1.2rem; }
.extras      { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1rem; }

.rate-btn,
.extra-btn {
  padding: 9px 18px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  font-family: inherit;
}
.rate-btn:hover,
.extra-btn:hover { border-color: var(--accent); color: var(--accent); }

.rate-btn.on,
.extra-btn.on { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }

/* ─── Tax panel ───────────────────────────────────────────────────────────── */

.tax-panel {
  background: var(--surface-2);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.tax-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  gap: 1rem;
}
.tax-row:last-child { border-bottom: none; }
.tax-row span:first-child { color: var(--text-secondary); flex: 1; font-weight: 500; }
.tax-row span:last-child  { color: var(--text-primary); white-space: nowrap; font-weight: 600; }
.tax-row.total { background: rgba(90,67,217,0.07); }
.tax-row.total span:last-child  { font-size: 15px; font-weight: 800; }
.tax-row.monthly span:last-child { color: var(--red); font-size: 19px; font-weight: 800; }

/* ─── Running-costs accordion ─────────────────────────────────────────────── */

.accordion-btn {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--text-primary);
  font-size: 14px;
  padding: 15px 18px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: inherit;
  font-weight: 600;
  transition: border-color 0.15s;
}
.accordion-btn:hover { border-color: var(--accent); }

.accordion-btn .btn-label { display: flex; gap: 8px; align-items: baseline; }
.accordion-btn .btn-total { font-size: 13px; color: var(--text-tertiary); font-weight: 500; }

.accordion-icon {
  font-size: 0;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.accordion-icon::before {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.25s ease;
}
.accordion-btn:hover .accordion-icon::before { border-color: var(--accent); }
.accordion-btn:has(+ .accordion-body.open) .accordion-icon::before {
  transform: rotate(-135deg) translate(-1px, -1px);
}

.accordion-body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.accordion-body.open { max-height: 2000px; padding-top: 1rem; }

.cost-group-label {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 1.25rem 0 0.5rem;
  font-weight: 700;
}

.cost-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.cost-row label { font-size: 14px; color: var(--text-secondary); font-weight: 500; }

.cost-help {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin: -4px 0 12px;
  line-height: 1.4;
}

/* ─── Metrics grid ────────────────────────────────────────────────────────── */

.metrics {
  display: flex;
  gap: 14px;
  margin: 0 -1.4rem 1.25rem;
  padding: 2px 1.4rem 16px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 1.4rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.metrics::-webkit-scrollbar { display: none; }

.metric {
  position: relative;
  flex: 0 0 min(82vw, 320px);
  min-height: 166px;
  overflow: hidden;
  scroll-snap-align: start;
  background:
    radial-gradient(circle at 88% 18%, rgba(91,79,232,0.42), transparent 24%),
    linear-gradient(145deg, #181523 0%, #191627 58%, #211B3E 100%);
  border: 1px solid rgba(214,209,255,0.10);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 18px 38px rgba(36,20,95,0.22);
  display: flex;
  flex-direction: column;
  color: #FFFFFF;
}
.metric::after {
  content: '';
  position: absolute;
  inset: auto -30px -44px auto;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  pointer-events: none;
}
.metric-card-primary {
  background:
    radial-gradient(circle at 88% 18%, rgba(91,79,232,0.48), transparent 24%),
    linear-gradient(145deg, #181523 0%, #191627 56%, #241E45 100%);
  box-shadow: 0 20px 44px rgba(24,21,35,0.26);
}
.metric-label { font-size: 11.5px; color: rgba(255,255,255,0.72); margin-bottom: 12px; font-weight: 700; line-height: 1.3; min-height: 2.6em; text-transform: uppercase; letter-spacing: 0.04em; }
.metric-value { position: relative; z-index: 1; font-size: 28px; color: #FFFFFF; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.metric-sub   { position: relative; z-index: 1; font-size: 11px; color: rgba(255,255,255,0.68); margin-top: auto; padding-top: 12px; font-weight: 600; }

.metric-value.good,
.metric-value.warn,
.metric-value.bad  { color: #FFFFFF; }
.metric-value.warn::after,
.metric-value.bad::after {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.metric-value.warn::after {
  content: 'CHECK';
  color: #FFE2A8;
}
.metric-value.bad::after {
  content: 'SHORTFALL';
  color: #FFB7C0;
}

.metrics-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: -4px 0 1.25rem;
}
.metrics-dot {
  width: 7px;
  height: 7px;
  border: none;
  border-radius: 9999px;
  padding: 0;
  background: rgba(90,67,217,0.24);
  cursor: pointer;
  transition: width 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}
.metrics-dot.active {
  width: 22px;
  background: var(--accent);
}
.metrics-dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (min-width: 900px) {
  .metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 1.25rem;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
  }
  .metric {
    flex-basis: auto;
  }
  .metrics-dots {
    display: none;
  }
}

/* ─── Viability verdict ───────────────────────────────────────────────────── */

.verdict {
  border-radius: 18px;
  padding: 1.15rem 1.35rem;
  border-left: 5px solid transparent;
}
.verdict.good { background: rgba(21,160,107,0.10); border-left-color: var(--green); }
.verdict.warn { background: rgba(224,138,30,0.12); border-left-color: var(--amber); }
.verdict.bad  { background: rgba(226,61,76,0.10);  border-left-color: var(--red); }

.verdict-title { font-size: 16px; font-weight: 800; margin-bottom: 5px; letter-spacing: -0.01em; }
.verdict.good .verdict-title { color: var(--green); }
.verdict.warn .verdict-title { color: var(--amber); }
.verdict.bad  .verdict-title { color: var(--red); }
.verdict-body { font-size: 14px; color: var(--text-secondary); line-height: 1.6; font-weight: 500; }

/* ─── Regional / tax flags ────────────────────────────────────────────────── */

.flag {
  background: var(--surface-2);
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.6;
  border-left: 5px solid var(--border-strong);
}
.flag strong { display: block; color: var(--text-primary); margin-bottom: 5px; font-size: 14px; font-weight: 700; }
.flag.good   { border-left-color: var(--green); background: rgba(21,160,107,0.07); }
.flag.warn   { border-left-color: var(--amber); background: rgba(224,138,30,0.08); }
.flag.bad    { border-left-color: var(--red);   background: rgba(226,61,76,0.07); }
.flag p      { color: var(--text-secondary); font-weight: 500; }

/* ─── Conversion / sign-up banner ─────────────────────────────────────────── */

.convert-banner {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  border-radius: 26px;
  padding: 2.5rem 2.25rem;
  margin-bottom: 1.1rem;
}
.convert-banner::after {
  content: '';
  position: absolute;
  right: -70px;
  top: -70px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90,67,217,0.55), transparent 70%);
  pointer-events: none;
}
.convert-banner > * { position: relative; z-index: 1; }

.convert-banner h2 {
  font-size: 27px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.2;
  margin-bottom: 0.65rem;
  letter-spacing: -0.02em;
  max-width: 520px;
}
.convert-banner p {
  font-size: 14px;
  color: rgba(255,255,255,0.62);
  line-height: 1.6;
  max-width: 540px;
  margin-bottom: 1.4rem;
  font-weight: 500;
}

.convert-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  border-radius: 9999px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.15s;
}
.convert-cta:hover { background: var(--accent-press); transform: translateY(-1px); }

.convert-signin {
  display: block;
  margin-top: 1rem;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}
.convert-signin a {
  color: rgba(255,255,255,0.85);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.convert-signin a:hover { color: #FFFFFF; }

/* ─── Legal disclaimer ────────────────────────────────────────────────────── */

.disclaimer {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.7;
  font-style: italic;
  padding: 0 0.5rem;
  margin-top: 1.5rem;
}

.site-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 1.5rem 0 0;
  padding: 1rem 0.5rem;
  border-top: 1px solid var(--border);
}
.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  flex-shrink: 0;
}
.site-footer-brand svg {
  width: 18px;
  height: 18px;
}
.site-footer-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.site-footer-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem 1rem;
  flex-wrap: wrap;
}
.site-footer-nav a {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.site-footer-nav a:hover { text-decoration: underline; }
.site-footer-copy {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* Legal content pages */

.legal-page {
  max-width: 760px;
  margin: 2.75rem auto 0;
}
.legal-page h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: 0.7rem;
}
.legal-updated {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.legal-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 1.85rem;
  box-shadow: 0 6px 28px rgba(26,23,38,0.05);
}
.legal-section h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 1.8rem 0 0.65rem;
}
.legal-section h2:first-child { margin-top: 0; }
.legal-section p,
.legal-section li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
  font-weight: 500;
}
.legal-section p + p { margin-top: 0.85rem; }
.legal-section ul {
  margin: 0.6rem 0 0.8rem 1.15rem;
}
.legal-section a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.legal-section a:hover { text-decoration: underline; }

/* ─── Export action bar ───────────────────────────────────────────────────── */

.export-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.export-btn {
  padding: 12px 22px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.export-btn:hover { border-color: var(--accent); color: var(--accent); }
.export-btn.primary { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.export-btn.primary:hover { background: var(--accent-press); border-color: var(--accent-press); color: #FFFFFF; }

/* ─── Version / source note ───────────────────────────────────────────────── */

.version-note { font-size: 12px; color: var(--text-tertiary); margin: 0 0.5rem 1.5rem; font-weight: 500; }
.version-note a { color: var(--accent); }
.sources-link { color: var(--accent); text-decoration: none; cursor: pointer; }
.sources-link:hover { text-decoration: underline; }

/* ─── Sources modal ───────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,23,38,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
}

.modal-card {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(26,23,38,0.25);
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--text-tertiary);
  cursor: pointer;
}
.modal-close:hover { color: var(--text-primary); }

.modal-card h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.modal-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 1.25rem; line-height: 1.55; }

.source-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.source-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: 12px;
}
.source-list li strong { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.source-list li span,
.source-list li a  { font-size: 12.5px; color: var(--text-secondary); }
.source-list li a { text-decoration: none; font-weight: 600; }
.source-list li a:hover { color: var(--accent); text-decoration: underline; }

.modal-foot { font-size: 11.5px; color: var(--text-tertiary); margin-top: 1.25rem; font-style: italic; line-height: 1.5; }

/* Cookie consent */

.cookie-consent {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 120;
  width: min(calc(100vw - 2rem), 760px);
  transform: translateX(-50%);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(26,23,38,0.16);
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}
.cookie-consent[hidden],
.cookie-settings[hidden] {
  display: none;
}

.cookie-copy h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.cookie-copy p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  font-weight: 500;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.cookie-btn,
.cookie-settings {
  border-radius: 9999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.cookie-btn.outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.cookie-btn.outline:hover,
.cookie-settings:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.cookie-btn.solid {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #FFFFFF;
}
.cookie-btn.solid:hover {
  background: var(--accent-press);
  border-color: var(--accent-press);
}
.cookie-settings {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 80;
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  box-shadow: 0 8px 24px rgba(26,23,38,0.12);
}

/* ─── Splash / loading screen ─────────────────────────────────────────────── */

#splash {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 9999;
  background: var(--vault);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  transition: opacity 0.4s ease;
}
#splash.splash-hide { opacity: 0; }

.splash-lockup { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.splash-brand  {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  /* Start invisible — splash-screen.js reveals this once Plus Jakarta Sans 800
     is confirmed loaded, so the logo and wordmark appear simultaneously
     rather than the SVG popping in ahead of the text. */
  opacity: 0;
  transition: opacity 0.15s ease;
}
.splash-logo   { width: 92px; height: 92px; flex-shrink: 0; }

.splash-toolname {
  font-size: 60px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}

.splash-bar {
  position: relative;
  width: 120px;
  height: 3px;
  border-radius: 9999px;
  background: rgba(90,67,217,0.16);
  overflow: hidden;
}
.splash-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 45%;
  border-radius: 9999px;
  background: linear-gradient(90deg, rgba(90,67,217,0) 0%, var(--accent) 50%, rgba(90,67,217,0) 100%);
  animation: splash-shimmer 1.15s ease-in-out infinite;
}

@keyframes splash-shimmer {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(330%); }
}

/* ─── Hidden divider (kept for HTML compatibility) ────────────────────────── */
.divider         { display: none; }
.divider-diamond { display: none; }

/* ─── Mobile overrides for shared components ──────────────────────────────── */

@media (max-width: 480px) {
  .section         { padding: 1.4rem; border-radius: 22px; }
  .convert-banner  { padding: 1.85rem 1.5rem; border-radius: 22px; }
  .convert-banner h2 { font-size: 22px; }
  .convert-cta     { width: 100%; justify-content: center; }
  .splash-toolname { font-size: 46px; }
  .splash-logo     { width: 74px; height: 74px; }

  /* On small screens the sign-in dropdown becomes a centred modal overlay
     so it never overflows or gets clipped at the right edge. */
  .signin-dropdown {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    width: min(92vw, 340px);
    max-height: 88vh;
    overflow-y: auto;
    transform: translate(-50%, calc(-50% - 6px));
  }
  .signin-dropdown.open { transform: translate(-50%, -50%); }

  .cookie-consent {
    bottom: 0;
    width: 100%;
    border-right: none;
    border-bottom: none;
    border-left: none;
    border-radius: 22px 22px 0 0;
    grid-template-columns: 1fr;
    padding: 1.15rem;
  }
  .cookie-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .cookie-btn {
    width: 100%;
    padding: 11px 12px;
  }
  .cookie-settings {
    left: 0.75rem;
    bottom: 0.75rem;
  }
  body.has-cookie-consent .site-footer {
    margin-bottom: 15rem;
  }
  body.has-cookie-settings .site-footer {
    margin-bottom: 4.75rem;
  }
}
