/* ABOUTME: estim-ia.fr design system — deep navy, brass accent, warm neutral ground. */
/* ABOUTME: The accent is scarce on purpose: it marks the primary action and nothing else. */
:root {
  --bg: #f7f4ed;            /* warm neutral, so the navy reads as ink rather than as a tint */
  --card: #ffffff;
  --ink: #10203a;
  --muted: #5c6b82;
  --line: #e3ddd1;
  --navy: #0b2549;          /* the ground of every dark band and data card */
  --navy-deep: #061a37;
  --brand: #1d7fe8;         /* the logo's own blue — links, focus, brand marks */
  --brand-2: #0a4da8;
  --brand-dark: #0a4da8;
  --brand-soft: #e8eef7;
  --accent: #c9a227;        /* brass — primary actions only, never decoration */
  --accent-soft: #f0e2b6;
  --good: #0e7a56;
  --warn: #a15c07;
  --danger: #c0392b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 58, .06);
  --shadow: 0 6px 24px rgba(16, 32, 58, .10);
  --shadow-lg: 0 18px 50px rgba(18, 56, 110, .18);
}

* { 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));
}
/* The lockup already carries the wordmark and the tagline; height drives the size and the
   intrinsic width/height on the tag keeps the header from reflowing while it loads. */
.brand-logo { height: 38px; width: auto; display: block; }
@media (max-width: 480px) { .brand-logo { height: 30px; } }
.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); }
/* The nav link rule outranks .nav-cta on specificity, which left white CTA text grey on a
   blue pill. Restate it at matching specificity so the call to action stays readable. */
.site-header nav.links a.nav-cta,
.site-header nav.links a.nav-cta:hover { color: #fff; }

/* ---------- 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; }
}

/* ---------- landing: dark band, floating form, data cards ---------- */

/* Primary action: the one place brass appears. */
.btn-primary, button[type="submit"], .plan-card.is-highlight .plan-cta {
  color: var(--navy-deep);
  background: linear-gradient(180deg, #d9b643, var(--accent));
  box-shadow: 0 6px 16px rgba(201, 162, 39, .3);
}
.btn-primary:hover, button[type="submit"]:hover { color: var(--navy-deep); box-shadow: 0 10px 22px rgba(201, 162, 39, .38); }
.nav-cta { background: var(--navy); box-shadow: none; }
.site-header nav.links a.nav-cta:hover { background: var(--navy-deep); }

/* Data cards — navy, because measured figures should look measured. */
.stat-band { padding: 2.75rem 0 1rem; }
.stat-band > .container > h2 { text-align: center; margin-bottom: 1.5rem; }
.stat-lead { text-align: center; color: var(--muted); margin: 0 auto 1.6rem; max-width: 60ch; }
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat-card {
  background: linear-gradient(160deg, var(--navy), var(--navy-deep));
  color: #fff; border-radius: var(--radius); padding: 1.4rem 1.2rem;
  box-shadow: var(--shadow);
}
.stat-card .figure { display: block; font-size: 1.75rem; font-weight: 850; letter-spacing: -.02em; }
.stat-card .label { display: block; margin-top: .2rem; font-weight: 650; color: rgba(255, 255, 255, .92); }
.stat-card .src { display: block; margin-top: .5rem; font-size: .78rem; color: rgba(255, 255, 255, .6); }

/* Feature row */
.feature-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; margin-top: 1.4rem; }
.feature { text-align: center; }
.feature .ico {
  width: 46px; height: 46px; margin: 0 auto .7rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.2rem;
  background: var(--brand-soft); color: var(--navy);
  border: 1px solid var(--line);
}
.feature h3 { font-size: 1rem; margin: 0 0 .25rem; }
.feature p { color: var(--muted); font-size: .9rem; margin: 0; }

/* Closing band */
.cta-band {
  margin-top: 3rem; padding: 2.5rem 0;
  background: linear-gradient(160deg, var(--navy), var(--navy-deep));
  color: #fff; text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, .8); max-width: 56ch; margin: .4rem auto 1.2rem; }

@media (max-width: 860px) {
  .stat-cards, .feature-row { grid-template-columns: repeat(2, 1fr); }
  .form-section.is-lifted { margin-top: -4rem; }
}
@media (max-width: 520px) {
  .stat-cards, .feature-row { grid-template-columns: 1fr; }
  .hero-dark { padding: 2.5rem 0 6rem; }
}

/* ---------- landing: the photograph is the hero ---------- */
/* Full bleed, with the form floating over its calmer left third. The scrim is a left-to-right
   gradient rather than a flat overlay: the form column needs the contrast, the building on the
   right does not, and darkening the whole image would waste the photograph. */
.hero-photo {
  position: relative;
  background-color: var(--navy-deep);
  background-size: cover;
  background-position: center right;
  padding: 3rem 0;
}
.hero-photo::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg,
    rgba(6, 26, 55, .88) 0%, rgba(6, 26, 55, .70) 42%, rgba(6, 26, 55, .18) 72%,
    rgba(6, 26, 55, .05) 100%);
}
.hero-photo-inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 620px) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

/* The glass card: translucent enough to read the photograph through, opaque enough that the
   form stays legible on any image. */
.form-card.is-glass {
  max-width: none; margin: 0;
  background: rgba(255, 255, 255, .90);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 24px 60px rgba(6, 26, 55, .38);
}

.hero-copy { color: #fff; padding-top: 1.5rem; }
.hero-copy h1 { color: #fff; max-width: 15ch; margin: .9rem 0 .7rem; text-shadow: 0 2px 18px rgba(6, 26, 55, .5); }
.hero-copy .hero-sub { color: rgba(255, 255, 255, .9); max-width: 44ch; font-size: 1.1rem; }
.hero-copy .eyebrow {
  color: var(--accent-soft); background: rgba(201, 162, 39, .18);
  border: 1px solid rgba(201, 162, 39, .4);
}
.hero-copy .hero-points { flex-direction: column; }
.hero-copy .hero-points li { color: rgba(255, 255, 255, .92); }
.hero-copy .hero-points li::before { color: var(--accent); }

@media (max-width: 980px) {
  /* Stacked, form first: on a phone the visitor came to estimate, not to admire a villa. */
  .hero-photo-inner { grid-template-columns: 1fr; }
  .hero-copy { order: -1; padding-top: 0; }
  .hero-copy h1 { max-width: none; }
  .hero-photo::before {
    background: linear-gradient(180deg, rgba(6, 26, 55, .85) 0%, rgba(6, 26, 55, .78) 100%);
  }
}

/* Two short fields on one row: stacked, they read as two separate questions. */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.field-row > p { margin-bottom: 1rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- mobile navigation ---------- */
.nav-toggle {
  display: none;
  margin-left: auto;
  padding: .5rem;
  background: none; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; color: var(--ink);
}
.nav-bars { display: block; width: 22px; }
.nav-bars span {
  display: block; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}
.nav-bars span + span { margin-top: 5px; }
/* The bars become a cross while the panel is open — the button says what it will do next. */
.nav-toggle[aria-expanded="true"] .nav-bars span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-bars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .site-header .nav { position: relative; }
  .site-header nav.links {
    position: absolute; top: calc(100% + .5rem); right: 0; left: 0;
    margin-left: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--card);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: .5rem;
    /* Hidden by default, so no flash of an open menu before the script runs. */
    display: none;
  }
  .site-header nav.links.is-open { display: flex; }
  .site-header nav.links a {
    padding: .75rem .9rem; border-radius: 10px; font-size: 1rem;
  }
  .site-header nav.links a:hover { background: var(--brand-soft); }
  .site-header nav.links a.nav-cta { margin-top: .35rem; justify-content: center; }
}

/* ---------- share link ---------- */
.share { margin: 1.5rem 0; }
.share-out { display: flex; flex-direction: column; gap: .35rem; margin-top: .8rem; max-width: 620px; }
.share-out input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
