/* ==========================================================================
   PRENDRE DE L'AIR - OUTIL INTERACTIF DE RESPIRATION & ANCRAGE (MarocPsy)
   Chargé exclusivement sur la page /prendre-de-l-air
   ========================================================================== */

.breath-page-wrap {
    padding-bottom: 3rem;
}

.breath-page {
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* --------------------------------------------------------------------------
   1. HERO MINIMALISTE & ÉPURÉ
   -------------------------------------------------------------------------- */
.breath-hero {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.35rem 1.5rem;
    text-align: start;
}

.breath-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #0284c7;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.breath-hero h1 {
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.45rem;
    line-height: 1.25;
}

.breath-hero-sub {
    margin: 0 0 1rem;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 820px;
}

.breath-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.breath-sos-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    background: #e8f4fa;
    color: #246581;
    font-size: 0.88rem;
    font-weight: 600;
    padding: .55rem .9rem;
    border-radius: 6px;
    border: 1px solid #cde4ef;
    cursor: pointer;
    transition: background 0.16s ease;
}

.breath-sos-btn:hover {
    background: #dceef7;
    border-color: #a9cfdf;
}

.breath-hero-emergency-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: .55rem .9rem;
    border-radius: 6px;
    border: 1px solid #eadde0;
    background: transparent;
    color: #99505b;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.breath-hero-emergency-link:hover {
    background: #fff4f5;
    border-color: #dcbfc5;
}

/* --------------------------------------------------------------------------
   2. NAVIGATION RAPIDE (BARRE SEGMENTÉE D'OUTILS)
   -------------------------------------------------------------------------- */
.breath-mode-tabs-wrap {
    width: 100%;
}

.breath-mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.3rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    width: 100%;
}

.breath-mode-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border-radius: 7px;
    border: 1px solid transparent;
    background: transparent;
    color: #475569;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    transition: all 0.16s ease;
}

.breath-tab-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.breath-mode-tab:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.breath-mode-tab.is-active {
    background: #ffffff;
    color: #0284c7;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.breath-mode-tab.is-active .breath-tab-icon {
    background: #0284c7;
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   3. SCÈNE DE RESPIRATION (BULLE ORGANIQUE + PAYSAGE ATLAS & OCÉAN)
   -------------------------------------------------------------------------- */
.breath-stage-card {
    --b-bg-top: #071126;
    --b-bg-mid: #0c2342;
    --b-bg-bot: #0f3659;
    --b-text: #f8fafc;
    --b-text-sub: #bae6fd;
    --b-orb-1: rgba(56, 189, 248, 0.85);
    --b-orb-2: rgba(45,115,212, 0.65);
    --b-petal: rgba(56, 189, 248, 0.22);
    --b-mountain-1: #1e3a5f;
    --b-mountain-2: #0f2942;
    --b-wave-1: rgba(14, 165, 233, 0.18);
    --b-wave-2: rgba(33,90,171, 0.24);
    --b-wave-3: rgba(2, 132, 199, 0.34);

    position: relative;
    border-radius: 28px;
    background: linear-gradient(180deg, var(--b-bg-top) 0%, var(--b-bg-mid) 58%, var(--b-bg-bot) 100%);
    color: var(--b-text);
    padding: 1.5rem 1.75rem 1.75rem;
    min-height: 570px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    box-shadow: 0 22px 48px -12px rgba(15, 23, 42, 0.38);
    transition: background 0.6s ease, color 0.4s ease;
}

/* Thème 2 : Brise de l'Atlantique (Jour lumineux et apaisant) */
.breath-stage-card.theme-ocean {
    --b-bg-top: #e0f2fe;
    --b-bg-mid: #bae6fd;
    --b-bg-bot: #7dd3fc;
    --b-text: #0f172a;
    --b-text-sub: #0369a1;
    --b-orb-1: rgba(2, 132, 199, 0.88);
    --b-orb-2: rgba(26,71,135, 0.72);
    --b-petal: rgba(2, 132, 199, 0.18);
    --b-mountain-1: #7dd3fc;
    --b-mountain-2: #38bdf8;
    --b-wave-1: rgba(2, 132, 199, 0.16);
    --b-wave-2: rgba(14, 165, 233, 0.25);
    --b-wave-3: rgba(3, 105, 161, 0.32);
}

/* Thème 3 : Oasis & Dunes (Chaleureux / Crépuscule du Sud) */
.breath-stage-card.theme-oasis {
    --b-bg-top: #1c1917;
    --b-bg-mid: #431407;
    --b-bg-bot: #7c2d12;
    --b-text: #fef3c7;
    --b-text-sub: #fde68a;
    --b-orb-1: rgba(245, 158, 11, 0.85);
    --b-orb-2: rgba(32,89,169, 0.65);
    --b-petal: rgba(251, 191, 36, 0.2);
    --b-mountain-1: #78350f;
    --b-mountain-2: #451a03;
    --b-wave-1: rgba(217, 119, 6, 0.2);
    --b-wave-2: rgba(245, 158, 11, 0.25);
    --b-wave-3: rgba(180, 83, 9, 0.35);
}

/* Mode Plein Écran */
.breath-stage-card.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    border-radius: 0;
    min-height: 100vh;
    padding: 1.5rem 2rem;
}

/* Barre supérieure de la scène */
.breath-stage-topbar {
    position: relative;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.breath-theme-switcher,
.breath-sensory-controls,
.breath-sound-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.breath-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.35);
    color: var(--b-text);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.theme-ocean .breath-chip-btn {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(2, 132, 199, 0.22);
    color: #0f172a;
}

.breath-chip-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.breath-chip-btn.is-active {
    background: #38bdf8;
    color: #0f172a;
    border-color: #38bdf8;
    font-weight: 700;
}

.theme-ocean .breath-chip-btn.is-active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

/* --------------------------------------------------------------------------
   PAYSAGE ANIMÉ (MONTAGNES DE L'ATLAS, ÉTOILES & VAGUES OCÉANIQUES)
   -------------------------------------------------------------------------- */
.breath-landscape {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.breath-stars {
    position: absolute;
    inset: 0;
    opacity: 0.75;
    transition: opacity 0.5s ease;
}

.theme-ocean .breath-stars {
    opacity: 0;
}

.b-star {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 8px #ffffff;
    animation: breathTwinkle 4s infinite ease-in-out;
}
.b-star.s1 { top: 14%; left: 12%; animation-delay: 0s; }
.b-star.s2 { top: 22%; left: 28%; animation-delay: 1.1s; width: 4px; height: 4px; }
.b-star.s3 { top: 10%; left: 48%; animation-delay: 2.3s; }
.b-star.s4 { top: 18%; left: 72%; animation-delay: 0.7s; width: 4px; height: 4px; }
.b-star.s5 { top: 28%; left: 86%; animation-delay: 1.8s; }
.b-star.s6 { top: 36%; left: 18%; animation-delay: 2.9s; }
.b-star.s7 { top: 15%; left: 62%; animation-delay: 1.4s; }
.b-star.s8 { top: 32%; left: 78%; animation-delay: 0.4s; }

@keyframes breathTwinkle {
    0%, 100% { opacity: 0.25; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.3); }
}

.breath-landscape-svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72%;
}

.breath-layer-mountains-back,
.breath-layer-mountains-mid,
.breath-layer-wave {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: bottom center;
}

.breath-layer-wave.w1 {
    fill: var(--b-wave-1);
    animation: waveDrift1 11s ease-in-out infinite alternate;
}

.breath-layer-wave.w2 {
    fill: var(--b-wave-2);
    animation: waveDrift2 8.5s ease-in-out infinite alternate;
}

.breath-layer-wave.w3 {
    fill: var(--b-wave-3);
    animation: waveDrift1 6.5s ease-in-out infinite alternate-reverse;
}

@keyframes waveDrift1 {
    0% { transform: translateX(-18px) scaleY(var(--breath-wave-scale, 1)); }
    100% { transform: translateX(18px) scaleY(var(--breath-wave-scale, 1)); }
}

@keyframes waveDrift2 {
    0% { transform: translateX(15px) scaleY(var(--breath-wave-scale, 1)); }
    100% { transform: translateX(-15px) scaleY(var(--breath-wave-scale, 1)); }
}

/* --------------------------------------------------------------------------
   LA BULLE ORGANIQUE & FLEUR DE SOUFFLE AU CENTRE
   -------------------------------------------------------------------------- */
.breath-center-arena {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 1.25rem 0;
    flex: 1;
}

.breath-orb-wrapper {
    --orb-scale: 1;
    position: relative;
    width: 216px;
    height: 216px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
}

/* Pétales organiques fluides qui s'épanouissent avec --orb-scale */
.breath-petal {
    position: absolute;
    inset: 8px;
    border-radius: 44% 56% 48% 52% / 52% 44% 56% 48%;
    background: var(--b-petal);
    filter: blur(2px);
    transform: scale(calc(var(--orb-scale) * 1.08)) rotate(0deg);
    transition: transform 0.12s linear, background 0.4s ease;
}

.breath-petal.petal-1 {
    animation: petalMorph1 12s linear infinite;
}

.breath-petal.petal-2 {
    border-radius: 54% 46% 42% 58% / 46% 54% 48% 52%;
    transform: scale(calc(var(--orb-scale) * 1.16)) rotate(60deg);
    animation: petalMorph2 15s linear infinite reverse;
}

.breath-petal.petal-3 {
    border-radius: 48% 52% 56% 44% / 54% 46% 44% 56%;
    transform: scale(calc(var(--orb-scale) * 1.24)) rotate(120deg);
    opacity: 0.65;
    animation: petalMorph1 18s linear infinite;
}

@keyframes petalMorph1 {
    0% { transform: scale(calc(var(--orb-scale) * 1.12)) rotate(0deg); }
    50% { transform: scale(calc(var(--orb-scale) * 1.18)) rotate(180deg); }
    100% { transform: scale(calc(var(--orb-scale) * 1.12)) rotate(360deg); }
}

@keyframes petalMorph2 {
    0% { transform: scale(calc(var(--orb-scale) * 1.2)) rotate(45deg); }
    50% { transform: scale(calc(var(--orb-scale) * 1.14)) rotate(225deg); }
    100% { transform: scale(calc(var(--orb-scale) * 1.2)) rotate(405deg); }
}

/* Particules douces autour de la sphère */
.breath-particles {
    position: absolute;
    inset: -30px;
    pointer-events: none;
}

.b-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(186, 230, 253, 0.75);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
    transform: scale(var(--orb-scale));
    transition: transform 0.2s ease;
}
.b-particle.p1 { top: 10%; left: 20%; }
.b-particle.p2 { top: 18%; right: 15%; }
.b-particle.p3 { bottom: 20%; left: 12%; }
.b-particle.p4 { bottom: 14%; right: 20%; }
.b-particle.p5 { top: 50%; left: 4%; }
.b-particle.p6 { top: 48%; right: 4%; }

/* Cœur lumineux de la bulle */
.breath-orb-core {
    position: relative;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--b-orb-1), var(--b-orb-2));
    box-shadow:
        0 0 45px var(--b-petal),
        inset 0 0 28px rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(var(--orb-scale));
    transition: transform 0.08s linear, box-shadow 0.4s ease;
}

.breath-ring-svg {
    position: absolute;
    inset: -12px;
    width: calc(100% + 24px);
    height: calc(100% + 24px);
    transform: rotate(-90deg);
}

.breath-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.16);
    stroke-width: 5;
}

.breath-ring-progress {
    fill: none;
    stroke: #ffffff;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 678.58;
    stroke-dashoffset: 678.58;
    transition: stroke-dashoffset 0.08s linear;
}

.breath-orb-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
}

.breath-phase-timer {
    font-size: 2.55rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.breath-phase-unit {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin-top: 0.2rem;
}

/* Textes de guidage sous la bulle */
.breath-guidance-box {
    text-align: center;
    max-width: 580px;
    padding: 0 1rem;
}

.breath-phase-text {
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    font-weight: 700;
    color: var(--b-text);
    margin: 0 0 0.3rem;
    min-height: 1.9rem;
    line-height: 1.3;
    transition: opacity 0.25s ease;
}

.breath-reassurance-text {
    font-size: 0.86rem;
    color: var(--b-text-sub);
    margin: 0;
    line-height: 1.4;
    min-height: 1.5rem;
}

/* Frise des étapes du cycle (ex. Inspi 4s -> Pause 7s -> Expi 8s) */
.breath-step-timeline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.15rem;
}

.breath-step-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
    color: var(--b-text);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.25s ease;
}

.theme-ocean .breath-step-pill {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(2, 132, 199, 0.2);
}

.breath-step-pill.is-current {
    background: #38bdf8;
    color: #0f172a;
    border-color: #ffffff;
    font-weight: 800;
    transform: scale(1.06);
}

/* --------------------------------------------------------------------------
   BARRE DE CONTRÔLE INFÉRIEURE DE LA SCÈNE
   -------------------------------------------------------------------------- */
.breath-stage-bottombar {
    position: relative;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    padding: 0.9rem 1.25rem;
    backdrop-filter: blur(10px);
}

.theme-ocean .breath-stage-bottombar {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(2, 132, 199, 0.2);
}

.breath-main-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.breath-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.45rem;
    border-radius: 999px;
    border: none;
    background: #38bdf8;
    color: #0f172a;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 6px 18px -4px rgba(56, 189, 248, 0.55);
    transition: transform 0.15s ease, background 0.2s ease;
}

.breath-play-btn:hover {
    background: #7dd3fc;
    transform: translateY(-1px);
}

.breath-play-btn.is-running {
    background: #f59e0b;
    color: #0f172a;
    box-shadow: 0 6px 18px -4px rgba(245, 158, 11, 0.5);
}

.breath-reset-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: var(--b-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.theme-ocean .breath-reset-btn {
    border-color: rgba(2, 132, 199, 0.25);
    background: rgba(2, 132, 199, 0.08);
}

.breath-reset-btn:hover {
    background: rgba(255, 255, 255, 0.24);
}

.breath-duration-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.breath-duration-label {
    font-size: 0.8rem;
    font-weight: 700;
    margin-inline-end: 0.25rem;
    opacity: 0.9;
}

.breath-dur-btn {
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    color: var(--b-text);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-ocean .breath-dur-btn {
    border-color: rgba(2, 132, 199, 0.25);
}

.breath-dur-btn.is-active {
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    border-color: #ffffff;
    font-weight: 800;
}

.theme-ocean .breath-dur-btn.is-active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.breath-live-stats {
    display: flex;
    align-items: center;
    gap: 1.15rem;
}

.breath-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.breath-stat-val {
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.breath-stat-lbl {
    font-size: 0.72rem;
    opacity: 0.8;
}

/* --------------------------------------------------------------------------
   4. GRILLE DES 4 PROTOCOLES CLINIQUES
   -------------------------------------------------------------------------- */
.breath-protocols-wrap {
    margin-top: 1.5rem;
}

.breath-section-heading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.18rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 1rem;
}

.breath-section-heading i {
    color: #0284c7;
}

.breath-protocols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    gap: 0.85rem;
}

.breath-protocol-card {
    text-align: start;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 1.1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.18s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.breath-protocol-card:hover {
    border-color: #38bdf8;
    background: #f8fafc;
}

.breath-protocol-card.is-active {
    border-color: #0284c7;
    box-shadow: inset 0 0 0 1px #0284c7;
    background: #f0f9ff;
}

.breath-p-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.breath-p-icon {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    background: #e0f2fe;
    color: #0284c7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.98rem;
}

.breath-p-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 5px;
}

.badge-urgent { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-calm   { background: #edf3fc; color: #194582; border: 1px solid #abc7ef; }
.badge-sleep  { background: #eef2ff; color: #4f46e5; border: 1px solid #c7d2fe; }
.badge-focus  { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }

.breath-protocol-card h4 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.4rem;
}

.breath-protocol-card p {
    font-size: 0.84rem;
    color: #475569;
    line-height: 1.48;
    margin: 0 0 0.85rem;
}

.breath-p-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding-top: 0.65rem;
    border-top: 1px dashed #e2e8f0;
    font-size: 0.75rem;
}

.breath-p-pattern {
    font-weight: 800;
    color: #0369a1;
    background: #e0f2fe;
    padding: 0.16rem 0.5rem;
    border-radius: 5px;
}

.breath-p-science {
    color: #64748b;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   5. ANCRAGE SENSORIEL 5 - 4 - 3 - 2 - 1
   -------------------------------------------------------------------------- */
.breath-grounding-card,
.breath-pause-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.breath-grounding-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.breath-grounding-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    max-width: 760px;
}

.breath-g-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1a4787, #0284c7);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.breath-grounding-title-wrap h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.3rem;
}

.breath-grounding-title-wrap p {
    font-size: 0.88rem;
    color: #475569;
    margin: 0;
    line-height: 1.5;
}

.breath-grounding-progress { width: 90px; height: 5px; border: 0; border-radius: 8px; overflow: hidden; background: #e2e8f0; accent-color: #1a4787; }
.breath-grounding-progress::-webkit-progress-bar { background: #e2e8f0; }
.breath-grounding-progress::-webkit-progress-value { background: #1a4787; }
.breath-grounding-progress::-moz-progress-bar { background: #1a4787; }

.breath-grounding-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.breath-g-step {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.95rem 1.1rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.breath-g-step.is-step-done {
    background: #f1f6fc;
    border-color: #8cb3e9;
}

.breath-g-step-info {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
    min-width: 220px;
}


.breath-g-step-info h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.2rem;
}

.breath-g-step-info h3 i {
    color: #0284c7;
    margin-inline-end: 0.35rem;
}

.breath-g-step-info p {
    font-size: 0.84rem;
    color: #475569;
    margin: 0;
    line-height: 1.45;
}

.breath-g-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.breath-g-dot {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-weight: 800;
    font-size: 0.86rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}

.breath-g-dot i {
    display: none;
}

.breath-g-dot:hover {
    border-color: #0284c7;
    color: #0284c7;
}

.breath-g-dot.is-checked {
    background: #2059a9;
    border-color: #2059a9;
    color: #ffffff;
}


.breath-g-dot.is-checked i {
    display: inline-block;
}

.breath-grounding-complete {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    background: #edf3fc;
    border: 1px solid #71a1e4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.breath-gc-icon {
    font-size: 1.65rem;
    color: #194582;
}

.breath-grounding-complete h3 {
    margin: 0 0 0.15rem;
    font-size: 1rem;
    color: #102d55;
}

.breath-grounding-complete p {
    margin: 0;
    font-size: 0.85rem;
    color: #143768;
}

.breath-gc-reset {
    padding: 0.5rem 0.95rem;
    border-radius: 6px;
    border: 1px solid #194582;
    background: #ffffff;
    color: #194582;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
}

/* 6. APRÈS LA PAUSE */
.breath-pause-section { scroll-margin-top: 6rem; }
.breath-pause-card { background: linear-gradient(135deg, #f2f6fb 0%, #fff 55%, #f4f9ff 100%); }
.breath-pause-header { display: flex; align-items: flex-start; gap: .85rem; max-width: 52rem; }
.breath-pause-header h2 { margin: 0 0 .6rem; color: #1e293b; font-size: 1.2rem; font-weight: 800; }
.breath-pause-header p { margin: 0; color: #526174; font-size: .88rem; line-height: 1.6; }
.breath-pause-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; margin-top: 1.5rem; }
.breath-pause-item { padding: 1rem; border: 1px solid #dce9ed; border-radius: 10px; background: #ffffffd9; }
.breath-pause-item h3 { margin: 0 0 .65rem; font-size: .96rem; font-weight: 600; color: #243b47; line-height: 1.5; }
.breath-pause-item p { margin: 0; color: #526174; font-size: .85rem; line-height: 1.6; }
.breath-pause-end { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.3rem; }
.breath-pause-end p { margin: 0; color: #526174; font-size: .84rem; }
.breath-pause-return { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 44px; padding: .65rem 1rem; border: 1px solid #d7e2e8; border-radius: 7px; color: #31586b; background: #fff; text-decoration: none; font-size: .86rem; font-weight: 600; }
.breath-pause-return:hover { background: #f1f6f8; border-color: #a7bdc8; }
.breath-pause-return:focus-visible { outline: 2px solid #0369a1; outline-offset: 3px; }
@media (max-width: 760px) {
    .breath-pause-grid { grid-template-columns: 1fr; gap: .65rem; margin-top: 1.1rem; }
    .breath-pause-item { padding: 1rem; }
    .breath-pause-end { align-items: flex-start; flex-direction: column; }
}

.breath-medical-disclaimer {
    margin: 1rem 0 0;
    padding-top: 0.85rem;
    border-top: 1px dashed #e2e8f0;
    font-size: 0.76rem;
    color: #64748b;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.48;
}

/* Mise en évidence temporaire du bandeau d'urgence du footer après défilement */
@keyframes emergencyFooterHighlight {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
    40% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.45); }
}

.psy-emergency-strip.is-highlighted {
    animation: emergencyFooterHighlight 2.4s ease-in-out 2;
}

/* Responsive Tablette & Mobile */
@media (max-width: 768px) {
    .breath-page {
        margin-top: 0.5rem;
        margin-bottom: 2rem;
    }
    .breath-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        padding: 1rem;
        border-radius: 8px;
    }
    .breath-hero h1 {
        font-size: 1.32rem;
    }
    .breath-hero-lead {
        font-size: 0.86rem;
    }
    .breath-hero-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .breath-sos-btn,
    .breath-emergency-jump-btn {
        width: 100%;
        justify-content: center;
        padding: 0.65rem 0.85rem;
    }
    .breath-mode-tabs {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
    .breath-mode-tab {
        justify-content: flex-start;
        padding: 0.65rem 0.85rem;
    }
    .breath-stage-card {
        padding: 1.15rem 1rem 1.25rem;
        min-height: 520px;
    }
    .breath-stage-topbar {
        justify-content: center;
    }
    .breath-stage-bottombar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .breath-main-actions,
    .breath-duration-picker,
    .breath-live-stats {
        justify-content: center;
    }
    .hide-sm {
        display: none;
    }
    .breath-protocols-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }
    .breath-protocol-card {
        padding: 0.95rem;
    }
    .breath-grounding-card,
    .breath-pause-card {
        padding: 1.05rem 0.95rem;
        border-radius: 8px;
    }
    .breath-grounding-title-wrap {
        flex-direction: column;
        gap: 0.6rem;
    }
    .breath-g-step {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.85rem 0.9rem;
        gap: 0.7rem;
    }
    .breath-g-step-info {
        min-width: 0;
        width: 100%;
    }
    .breath-g-dots {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Compact sensory rows and accents shared with the breathing tools. */
.breath-grounding-header { margin-bottom: .75rem; padding-bottom: .75rem; align-items: center; }
.breath-grounding-steps { gap: .45rem; }
.breath-g-step { padding: .65rem .85rem; gap: .5rem 1rem; }
.breath-g-step-info { min-width: 0; }
.breath-g-step-info h3 { font-weight: 700; font-size: .9rem; }
.breath-g-dots { gap: 0; flex-shrink: 0; }
.breath-g-dot { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; position: relative; }
.breath-g-dot::before { content: ''; position: absolute; inset: 9px; border: 1.5px solid #adc9d7; border-radius: 50%; background: white; }
.breath-g-dot:hover::before { border-color: #0284c7; background: #eff8ff; }
.breath-g-dot.is-checked { background: transparent; color: white; }
.breath-g-dot.is-checked::before { background: #1a4787; border-color: #1a4787; }
.breath-g-dot i { position: relative; z-index: 1; font-size: .7rem; }
.breath-g-dot:focus-visible { outline: 2px solid #0284c7; outline-offset: -3px; }
.breath-pause-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: #e6ecf5; color: #1a4889; margin-bottom: .75rem; }
.breath-pause-item:nth-child(2) .breath-pause-icon { background: #e9f3fd; color: #287bb0; }
.breath-pause-item:nth-child(3) .breath-pause-icon { background: #edf0fb; color: #6876ad; }
.breath-pause-return { background: #eaeff7; border-color: #c6d3e5; color: #163e76; }
@media (max-width: 760px) {
    .breath-grounding-title-wrap { flex-direction: row; }
    .breath-g-step { flex-direction: column; align-items: stretch; padding: .65rem .75rem; gap: .25rem; }
    .breath-g-dots { justify-content: flex-end; }
    .breath-pause-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: .75rem; }
    .breath-pause-icon { grid-row: 1 / 3; margin: 0; }
    .breath-pause-item h3 { margin-bottom: .3rem; }
    .breath-pause-item p { grid-column: 2; }
}

.breath-sos-btn, .breath-hero-emergency-link { min-height: 44px; }
.breath-sos-btn:focus-visible, .breath-hero-emergency-link:focus-visible { outline: 2px solid #0369a1; outline-offset: 3px; }

/* Desktop labels and compact mobile control groups. */
.breath-stage-topbar .breath-chip-btn { min-height: 40px; padding: .4rem .7rem; justify-content: center; border-radius: 7px; flex-shrink: 0; font-size: .78rem; }
.breath-stage-topbar .breath-chip-btn:focus-visible { outline: 2px solid var(--b-text); outline-offset: 3px; }
@media (max-width: 600px) {
    .breath-stage-topbar { display: grid; grid-template-columns: 1fr 36px; gap: 6px 12px; align-items: center; }
    .breath-stage-topbar .breath-control-label { display: none; }
    .breath-sensory-controls { display: contents; }
    .breath-theme-switcher { grid-column: 1; grid-row: 1; }
    .breath-sound-group { grid-column: 1; grid-row: 2; }
    .breath-theme-switcher, .breath-sound-group { justify-self: start; display: flex; flex-wrap: nowrap; gap: 3px; padding: 2px; border: 1px solid rgba(148,163,184,.22); border-radius: 7px; background: rgba(148,163,184,.06); }
    .breath-stage-topbar .breath-chip-btn { width: 36px; height: 36px; min-height: 36px; padding: 0; border: 1px solid transparent; background: transparent; backdrop-filter: none; border-radius: 5px; font-size: .78rem; }
    .breath-stage-topbar .breath-chip-btn.is-active { background: #a5dced; color: #082f49; box-shadow: none; }
    .breath-stage-topbar .breath-fullscreen-btn { grid-column: 2; grid-row: 1; border-color: rgba(148,163,184,.4); }
    #breathHapticBtn { grid-column: 2; grid-row: 2; border-color: rgba(148,163,184,.4); }
    .breath-vibration-icon { width: 17px; height: 17px; }
    .breath-center-arena { margin: 1rem 0; }
    .breath-orb-wrapper { width: 200px; height: 200px; }
    .breath-orb-core { width: 166px; height: 166px; }
    .breath-duration-picker { gap: .3rem; flex-wrap: nowrap; }
    .breath-dur-btn { padding: .45rem .6rem; min-height: 40px; }
    .breath-stage-card.is-fullscreen { height: 100dvh; min-height: 0; overflow-y: auto; padding: 1rem; }
}
