/* SOS depannage : bouton du heros de l'accueil et fenetre modale (pages/_sos.php). */
:root { --sos-red: #e5372a; --sos-red-deep: #b8261b; --sos-red-soft: #fdecea; --sos-ink: #0e2233; --sos-muted: #475b6b; --sos-line: #d1d8dd; }

/* ---- Bouton dans le heros (a la place de l'ancien encart « observatoire ») ----
   Lecture voulue en un coup d'oeil : icone d'alerte, titre, phrase concrete,
   bouton clair « Demander une intervention » et tarif ecrit en clair. */
.page-home .hero .sos-trigger {
    position: absolute; z-index: 3; right: var(--obs-gutter, var(--gutter, 32px)); bottom: 26px;
    display: grid; gap: 14px; width: 304px; padding: 20px; box-sizing: border-box;
    border: 1px solid #c94249; border-radius: 16px; cursor: pointer; text-align: left;
    color: #fff; background: #8e262c;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35); pointer-events: auto; font: inherit;
    transition: transform .2s ease, border-color .2s ease;
}
.page-home .hero .sos-trigger:hover { transform: translateY(-3px); border-color: var(--sos-red); }
.page-home .hero .sos-trigger:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.sos-trigger-head { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px 10px; align-items: center; }
.sos-trigger-icon { display: grid; place-items: center; width: 24px; height: 24px; color: #fff; }
.sos-trigger-icon svg { display: block; width: 24px; height: 24px; }
.sos-trigger-text { display: contents; }
.sos-trigger-sub { grid-column: 1 / -1; }
.sos-trigger-title { font-size: 1.12rem; font-weight: 800; line-height: 1.15; color: #fff; letter-spacing: -.01em; }
.sos-trigger-sub { font-size: .9rem; line-height: 1.5; color: #fff0ef; }
.sos-trigger-cta {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 14px;
    border-radius: 8px; background: #fff7f5; color: #781d27; font-size: .92rem; font-weight: 800; text-align: center; white-space: normal;
    transition: background .2s ease;
}
.page-home .hero .sos-trigger:hover .sos-trigger-cta { background: #fff; }
.sos-trigger-rate { font-size: .74rem; font-weight: 600; color: #ffe5e3; text-align: center; }
.sos-flag i {
    width: 8px; height: 8px; border-radius: 50%; background: var(--sos-red);
    box-shadow: 0 0 0 0 rgba(229, 55, 42, .7); animation: sos-pulse 1.8s ease-out infinite;
}
@keyframes sos-pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 55, 42, .7); } 80%, 100% { box-shadow: 0 0 0 10px rgba(229, 55, 42, 0); } }
@media (prefers-reduced-motion: reduce) { .sos-trigger-icon::after, .sos-flag i { animation: none; } }

/* Sous 1240 px l'encart lateral n'a plus de place : carte pleine largeur sous le texte du heros. */
@media (max-width: 1240px) {
    .page-home .hero .hero-inner { flex-wrap: wrap; }
    .page-home .hero .sos-trigger {
        position: relative; right: auto; bottom: auto; flex: 1 1 100%; width: 100%; max-width: 560px; margin: 26px 0 40px;
    }
}
/* Tablette : texte a gauche, bouton a droite, sur une seule bande. */
@media (min-width: 640px) and (max-width: 1240px) {
    .page-home .hero .sos-trigger { grid-template-columns: 1fr auto; align-items: center; column-gap: 18px; row-gap: 8px; max-width: 720px; }
    .page-home .hero .sos-trigger-head { grid-row: 1 / span 2; }
    .page-home .hero .sos-trigger-cta { grid-column: 2; }
    .page-home .hero .sos-trigger-rate { grid-column: 2; }
}

@media (max-width: 639px) {
    .page-home .hero .sos-trigger { gap: 18px; }
    .page-home .hero .sos-trigger-title { font-size: 1.35rem; line-height: 1.2; }
    .page-home .hero .sos-trigger-rate { font-size: .78rem; line-height: 1.4; font-weight: 500; }
    .page-home .hero .sos-trigger:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .page-home .hero .sos-trigger { transition: none; }
    .page-home .hero .sos-trigger:hover { transform: none; }
}

/* ---- Fenetre modale ---- */
html.sos-lock { overflow: hidden; }
.sos-dialog {
    width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 18px;
    color: var(--sos-ink); background: #fff; box-shadow: 0 40px 120px rgba(4, 12, 20, .45); overflow: auto;
}
.sos-dialog::backdrop { background: rgba(6, 14, 22, .62); backdrop-filter: blur(6px); }
.sos-dialog[open] { animation: sos-in .22s ease-out; }
@keyframes sos-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.sos-sheet { padding: 28px 32px 30px; }
.sos-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.sos-flag { display: inline-flex; align-items: center; gap: 8px; color: var(--sos-red-deep); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.sos-head h2 { margin: 8px 0 6px; font-size: 1.9rem; line-height: 1.1; letter-spacing: -.02em; color: var(--sos-ink); }
.sos-head p { margin: 0; color: var(--sos-muted); font-size: .98rem; line-height: 1.5; }
.sos-close {
    width: 44px; height: 44px; border: 1px solid var(--sos-line); border-radius: 50%; background: #fff;
    color: var(--sos-ink); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.sos-close:hover { background: #f3f5f7; }
.sos-warning { margin: 22px 0 18px; padding: 14px 16px; border-left: 4px solid var(--sos-red); border-radius: 10px; background: var(--sos-red-soft); }
.sos-warning strong { display: block; color: var(--sos-red-deep); font-size: .95rem; }
.sos-warning p { margin: 4px 0 0; color: #5b2420; font-size: .88rem; line-height: 1.5; }
.sos-errors { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: var(--sos-red-soft); color: var(--sos-red-deep); font-size: .9rem; font-weight: 600; }
.sos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.sos-field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.sos-field.sos-full { grid-column: 1 / -1; }
.sos-field > span { font-size: .86rem; font-weight: 700; color: var(--sos-ink); }
.sos-field small { font-weight: 500; color: var(--sos-muted); }
.sos-field input, .sos-field textarea {
    width: 100%; box-sizing: border-box; min-height: 48px; padding: 12px 14px; border: 1.5px solid var(--sos-line); border-radius: 10px;
    background: #fff; color: var(--sos-ink); font: inherit; font-size: 1rem;
}
.sos-field textarea { min-height: 128px; resize: vertical; line-height: 1.5; }
.sos-field input:focus, .sos-field textarea:focus { outline: none; border-color: var(--sos-ink); box-shadow: 0 0 0 3px rgba(14, 34, 51, .12); }
.sos-field em, .sos-check em { font-style: normal; color: var(--sos-red-deep); font-size: .82rem; font-weight: 600; }
.sos-field em:empty, .sos-check em:empty { display: none; }
.sos-field.is-error input, .sos-field.is-error textarea { border-color: var(--sos-red); }
.sos-check { display: grid; grid-template-columns: 22px 1fr; gap: 4px 12px; align-items: start; margin-top: 14px; cursor: pointer; }
.sos-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--sos-red); }
.sos-check span { font-size: .9rem; line-height: 1.45; color: var(--sos-ink); }
.sos-check a { color: var(--sos-ink); text-decoration: underline; }
.sos-check em { grid-column: 2; }
.sos-hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.sos-submit {
    display: block; width: 100%; min-height: 54px; margin-top: 22px; border: 0; border-radius: 12px; cursor: pointer;
    background: var(--sos-red); color: #fff; font: inherit; font-size: 1.02rem; font-weight: 800; letter-spacing: .01em;
}
.sos-submit:hover { background: var(--sos-red-deep); }
.sos-submit:disabled { opacity: .65; cursor: progress; }
.sos-done { padding: 26px 0 0; text-align: center; }
.sos-done-mark { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #e6f6ec; color: #0d7a43; font-size: 1.9rem; font-weight: 800; }
.sos-done h3 { margin: 16px 0 6px; font-size: 1.4rem; color: var(--sos-ink); }
.sos-done p { margin: 0 auto; max-width: 440px; color: var(--sos-muted); line-height: 1.5; }
.sos-done .sos-ref { margin-top: 12px; font-size: .88rem; }
.sos-done .sos-ref b { font-family: ui-monospace, Menlo, monospace; color: var(--sos-ink); }
@media (max-width: 600px) {
    .sos-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
    .sos-sheet { padding: 20px 16px 24px; }
    .sos-grid { grid-template-columns: 1fr; }
    .sos-head h2 { font-size: 1.6rem; }
}
.sos-dialog { pointer-events: auto; }
