/* ==========================================================================
   MENDES SOLAR — Espace Couvreur
   Charte inspirée de mendes-solar.fr (bleu marine #07327d, ton premium B2B)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;1,9..144,400;1,9..144,600&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #07327d;
  --navy-2: #0a3d94;
  --navy-dark: #051f4d;
  --navy-900: #04173a;
  --ink: #0b1220;
  --muted: #5b6675;
  --line: #e4e8ef;
  --bg: #f5f7fa;
  --paper: #ffffff;
  --accent: #f2a516;      /* solaire, usage parcimonieux */
  --accent-soft: #fff4df;
  --ok: #1a8f5a;
  --danger: #c0362c;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 10px 40px -18px rgba(7, 50, 125, 0.35);
  --shadow-sm: 0 4px 18px -10px rgba(7, 50, 125, 0.3);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

/* Le attribut [hidden] doit toujours l'emporter, même sur .auth-wrap (display:grid) */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; letter-spacing: -0.01em; }
em, .em { font-family: var(--serif); font-style: italic; color: var(--accent); }

.container { width: min(1180px, 92vw); margin-inline: auto; }

/* ---------- Header / nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-weight: 600; font-size: 20px; color: var(--navy); }
.brand__mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  display: grid; place-items: center; color: #fff; font-family: var(--sans); font-weight: 700; font-size: 15px;
  box-shadow: var(--shadow-sm);
}
.brand small { display:block; font-family: var(--sans); font-weight: 500; font-size: 11px; letter-spacing:.14em; text-transform: uppercase; color: var(--muted); }
.brand__chip { background:#fff; border-radius:10px; padding:5px 9px; display:inline-flex; align-items:center; box-shadow: var(--shadow-sm); }
.brand__logo { height: 36px; width:auto; display:block; }
.brand__tag { font-family: var(--sans); font-weight:600; font-size:11px; letter-spacing:.14em; text-transform:uppercase; color: var(--muted); }
.app-nav .brand__tag { color:#c6d2ec; }
.nav__links { display: flex; align-items: center; gap: 26px; }
.nav__links a { font-size: 14.5px; font-weight: 500; color: var(--ink); }
.nav__links a:hover { color: var(--navy); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  padding: 13px 22px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--navy-2); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--navy); }
.btn--light { background:#fff; color: var(--navy); }
.btn--accent { background: var(--accent); color: #201400; }
.btn--accent:hover { filter: brightness(1.04); }
.btn--block { width: 100%; }
.btn--sm { padding: 9px 15px; font-size: 13.5px; border-radius: 10px; }
.btn[disabled] { opacity:.5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    linear-gradient(90deg, rgba(4,23,58,.95) 0%, rgba(5,31,77,.85) 34%, rgba(5,31,77,.48) 64%, rgba(7,50,125,.28) 100%),
    linear-gradient(180deg, rgba(4,23,58,.20), rgba(4,23,58,.60)),
    var(--navy-900) url('/img/hero-toiture-max-rouge.jpg') center/cover no-repeat;
  color: #fff;
}
.hero__inner { padding: 104px 0 118px; }
.hero__credit {
  position: absolute; right: 14px; bottom: 12px; z-index: 2;
  font-size: 10.5px; letter-spacing: .04em; color: rgba(255,255,255,.62);
}
.eyebrow {
  display:inline-flex; align-items:center; gap:9px;
  font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600;
  color: #cdd8ef; margin-bottom: 22px;
}
.eyebrow::before { content:""; width: 26px; height:1px; background: var(--accent); display:inline-block; }
.hero h1 { font-size: clamp(38px, 6vw, 68px); margin: 0 0 22px; max-width: 15ch; }
.hero p.lead { font-size: clamp(16px, 2.1vw, 20px); color: #d5deef; max-width: 60ch; margin: 0 0 34px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__stats { display:flex; gap: 48px; margin-top: 64px; flex-wrap: wrap; }
.hero__stat b { font-family: var(--serif); font-size: 34px; display:block; }
.hero__stat span { color:#b9c6e2; font-size: 13.5px; }

/* ---------- Marquee ---------- */
.marquee { background: var(--navy-dark); color:#9fb3da; overflow:hidden; border-top:1px solid rgba(255,255,255,.08); }
.marquee__t { display:flex; gap: 40px; white-space:nowrap; padding: 14px 0; animation: slide 28s linear infinite; font-size: 13.5px; letter-spacing:.08em; }
.marquee__t span::before { content:"✦"; color: var(--accent); margin-right: 40px; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
section.block { padding: 88px 0; }
.section-head { max-width: 62ch; margin-bottom: 48px; }
.section-head .eyebrow { color: var(--navy); }
.section-head .eyebrow::before { background: var(--navy); }
.section-head h2 { font-size: clamp(28px, 4vw, 44px); color: var(--ink); margin: 0 0 16px; }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }

/* ---------- Steps / how it works ---------- */
.steps { display:grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { background: var(--paper); border:1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; box-shadow: var(--shadow-sm); }
.step__n { font-family: var(--serif); font-size: 15px; color: var(--accent); font-weight: 600; }
.step h3 { font-size: 19px; margin: 10px 0 8px; color: var(--ink); }
.step p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* ---------- Tile cards showcase ---------- */
.tiles-grid { display:grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.tilecard { background: var(--paper); border:1px solid var(--line); border-radius: var(--radius); overflow:hidden; box-shadow: var(--shadow-sm); }
.tilecard__swatch { height: 130px; overflow: hidden; background: #f0f2f5; }
.tilecard__swatch img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tilecard__body { padding: 18px 18px 20px; }
.tilecard h3 { font-size: 17px; margin: 0 0 4px; color: var(--ink); }
.tilecard p { font-size: 13.5px; color: var(--muted); margin: 0; }
.sw-ardoise { background: linear-gradient(135deg,#1c2530,#39485a); }
.sw-max-rouge { background: linear-gradient(135deg,#7a2e21,#b0523c); }
.sw-terre-noire { background: linear-gradient(135deg,#20242b,#3b4048); }
.sw-terre-rouge { background: linear-gradient(135deg,#8a3b26,#c26b45); }

/* ---------- Video tutoriel ---------- */
.video-wrap { max-width: 980px; margin: 0 auto; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); background: #04173a; }
.video-wrap video { width: 100%; display: block; aspect-ratio: 1920 / 1002; }
.video-note { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 16px; }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(160deg, var(--navy), var(--navy-2)); color:#fff; border-radius: var(--radius-lg); padding: 56px; box-shadow: var(--shadow); }
.cta-band h2 { color:#fff; font-size: clamp(26px,3.6vw,40px); margin:0 0 12px; }
.cta-band p { color:#d5deef; margin: 0 0 26px; max-width: 52ch; }

/* ---------- Footer ---------- */
.footer { background: var(--navy-900); color:#aebbd6; padding: 60px 0 40px; margin-top: 0; }
.footer__grid { display:grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer h4 { color:#fff; font-family: var(--sans); font-size: 12.5px; letter-spacing:.12em; text-transform: uppercase; margin: 0 0 16px; }
.footer a, .footer p { font-size: 14px; color:#aebbd6; margin: 0 0 9px; display:block; }
.footer__brand { font-family: var(--serif); font-size: 22px; color:#fff; margin-bottom: 12px; }
.footer__bottom { border-top:1px solid rgba(255,255,255,.1); margin-top:40px; padding-top:22px; font-size: 13px; color:#7f8fb3; }

/* ==========================================================================
   ESPACE APP (espace.html)
   ========================================================================== */
.app-bg { min-height: 100vh; background: var(--bg); }

.auth-wrap { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 40px 0; }
.card {
  background: var(--paper); border:1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 34px;
}
.auth-card { width: min(460px, 92vw); }
.auth-tabs { display:flex; gap: 6px; background: var(--bg); padding: 5px; border-radius: 12px; margin-bottom: 24px; }
.auth-tabs button { flex:1; border:0; background: transparent; padding: 10px; border-radius: 9px; font-weight:600; font-size: 14.5px; color: var(--muted); cursor:pointer; font-family: var(--sans); }
.auth-tabs button.active { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }

label.field { display:block; margin-bottom: 15px; }
label.field span { display:block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
label.field small { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%; font-family: var(--sans); font-size: 15px; color: var(--ink);
  padding: 11px 13px; border:1px solid var(--line); border-radius: 10px; background:#fff;
  transition: border .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(7,50,125,.12); }
.row-2 { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display:grid; grid-template-columns: 1fr 2fr; gap: 12px; }

.alert { padding: 11px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.alert--error { background:#fdeceb; color: var(--danger); border:1px solid #f5cfcc; }
.alert--info { background: var(--accent-soft); color:#7a5300; border:1px solid #f6e2bd; }
.alert--ok { background:#e8f6ef; color: var(--ok); border:1px solid #c3e6d4; }

/* App header */
.app-nav { background: var(--navy); color:#fff; }
.app-nav .nav__inner { height: 66px; }
.app-nav .brand { color:#fff; }
.app-nav .brand small { color:#b9c6e2; }
.app-nav__user { display:flex; align-items:center; gap: 16px; font-size: 14px; color:#d5deef; }

.page { padding: 40px 0 80px; }
.page-head { display:flex; align-items:flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: 32px; color: var(--ink); margin: 0; }
.page-head p { color: var(--muted); margin: 6px 0 0; }

/* Projects table */
.projects { display:grid; gap: 14px; }
.proj {
  background:#fff; border:1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  display:grid; grid-template-columns: 1.4fr 1fr 1fr 1fr auto; gap: 16px; align-items:center; box-shadow: var(--shadow-sm);
}
.proj b { font-size: 15px; }
.proj .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing:.06em; }
.proj .v { font-size: 15px; font-weight:600; color: var(--ink); }
.badge { display:inline-block; font-size: 12px; font-weight:600; padding: 4px 10px; border-radius: 999px; }
.badge--bat { background: var(--accent-soft); color:#7a5300; }
.badge--nobat { background:#eef1f6; color: var(--muted); }
.empty { text-align:center; padding: 60px 20px; color: var(--muted); background:#fff; border:1px dashed var(--line); border-radius: var(--radius); }

/* Wizard */
.wizard { display:grid; grid-template-columns: 260px 1fr; gap: 30px; }
.wizard__steps { position: sticky; top: 90px; align-self:start; display:grid; gap: 4px; }
.wstep { display:flex; gap: 12px; align-items:flex-start; padding: 12px 14px; border-radius: 12px; color: var(--muted); }
.wstep.active { background:#fff; box-shadow: var(--shadow-sm); color: var(--ink); }
.wstep.done { color: var(--ok); }
.wstep .dot { width: 24px; height:24px; border-radius:50%; border:2px solid var(--line); display:grid; place-items:center; font-size: 12px; font-weight:700; flex-shrink:0; }
.wstep.active .dot { border-color: var(--navy); color: var(--navy); }
.wstep.done .dot { border-color: var(--ok); background: var(--ok); color:#fff; }
.wstep b { font-size: 14.5px; display:block; }
.wstep span { font-size: 12.5px; }

.panel { background:#fff; border:1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-sm); }
.panel h2 { font-size: 24px; color: var(--ink); margin: 0 0 6px; }
.panel .sub { color: var(--muted); margin: 0 0 24px; font-size: 15px; }
.panel__actions { display:flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 22px; border-top:1px solid var(--line); }

/* Tile selection cards */
.pick-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.pick {
  border:2px solid var(--line); border-radius: var(--radius); padding: 16px; cursor:pointer; background:#fff;
  display:flex; gap: 14px; align-items:center; transition: border .15s ease, box-shadow .15s ease;
}
.pick:hover { border-color: #c3ccdb; }
.pick.selected { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(7,50,125,.1); }
.pick__sw { width: 48px; height: 48px; border-radius: 10px; flex-shrink:0; }
.pick__img { width: 60px; height: 60px; border-radius: 10px; object-fit: contain; background:#f0f2f5; flex-shrink:0; border:1px solid var(--line); }
.pick b { display:block; font-size: 15px; }
.pick span { font-size: 13px; color: var(--muted); }

/* Radio option cards */
.opt {
  border:2px solid var(--line); border-radius: var(--radius); padding: 18px 20px; cursor:pointer; background:#fff;
  display:flex; align-items:center; justify-content: space-between; gap: 16px; margin-bottom: 12px; transition: border .15s ease;
}
.opt:hover { border-color: #c3ccdb; }
.opt.selected { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(7,50,125,.1); }
.opt.disabled { opacity:.5; cursor: not-allowed; }
.opt__l b { font-size: 16px; }
.opt__l p { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }
.opt__price { text-align:right; }
.opt__price b { font-size: 18px; color: var(--navy); }
.opt__price span { display:block; font-size: 12px; color: var(--muted); }

.check { display:flex; align-items:center; gap: 10px; padding: 16px; border:1px solid var(--line); border-radius: 12px; margin-top: 8px; }
.check input { width: auto; }

/* Power readout */
.readout { display:flex; gap: 26px; flex-wrap: wrap; background: linear-gradient(160deg,var(--navy),var(--navy-2)); color:#fff; border-radius: var(--radius); padding: 22px 26px; margin: 20px 0 4px; }
.readout div b { font-family: var(--serif); font-size: 28px; display:block; }
.readout div span { font-size: 12.5px; color:#c6d2ec; }

/* Recap / quote */
.quote { border:1px solid var(--line); border-radius: var(--radius); overflow:hidden; }
.quote__row { display:flex; justify-content: space-between; padding: 12px 18px; font-size: 14.5px; border-bottom:1px solid var(--line); }
.quote__row:last-child { border-bottom: 0; }
.quote__row.total { background: var(--navy); color:#fff; font-weight:700; font-size: 16px; }
.quote__row.sub { background:#f8fafc; font-weight:600; }
.quote__row .d { color: var(--ink); }
.quote__row .p { font-weight:600; }

.split { display:grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items:start; }
.mini-note { font-size: 13px; color:#7a5300; background: var(--accent-soft); border:1px solid #f6e2bd; padding: 12px 14px; border-radius: 10px; }

.tag-est { display:inline-block; background: var(--accent-soft); color:#7a5300; font-weight:600; font-size:12px; padding:4px 10px; border-radius:999px; margin-bottom: 10px; }

/* ---------- Admin ---------- */
.stats { display:grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }
.statcard { background:#fff; border:1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.statcard b { display:block; font-family: var(--serif); font-size: 30px; color: var(--navy); line-height:1.1; }
.statcard span { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.admin-section { margin-top: 34px; }
.admin-section h2 { font-size: 22px; color: var(--ink); margin: 0 0 4px; }
.admin-section p.sub { color: var(--muted); margin: 0 0 16px; font-size: 14.5px; }

.table-wrap { overflow-x:auto; background:#fff; border:1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table.table { width:100%; border-collapse: collapse; font-size: 14px; }
table.table th { text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.05em; color: var(--muted); font-weight:600; padding: 13px 16px; border-bottom:1px solid var(--line); white-space:nowrap; background:#f8fafc; }
table.table td { padding: 13px 16px; border-bottom:1px solid var(--line); color: var(--ink); vertical-align: top; }
table.table tr:last-child td { border-bottom:0; }
table.table td b { font-weight:600; }
table.table td .muted { color: var(--muted); font-size: 12.5px; }
.num { text-align:right; font-variant-numeric: tabular-nums; white-space:nowrap; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps, .tiles-grid { grid-template-columns: repeat(2, 1fr); }
  .wizard { grid-template-columns: 1fr; }
  .wizard__steps { position: static; grid-auto-flow: column; overflow:auto; }
  .split, .pick-grid { grid-template-columns: 1fr; }
  .proj { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
}
