/*
  Royal Agency — styles communs
  Pages service, demande, merci et admin. L'accueil a son propre fichier : home.css.
*/
:root {
  --green-900: #0b1b3d;
  --green-800: #13306b;
  --green-700: #1e3a8a;
  --green-500: #f97316;
  --green-100: #eaf1ff;
  --gold: #f97316;
  --gold-soft: #fff1e6;
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #5b6478;
  --line: #e5e9f2;
  --danger: #c0392b;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(11, 27, 61, .06), 0 6px 20px rgba(11, 27, 61, .06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --app: 520px;
  --tabbar: 68px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- Cadre d'application ---------- */
.app { max-width: var(--app); margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; padding-bottom: calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); }
@media (min-width: 560px) {
  body { background: #e2e8f0; }
  .app { box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(11, 27, 61, .12); }
}
.app.has-cta { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* Barre du haut */
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 16px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); }
.appbar.dark { background: var(--green-900); color: #fff; }
.appbar .title { flex: 1; min-width: 0; font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.appbar.dark .icon-btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); color: #fff; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.wa { background: #1fa855; border-color: #1fa855; color: #fff; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; font-size: 1.05rem; }
.brand-mark { width: 36px; height: 36px; background: var(--green-800); color: var(--gold); display: grid; place-items: center; border-radius: var(--radius); flex: none; }
.brand-mark svg { width: 20px; height: 20px; }
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); }

/* Barre d'onglets en bas */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(var(--app), 100%); z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
.tabbar a { display: grid; place-items: center; align-content: center; gap: 3px; font-size: .72rem; font-weight: 600; color: var(--muted); }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--green-800); }
.tabbar a.main { color: #fff; }
.tabbar a.main span.tpill { width: 52px; height: 40px; display: grid; place-items: center; background: var(--green-800); border-radius: var(--radius); margin-top: -2px; }
.tabbar a.main span.label { color: var(--green-800); }

/* Barre d'action fixe en bas */
.cta-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(var(--app), 100%); z-index: 30; display: flex; gap: 10px; align-items: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.cta-bar .sum { flex: 1; min-width: 0; }
.cta-bar .sum small { display: block; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cta-bar .sum strong { font-size: 1.25rem; letter-spacing: -.02em; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px; border-radius: var(--radius); border: 1px solid transparent; font-weight: 700; cursor: pointer; transition: background .15s, transform .08s, opacity .15s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--green-800); color: #fff; }
.btn-primary:hover { background: var(--green-700); }
.btn-gold { background: var(--gold); color: var(--green-900); }
.btn-ghost { background: var(--surface); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--text); }
.btn-wa { background: #1fa855; color: #fff; }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Pages en colonne ---------- */
.page { padding: 4px 16px 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }



.block-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.block-head h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.01em; }
.block-head a { color: var(--green-700); font-weight: 700; font-size: .9rem; }


.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.how { flex: 0 0 72%; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 6px; }
.how .n { width: 30px; height: 30px; display: grid; place-items: center; background: var(--gold-soft); color: #c2410c; font-weight: 800; border-radius: var(--radius); font-size: .9rem; }
.how strong { font-size: 1rem; }
.how span { color: var(--muted); font-size: .9rem; }

.about-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; }
.about-card p { margin: 0; color: var(--muted); }

.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 8px 0 4px; }
.foot a { text-decoration: underline; }

/* ---------- Page service ---------- */
.svc-hero { padding: 6px 16px 22px; background: var(--green-900); color: #fff; display: grid; gap: 12px; }
.svc-hero .ic { width: 64px; height: 64px; border-radius: var(--radius); display: grid; place-items: center; color: #fff; }
.svc-hero .ic svg { width: 32px; height: 32px; }
.svc-hero h1 { margin: 0; font-size: 1.6rem; letter-spacing: -.02em; line-height: 1.15; }
.svc-hero p { margin: 0; color: rgba(255, 255, 255, .78); font-size: .95rem; }

.opts { display: grid; gap: 10px; }
.opt { position: relative; display: grid; gap: 10px; width: 100%; text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.opt .row { display: flex; align-items: center; gap: 12px; }
.opt .radio { width: 22px; height: 22px; flex: none; border: 2px solid #cbd2df; border-radius: 50%; display: grid; place-items: center; }
.opt.selected { border-color: var(--green-800); box-shadow: 0 0 0 3px var(--green-100); }
.opt.selected .radio { border-color: var(--green-800); }
.opt.selected .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green-800); }
.opt .name { flex: 1; min-width: 0; font-weight: 700; }
.opt .price { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; white-space: nowrap; }
.opt .badge-pop { position: absolute; top: -9px; right: 14px; background: var(--gold); color: var(--green-900); font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: var(--radius); }
.opt ul { list-style: none; margin: 0; padding: 0 0 0 34px; display: grid; gap: 4px; color: var(--muted); font-size: .9rem; }
.opt ul li::before { content: "✓  "; color: var(--green-500); font-weight: 800; }

/* ---------- Formulaire ---------- */
.steps-bar { display: flex; gap: 6px; padding: 0 16px 4px; }
.steps-bar span { flex: 1; height: 4px; background: var(--line); border-radius: 2px; transition: background .2s; }
.steps-bar span.on { background: var(--green-700); }
.step-head { padding: 12px 16px 0; }
.step-head small { color: var(--green-700); font-weight: 700; font-size: .8rem; }
.step-head h2 { margin: 2px 0 4px; font-size: 1.45rem; letter-spacing: -.02em; line-height: 1.2; }
.step-head p { margin: 0; color: var(--muted); }
.step-body { padding: 18px 16px 0; }

.list { display: grid; gap: 10px; }
.row-item { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px; cursor: pointer; transition: border-color .15s; }
.row-item:hover { border-color: #cbd2df; }
.row-item .ic { width: 46px; height: 46px; border-radius: var(--radius); display: grid; place-items: center; color: #fff; flex: none; }
.row-item .ic svg { width: 22px; height: 22px; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item strong { display: block; }
.row-item small { color: var(--muted); }
.row-item .chev { color: var(--muted); }
.row-item .chev svg { width: 18px; height: 18px; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: .9rem; }
.field input, .field textarea, .field select { width: 100%; min-height: 50px; padding: 12px 14px; font-size: 16px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); outline: none; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px var(--green-100); }
.field textarea { min-height: 110px; resize: vertical; }
.field .hint { font-size: .8rem; color: var(--muted); font-weight: 500; }

.recap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.recap .top { display: flex; gap: 14px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.recap .top .ic { width: 50px; height: 50px; border-radius: var(--radius); display: grid; place-items: center; color: #fff; flex: none; }
.recap .top .ic svg { width: 24px; height: 24px; }
.recap dl { margin: 0; padding: 6px 16px; }
.recap dl div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.recap dl div:last-child { border-bottom: 0; }
.recap dt { color: var(--muted); }
.recap dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.recap .total { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--green-100); font-weight: 800; }
.recap .total span:last-child { font-size: 1.3rem; letter-spacing: -.02em; }

.error { color: var(--danger); font-size: .9rem; margin-top: 10px; font-weight: 600; }

/* ---------- Merci ---------- */
.done { padding: 28px 16px 0; display: grid; gap: 18px; text-align: center; }
.done .ok { width: 84px; height: 84px; margin: 8px auto 0; display: grid; place-items: center; background: var(--green-800); color: var(--gold); border-radius: var(--radius); animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.done .ok svg { width: 42px; height: 42px; }
.done h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.02em; }
.done > p { margin: 0; color: var(--muted); }
.done .recap { text-align: left; }
.done .actions { display: grid; gap: 10px; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .done .ok { animation: none; } }

/* Squelette de chargement */
.skeleton { background: linear-gradient(90deg, var(--line), #f6f8fc, var(--line)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); min-height: 168px; }
@keyframes sk { to { background-position: -200% 0; } }


/* ---------- Partagé avec l'admin ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.icon-box { width: 44px; height: 44px; display: grid; place-items: center; background: var(--green-100); color: var(--green-800); border-radius: var(--radius); flex: none; }
.icon-box svg { width: 22px; height: 22px; }

/* Pages en colonne : plus large sur ordinateur */
@media (min-width: 560px) {
  .app { max-width: 640px; }
  .tabbar, .cta-bar { width: min(640px, 100%); }
}

/* Boutons colorés */
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #ea580c; }

/* Photo en haut de la page d'un service */
.svc-hero.with-photo { padding-top: 0; }
.svc-hero .svc-photo { max-width: none; width: calc(100% + 32px); margin: 0 -16px; aspect-ratio: 16 / 9; object-fit: cover; mask-image: linear-gradient(to bottom, #000 70%, transparent); -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent); }
.svc-hero.with-photo .ic { margin-top: -44px; position: relative; border: 3px solid var(--green-900); }

/* Apparition douce des pages */
.app > *:not(.cta-bar):not(#tabbar):not(.appbar) { animation: fadeUp .5s cubic-bezier(.2, .7, .2, 1) backwards; }
.app > *:nth-child(2) { animation-delay: .06s; }
.app > *:nth-child(3) { animation-delay: .12s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } }
.opt, .row-item { transition: border-color .2s, box-shadow .2s, transform .2s; }
.opt:hover, .row-item:hover { transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .app > * { animation: none; } .opt:hover, .row-item:hover { transform: none; } }

