/* ABOUTME: EstimIA design system — modern SaaS look (tokens, components, layout). */
:root {
  --bg: #f6f8fc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e7eaf1;
  --brand: #2563eb;
  --brand-2: #6366f1;
  --brand-dark: #1d4ed8;
  --brand-soft: #eef2ff;
  --good: #0e9f6e;
  --warn: #b45309;
  --danger: #dc2626;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 6px 24px rgba(15, 23, 42, .07);
  --shadow-lg: 0 18px 50px rgba(37, 99, 235, .16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

h1, h2, h3 { color: var(--ink); line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 200; }
.skip-link:focus { left: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .nav { display: flex; align-items: center; gap: 1rem; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  color: #fff; font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.site-header nav.links { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.site-header nav.links a { color: var(--muted); font-weight: 600; font-size: .95rem; }
.site-header nav.links a:hover { color: var(--ink); }

/* ---------- buttons ---------- */
.btn, button[type="submit"], .plan-cta, .nav-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none;
  padding: .7rem 1.2rem; border-radius: 12px; border: 1px solid transparent;
  transition: transform .04s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary, button[type="submit"], .nav-cta {
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px rgba(37, 99, 235, .25);
}
.btn-primary:hover, button[type="submit"]:hover, .nav-cta:hover { color: #fff; box-shadow: 0 10px 22px rgba(37, 99, 235, .32); }
.btn-primary:active, button[type="submit"]:active { transform: translateY(1px); }
.btn-ghost { background: var(--brand-soft); color: var(--brand); }
.nav-cta { padding: .5rem 1rem; }

/* ---------- main / footer ---------- */
main { min-height: 60vh; }
.section { padding: 2.5rem 0; }
.site-footer { border-top: 1px solid var(--line); background: #fff; margin-top: 3rem; }
.site-footer .container { padding-top: 1.5rem; padding-bottom: 1.5rem; color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(99, 102, 241, .14), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(37, 99, 235, .12), transparent 55%);
  padding: 2.5rem 0 1rem;
}
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); padding: .3rem .7rem; border-radius: 999px; }
.hero h1 { margin: .9rem 0 .6rem; max-width: 16ch; }
.hero-sub { font-size: 1.12rem; color: var(--muted); max-width: 52ch; margin: 0; }
.hero-points { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; padding: 0; margin: 1.1rem 0 0; }
.hero-points li { color: var(--ink); font-weight: 600; font-size: .92rem; padding-left: 1.5rem; position: relative; }
.hero-points li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 800; }

/* form section under hero */
.form-section { padding: 1.5rem 0 1rem; }
.form-card { padding: 1.75rem; max-width: 720px; margin: 0 auto; }
.form-card > h2 { margin-top: 0; }
.form-hint { color: var(--muted); margin: -.2rem 0 1rem; }

/* ---------- forms ---------- */
form { background: transparent; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-weight: 700; color: var(--muted); margin-bottom: 1rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
form p { display: flex; flex-direction: column; gap: .35rem; margin: 0 0 1rem; }
label { font-weight: 600; font-size: .92rem; color: var(--ink); }
input[type="text"], input[type="number"], input[type="email"], input[type="password"], select {
  width: 100%; padding: .65rem .8rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #cfd6e4; border-radius: 12px;
  transition: border .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); }
input::placeholder { color: #9aa4b6; }
input[type="checkbox"], input[type="radio"] { width: 1.1rem; height: 1.1rem; accent-color: var(--brand); }
.check-row { flex-direction: row; align-items: center; gap: .5rem; }
.errorlist { color: var(--danger); font-size: .85rem; list-style: none; padding: 0; margin: .2rem 0 0; }
.hint { color: var(--muted); font-size: .82rem; }

/* ---------- result ---------- */
#result:not(:empty) { margin-top: 1.5rem; }
.estimate-result { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.estimate-result h2 { color: var(--brand); font-size: 1.9rem; }
.estimate-result .range { font-size: 1.05rem; }
.estimate-result .provenance, .estimate-result .precision { color: var(--muted); font-size: .9rem; }
.estimate-result.warn .warn, .estimate-result .warn { color: var(--warn); }
.estimate-result .offer { margin-top: 1.25rem; padding: 1rem 1.1rem; background: linear-gradient(135deg, var(--brand-soft), #fff); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.offer .btn, .offer button { margin-top: .6rem; background: linear-gradient(135deg, var(--good), #0ea672); color: #fff; box-shadow: 0 6px 16px rgba(14, 159, 110, .25); }
.estimate-error { color: var(--warn); background: #fff7ed; border: 1px solid #fed7aa; padding: 1rem; border-radius: var(--radius-sm); }

table { border-collapse: collapse; width: 100%; margin-top: .6rem; font-size: .9rem; }
th, td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; }
th { background: #f1f5fb; font-weight: 700; }

/* ---------- address autocomplete ---------- */
.autocomplete { position: relative; display: block; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; }
.suggest-list { list-style: none; margin: .25rem 0 0; padding: .3rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.suggest-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .55rem .7rem; border-radius: 8px; cursor: pointer; font-size: .95rem; color: var(--ink); }
.suggest-item:hover, .suggest-item:focus { background: var(--brand-soft); }

/* ---------- segmented switch ---------- */
.switch-row { display: flex; align-items: center; gap: 1rem; flex-direction: row; }
.switch { display: inline-flex; background: #eef1f6; border-radius: 999px; padding: 4px; }
.switch-opt { position: relative; }
.switch-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-opt span { display: block; padding: .45rem 1rem; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 650; transition: .15s; }
.switch-opt input:checked + span { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }

/* ---------- registration tabs ---------- */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin: 0 0 1.5rem; }
.tab { position: relative; border: 2px solid var(--line); border-radius: 14px; padding: .9rem 1rem; cursor: pointer; display: flex; flex-direction: column; gap: .15rem; background: #fff; transition: .15s; }
.tab input { position: absolute; opacity: 0; width: 0; height: 0; }
.tab span { font-weight: 700; }
.tab small { color: var(--muted); font-size: .82rem; }
.tab.is-active { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.grp { margin: 0; }

/* ---------- messages ---------- */
.messages { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.messages .msg { padding: .8rem 1.1rem; border-radius: 12px; margin-bottom: .6rem; font-weight: 600; }
.messages .success { background: #e8f8f1; color: var(--good); }
.messages .warning { background: #fff7ed; color: var(--warn); }
.messages .error { background: #fef2f2; color: var(--danger); }

/* ---------- pricing ---------- */
.lead { color: var(--muted); font-size: 1.1rem; margin-top: -.3rem; }
.plan-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; margin: 1.5rem 0 2.5rem; align-items: stretch; }
.plan-card { position: relative; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.3rem 1.3rem; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.plan-card.is-highlight { border: 2px solid var(--brand); box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.plan-badge { position: absolute; top: -.8rem; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: .72rem; font-weight: 800; padding: .25rem .7rem; border-radius: 999px; white-space: nowrap; box-shadow: 0 4px 10px rgba(37, 99, 235, .3); }
.plan-audience { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; }
.plan-name { font-size: 1.3rem; margin: .25rem 0 .4rem; }
.plan-price { font-size: 1.9rem; font-weight: 850; color: var(--ink); }
.plan-price span { font-size: .85rem; font-weight: 500; color: var(--muted); }
.plan-tagline { color: var(--muted); font-size: .92rem; min-height: 2.6em; }
.plan-features { list-style: none; padding: 0; margin: .7rem 0 1.2rem; flex: 1; }
.plan-features li { padding: .3rem 0 .3rem 1.5rem; position: relative; font-size: .92rem; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 800; }
.plan-card form { margin-top: auto; }
.plan-cta { width: 100%; }
.plan-card:not(.is-highlight) .plan-cta { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.plan-card:not(.is-highlight) .plan-cta:hover { background: #e2e8ff; }
.oneshot-list { list-style: none; padding: 0; max-width: 680px; }
.oneshot-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.1rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: .6rem; box-shadow: var(--shadow-sm); }
.oneshot-list .name { font-weight: 700; display: block; }
.oneshot-list .desc { color: var(--muted); font-size: .86rem; }
.oneshot-list .price { color: var(--brand); font-weight: 800; white-space: nowrap; font-size: 1.05rem; }

/* ---------- account / misc cards ---------- */
.account-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0 1.5rem; }
.acct-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow-sm); }
.acct-card h2 { color: var(--brand); font-size: 1.1rem; }
.auth-form, .register-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; max-width: 640px; box-shadow: var(--shadow-sm); }
.report-ready .btn, .generating { font-weight: 600; }

[hidden] { display: none !important; }

@media (max-width: 860px) {
  .plan-cards { grid-template-columns: repeat(2, 1fr); }
  .account-types, .tabs { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .plan-cards { grid-template-columns: 1fr; }
  .switch-row { flex-direction: column; align-items: flex-start; }
}
