/* SmartCHR — styles communs aux trois prototypes (charte reprise de smartchr.fr) */
:root {
  --amber: #f59e0b; --amber-600: #d97706; --amber-700: #b45309; --amber-300: #fbbf24; --amber-50: #fffbeb; --amber-100: #fef3c7;
  --ink: #0f172a; --ink-2: #334155; --muted: #475569; --muted-2: #64748b; --line: #e2e8f0; --line-2: #cbd5e1; --bg: #f8fafc; --card: #ffffff;
  --blue: #2563eb; --blue-50: #eff6ff; --ice: #38bdf8; --ice-50: #f0f9ff; --green: #16a34a; --green-50: #f0fdf4; --red: #dc2626; --red-50: #fef2f2;
  --radius: 16px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- en-tête et téléphone permanent ---- */
#hdr, #mbar { display: contents; }
.sc-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.sc-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; font-size: 18px; }
.sc-logo b { color: var(--amber-600); }
.sc-logo svg { flex: none; }
.sc-header .sc-tag { color: var(--muted-2); font-size: 13px; font-weight: 500; display: none; }
.sc-header .sc-spacer { flex: 1; }
.sc-call { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--amber); color: #111; font-weight: 700; text-decoration: none; white-space: nowrap; box-shadow: 0 4px 14px rgba(245,158,11,.35); transition: transform .15s, box-shadow .15s; }
.sc-call:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,158,11,.45); }
.sc-call .num { font-variant-numeric: tabular-nums; }
.sc-wa { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 999px; background: #e7f8ee; color: #128c4b; text-decoration: none; }
.sc-mobilebar { display: none; }
@media (min-width: 720px) { .sc-header .sc-tag { display: inline; } }
@media (max-width: 719px) {
  .sc-header .sc-call .lbl, .sc-header .sc-call .num { display: none; }
  .sc-header .sc-call { width: 42px; height: 42px; padding: 0; justify-content: center; }
  .sc-mobilebar { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(15,23,42,.08); }
  .sc-mobilebar .sc-call { flex: 1; justify-content: center; }
  body { padding-bottom: 76px; }
}

/* ---- composants ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--muted-2); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #1e293b; }
.btn-amber { background: var(--amber); border-color: var(--amber); color: #111; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--line-2); background: #fff; cursor: pointer; font-weight: 500; font-size: 14px; transition: all .15s; user-select: none; }
.chip:hover { border-color: var(--amber); }
.chip[aria-pressed="true"], .chip.on { border-color: var(--amber-600); background: var(--amber-50); color: var(--amber-700); font-weight: 600; }
.seg { display: inline-flex; padding: 3px; background: #f1f5f9; border-radius: 12px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.field { display: grid; gap: 6px; }
.field > label, .lbl-s { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input { width: 100%; padding: 11px 12px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; }
.input:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
input[type=range] { width: 100%; accent-color: var(--amber-600); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tabnum { font-variant-numeric: tabular-nums; }

/* ---- alertes de règles ---- */
.rules { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rule { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; }
.rule .ic { font-weight: 800; text-align: center; }
.rule.block { background: var(--red-50); color: #991b1b; }
.rule.visit { background: var(--blue-50); color: #1e40af; }
.rule.warn { background: var(--amber-50); color: #92400e; }
.rule.require { background: var(--green-50); color: #166534; }
.rule.info, .rule.tip { background: #f1f5f9; color: var(--ink-2); }
.rule a { font-weight: 600; }

/* ---- prix ---- */
.price-big { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.price-note { font-size: 12px; color: var(--muted-2); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #f1f5f9; color: var(--ink-2); }
.badge.draft { background: #fef3c7; color: #92400e; }

/* ---- fenêtre devis ---- */
dialog.sc-modal { border: 0; border-radius: 20px; padding: 0; background: #fff; color: var(--ink); color-scheme: light; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px rgba(15,23,42,.35); }
dialog.sc-modal::backdrop { background: rgba(15,23,42,.55); backdrop-filter: blur(3px); }
.sc-modal .hd { padding: 20px 22px 0; display: flex; justify-content: space-between; gap: 12px; }
.sc-modal .bd { padding: 16px 22px 22px; display: grid; gap: 12px; }
.sc-modal .x { border: 0; background: #f1f5f9; width: 36px; height: 36px; border-radius: 999px; cursor: pointer; font-size: 18px; }
.sc-modal .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .sc-modal .grid2 { grid-template-columns: 1fr; } }
.consent { display: grid; grid-template-columns: 20px 1fr; gap: 8px; font-size: 12.5px; color: var(--muted); }

/* ---- panneau interne (prix) ---- */
details.sc-admin { font-size: 13px; border: 1px dashed var(--line-2); border-radius: 12px; padding: 10px 12px; background: #fff; }
details.sc-admin summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.sc-admin table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.sc-admin td { padding: 5px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sc-admin td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sc-admin .tot td { font-weight: 800; border-bottom: 0; }

@keyframes sc-flow { to { stroke-dashoffset: -40; } }
@keyframes sc-float { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: .9; } 100% { transform: translateY(-18px); opacity: 0; } }
@keyframes sc-pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
