/* ============================================================
   Ma fiche en 3 minutes — Design system (identité B : vert sapin)
   Tokens et composants partagés (login, app, compte).
   La landing index.html garde son CSS autonome.
   ============================================================ */

:root {
  --green: #15574D;
  --green-deep: #0F4239;
  --green-bright: #1F6E5F;
  --paper: #F3F2EE;
  --paper-light: #FAFAF8;
  --ink: #232320;
  --ink-soft: #5A5A54;
  --line: #DAD8D0;
  --gold: #C9A227;
  --red: #B4483A;
  --red-light: #FBEFEC;
  --green-ok: #1A7A4A;
  --green-ok-light: #EAF4EE;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.script { font-family: 'Lobster', cursive; font-weight: 400; }

.paper-texture {
  background-color: #EDEDEA;
  background-image:
    repeating-radial-gradient(circle at 20% 30%, rgba(255,255,255,0.5) 0px, rgba(255,255,255,0) 60px),
    repeating-radial-gradient(circle at 80% 70%, rgba(255,255,255,0.4) 0px, rgba(255,255,255,0) 80px),
    repeating-linear-gradient(115deg, rgba(0,0,0,0.015) 0px, rgba(0,0,0,0.015) 1px, transparent 1px, transparent 7px),
    repeating-linear-gradient(25deg, rgba(0,0,0,0.012) 0px, rgba(0,0,0,0.012) 1px, transparent 1px, transparent 9px);
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 28px; }

/* ─── NAV (app) ─── */
.appnav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,248,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.appnav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-family: 'Lobster', cursive; font-size: 23px; color: var(--green); text-decoration: none; }
.appnav-right { display: flex; align-items: center; gap: 16px; }
.appnav-right a { text-decoration: none; color: var(--ink-soft); font-size: 14px; font-weight: 500; }
.appnav-right a:hover { color: var(--green); }

.credit-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green); color: #fff; font-weight: 600; font-size: 14px;
  padding: 7px 15px; border-radius: 40px;
}
.credit-pill .amount { font-weight: 700; }

/* ─── PASSWORD STRENGTH RULES ─── */
.pw-rule { color: var(--ink-soft); transition: color .15s; }
.pw-rule.ok { color: var(--green-ok); font-weight: 600; }

/* ─── BUTTONS ─── */
.btn-primary {
  background: var(--green); color: #fff; text-decoration: none; border: none; cursor: pointer;
  padding: 14px 30px; border-radius: 8px; font-weight: 600; font-size: 16px;
  font-family: 'Inter', sans-serif; transition: transform .15s, background .2s; display: inline-block;
  box-shadow: 0 4px 16px rgba(21,87,77,0.22);
}
.btn-primary:hover { background: var(--green-deep); transform: translateY(-2px); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
  background: transparent; color: var(--green); text-decoration: none; cursor: pointer;
  padding: 13px 26px; border-radius: 8px; font-weight: 600; font-size: 15px;
  border: 1.5px solid var(--line); transition: border-color .2s; display: inline-block;
  font-family: 'Inter', sans-serif;
}
.btn-ghost:hover { border-color: var(--green); }

/* ─── CARDS / FORMS ─── */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px;
}
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field input[type=email], .field input[type=password], .field input[type=text], .field select {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 8px;
  font-size: 15px; font-family: 'Inter', sans-serif; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--green); }

.msg { margin-top: 14px; font-size: 14.5px; min-height: 20px; }
.msg.error { color: var(--red); font-weight: 600; }
.msg.success { color: var(--green-ok); font-weight: 600; }

.section-title {
  font-family: 'Lobster', cursive; font-weight: 400;
  font-size: clamp(28px, 5vw, 42px); color: var(--green); line-height: 1.1;
}

/* ─── RADIO (choix unique : niveau, format) ─── */
.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-opt {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 15px; background: #fff;
  transition: border-color .2s, background .2s; flex: 1 1 200px;
}
.radio-opt:hover { border-color: var(--green-bright); }
.radio-opt input { width: 18px; height: 18px; accent-color: var(--green); flex-shrink: 0; }
.radio-opt.on { border-color: var(--green); background: #F2F7F5; }
.radio-opt .lbl { font-size: 14.5px; font-weight: 500; }

/* ─── ESTIMATE BOX ─── */
.estimate {
  margin-top: 14px; border: 1px solid var(--green); background: #F2F7F5;
  border-radius: 12px; padding: 14px 18px; display: flex; align-items: center; gap: 14px;
}
.estimate .cost {
  font-family: 'Lobster', cursive; font-size: 28px; color: var(--green); line-height: 1; flex-shrink: 0;
}
.estimate .detail { font-size: 14px; color: var(--ink-soft); }
.estimate .detail strong { color: var(--ink); }
.estimate.warn { border-color: var(--red); background: var(--red-light); }
.estimate.warn .cost { color: var(--red); }

/* ─── PROGRESS BAR ─── */
.progress-wrap {
  max-width: 440px; margin: 22px auto 0; height: 10px; background: var(--line);
  border-radius: 20px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--green-bright), var(--gold));
  border-radius: 20px; transition: width .5s ease;
}
.progress-pct { margin-top: 8px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }

/* ─── TOGGLES ─── */
.toggle-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.toggle {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fff;
  transition: border-color .2s, background .2s;
}
.toggle:hover { border-color: var(--green-bright); }
.toggle input { width: 18px; height: 18px; accent-color: var(--green); }
.toggle.on { border-color: var(--green); background: #F2F7F5; }
.toggle-label { font-size: 14.5px; font-weight: 500; }

/* ─── STEP HEADERS ─── */
.step-head { display: flex; align-items: center; gap: 12px; margin: 28px 0 14px; }
.step-badge {
  font-family: 'Lobster', cursive; font-size: 26px; color: var(--green);
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--paper); border-radius: 10px; flex-shrink: 0;
}
.step-head h3 { font-size: 18px; font-weight: 700; }

/* ─── DROP ZONE ─── */
.drop {
  border: 2px dashed var(--line); border-radius: 12px; padding: 36px; text-align: center;
  cursor: pointer; transition: border-color .2s, background .2s; background: #fff;
}
.drop:hover, .drop.over { border-color: var(--green); background: rgba(21,87,77,0.03); }
.drop .big { font-size: 16px; font-weight: 600; color: var(--green); }
.drop .small { font-size: 13.5px; color: var(--ink-soft); margin-top: 6px; }
.drop.has-file { border-style: solid; border-color: var(--green); background: #F2F7F5; }

/* ─── TABS ─── */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 8px 0 22px; flex-wrap: wrap; }
.tab {
  background: none; border: none; cursor: pointer; padding: 11px 16px; font-size: 14.5px;
  font-weight: 600; color: var(--ink-soft); border-bottom: 2.5px solid transparent;
  font-family: 'Inter', sans-serif; margin-bottom: -1px;
}
.tab:hover { color: var(--green); }
.tab.active { color: var(--green); border-bottom-color: var(--green); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── FICHE RENDER ─── */
.fiche h1 { font-family: 'Lobster', cursive; font-weight: 400; font-size: 30px; color: var(--green); margin: 4px 0 14px; }
.fiche h2 { font-size: 19px; color: var(--green-deep); margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.fiche h3 { font-size: 16px; margin: 18px 0 8px; }
.fiche h4 { font-size: 14px; color: var(--ink-soft); margin: 12px 0 6px; }
.fiche p { font-size: 15px; margin-bottom: 10px; }
.fiche ul, .fiche ol { padding-left: 22px; margin-bottom: 10px; }
.fiche li { font-size: 15px; margin-bottom: 4px; }
.fiche strong { font-weight: 600; }
.fiche code { font-family: ui-monospace, monospace; font-size: .85em; background: rgba(21,87,77,0.08); padding: 1px 5px; border-radius: 3px; color: var(--green-deep); }
.fiche hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.fiche blockquote { font-size: 14px; font-style: italic; color: var(--ink-soft); border-left: 3px solid var(--line); padding: 6px 14px; margin: 8px 0; }
.fiche table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0 16px; }
.fiche th { background: var(--green-deep); color: #fff; padding: 8px 12px; text-align: left; font-size: 13px; }
.fiche td { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.enc { border-radius: 8px; padding: 11px 15px; margin: 8px 0; border-left: 3px solid; font-size: 14.5px; }
.enc-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.enc-def { background: #EBF4FF; border-color: #3182CE; } .enc-def .enc-label { color: #2C5A8A; }
.enc-art { background: #F6F1FB; border-color: #805AD5; } .enc-art .enc-label { color: #5B3E96; }
.enc-arr { background: #FFF8F0; border-color: #DD6B20; } .enc-arr .enc-label { color: #9C4A12; }
.enc-vig { background: #FBEFEC; border-color: var(--red); } .enc-vig .enc-label { color: #8A2E22; }
.enc-ex  { background: #EFF8F1; border-color: var(--green-ok); } .enc-ex .enc-label { color: #14603A; }
.enc-enr { background: #FBF6E7; border-color: var(--gold); } .enc-enr .enc-label { color: #8A6D17; }

/* ─── EXPORT GRID / PACKS ─── */
.dl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dl-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.dl-card h4 { font-size: 15px; margin-bottom: 12px; }
.dl-card .btn-ghost { display: block; text-align: center; margin-bottom: 8px; padding: 10px; font-size: 14px; }

.pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pack {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px 22px;
  display: flex; flex-direction: column;
}
.pack.featured { border: 2px solid var(--green); position: relative; box-shadow: 0 10px 30px rgba(21,87,77,0.1); }
.pack-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 13px; border-radius: 30px; white-space: nowrap;
}
.pack-name { font-size: 14px; font-weight: 600; color: var(--ink-soft); margin-bottom: 10px; }
.pack-price { font-size: 34px; font-weight: 700; color: var(--green); line-height: 1; }
.pack-unit { font-size: 13.5px; color: var(--ink-soft); margin: 6px 0 18px; }
.pack-feat { list-style: none; margin-bottom: 22px; flex-grow: 1; }
.pack-feat li { font-size: 14px; padding: 6px 0 6px 24px; position: relative; }
.pack-feat li::before { content: "✓"; position: absolute; left: 0; color: var(--green-bright); font-weight: 700; }

/* ─── MISC ─── */
.spinner {
  width: 44px; height: 44px; border: 4px solid var(--line); border-top-color: var(--green);
  border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }
.muted { color: var(--ink-soft); font-size: 14px; }
.hide { display: none !important; }
.table-list { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-list th { text-align: left; color: var(--ink-soft); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table-list td { padding: 8px 10px; border-bottom: 1px solid var(--line); }

@media (max-width: 760px) {
  .toggle-grid, .dl-grid, .pack-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto; } }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--green-bright); outline-offset: 2px; }
