/* ==========================================================================
   Rationnelle 2: brand stylesheet
   --------------------------------------------------------------------------
   Redefines colour tokens, typography and the look of shared components.
   Redesigned pages add their own `r-` blocks further down.
   Intent:
   - forest green for the brand: trust, nutrition, seriousness;
   - terracotta reserved for actions;
   - cream and white backgrounds, plenty of space;
   - Fraunces headings, Inter body text.
   Contrast checked (WCAG AA, 4.5:1 for body text):
   - text #2B3631 on white: 12.4:1; on cream #FBF7F0: 11.6:1
   - secondary text #56625C on white: 6.3:1; on cream: 5.9:1
   - white on terracotta #ae6332: 5.5:1; on forest #1F4434: 10.6:1
   ========================================================================== */

:root {
    --r-foret: #1f4434;
    --r-foret-2: #2b5a45;
    --r-foret-3: #3f7a5f;
    --r-encre: #13221b;
    --r-sauge: #e7efe9;
    --r-sauge-2: #d3e2d8;
    --r-creme: #fbf7f0;
    --r-sable: #f3eadc;
    --r-argile: #ae6332;
    --r-argile-fonce: #995427;
    --r-argile-clair: #f6e8dc;
    --r-miel: #d99a3d;
    --r-texte: #2b3631;
    --r-texte-2: #56625c;
    --r-ligne: #e5e1d8;
    --r-blanc: #ffffff;

    --r-rayon: 16px;
    --r-rayon-petit: 10px;
    --r-ombre: 0 1px 2px rgba(19, 34, 27, 0.05), 0 8px 24px -12px rgba(19, 34, 27, 0.18);
    --r-ombre-haute: 0 2px 4px rgba(19, 34, 27, 0.06), 0 24px 48px -20px rgba(19, 34, 27, 0.28);
    --r-titre: 'Fraunces', Georgia, 'Times New Roman', serif;
    --r-corps: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Legacy tokens mapped to the brand. */
    --primary: var(--r-argile);
    --primary-100: var(--r-argile-fonce);
    --primary-200: #8c4c22;
    --primary-300: #723b15;
    --primary--100: #c67139;
    --primary--200: #d4884f;
    --primary--300: #e09a66;
    --primary-rgba-10: rgba(174, 99, 50, 0.1);
    --primary-rgba-20: rgba(174, 99, 50, 0.2);
    --primary-rgba-30: rgba(174, 99, 50, 0.3);
    --primary-rgba-40: rgba(174, 99, 50, 0.4);
    --secondary: var(--r-foret-2);
    --secondary-100: var(--r-foret);
    /* Tokens still read by rationnelle-composants.css. */
    --secondary-300: var(--r-foret-2);
    --secondary-rgba-10: rgba(43, 90, 69, 0.1);
    --tertiary--300: var(--r-creme);
    --tertiary-100: var(--r-ligne);
    --tertiary: var(--r-sable);
    --tertiary-inverse: var(--r-encre);
    --quaternary: var(--r-foret);
    --dark: var(--r-encre);
    --dark--100: #1d3027;
    --grey: var(--r-texte-2);
    --default: var(--r-texte-2);

    --surface: var(--r-blanc);
    --surface-basse: var(--r-creme);
    --surface-haute: var(--r-blanc);
    --texte: var(--r-texte);
    --texte-secondaire: var(--r-texte-2);
    --bordure: var(--r-ligne);
    --lien: var(--r-argile);
}

/* The member area keeps its dark mode, redefined with the brand. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="clair"]) {
        --surface: #111a16;
        --surface-basse: #0c1310;
        --surface-haute: #17231d;
        --texte: #e8eee9;
        --texte-secondaire: #a9b8af;
        --bordure: #2a3a32;
        --lien: #e08a5f;
        --grey: #a9b8af;
        --default: #a9b8af;
        --r-texte: #e8eee9;
        --r-texte-2: #a9b8af;
        --r-ligne: #2a3a32;
        --r-sauge: #1b2a23;
        --r-creme: #0c1310;
        --r-sable: #1f2b25;
        --r-argile-clair: #3a2318;
    }
}

:root[data-theme="sombre"] {
    --surface: #111a16;
    --surface-basse: #0c1310;
    --surface-haute: #17231d;
    --texte: #e8eee9;
    --texte-secondaire: #a9b8af;
    --bordure: #2a3a32;
    --lien: #e08a5f;
    --grey: #a9b8af;
    --default: #a9b8af;
    --r-texte: #e8eee9;
    --r-texte-2: #a9b8af;
    --r-ligne: #2a3a32;
    --r-sauge: #1b2a23;
    --r-creme: #0c1310;
    --r-sable: #1f2b25;
    --r-argile-clair: #3a2318;
}

/* --- Typographie ---------------------------------------------------------- */
html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--r-corps);
    font-size: 16px;
    line-height: 1.6;
    color: var(--texte);
    -webkit-font-smoothing: antialiased;
}

/* `p, li` inherit their colour from their section. */
p,
li {
    color: inherit;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--r-titre);
    font-optical-sizing: auto;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--r-encre);
    text-transform: none;
}

:root[data-theme="sombre"] h1, :root[data-theme="sombre"] h2,
:root[data-theme="sombre"] h3, :root[data-theme="sombre"] h4,
:root[data-theme="sombre"] h5, :root[data-theme="sombre"] h6 {
    color: var(--texte);
}

/* Headings in semi-bold and normal case. */
h1.font-weight-extra-bold, h2.font-weight-extra-bold, h3.font-weight-extra-bold,
h1.font-weight-bold, h2.font-weight-bold, h3.font-weight-bold,
h4.font-weight-bold, h5.font-weight-bold {
    font-weight: 600 !important;
}

.text-color-dark,
.text-dark {
    color: var(--r-encre) !important;
}

.text-color-grey {
    color: var(--texte-secondaire) !important;
}

.text-color-primary {
    color: var(--r-argile) !important;
}

a {
    color: var(--lien);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--r-argile-fonce);
}

::selection {
    background: var(--r-sauge-2);
    color: var(--r-encre);
}

/* --- Boutons -------------------------------------------------------------- */
.btn {
    font-family: var(--r-corps);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    border-radius: 999px;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.btn-lg,
.btn.py-3 {
    min-height: 52px;
}

.btn-primary,
.btn-primary:visited {
    background-color: var(--r-argile);
    border-color: var(--r-argile);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 6px 16px -8px rgba(174, 99, 50, 0.6);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background-color: var(--r-argile-fonce) !important;
    border-color: var(--r-argile-fonce) !important;
    color: #fff !important;
}

.btn-dark,
.btn-secondary {
    background-color: var(--r-foret);
    border-color: var(--r-foret);
    color: #fff;
}

.btn-dark:hover,
.btn-secondary:hover {
    background-color: var(--r-encre);
    border-color: var(--r-encre);
    color: #fff;
}

.btn-light,
.btn-outline {
    background-color: var(--surface-haute);
    border: 1px solid var(--bordure);
    color: var(--texte);
}

.btn-light:hover {
    border-color: var(--r-foret-3);
    color: var(--r-foret);
    background-color: var(--surface-haute);
}

.btn:focus-visible,
a:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 3px solid rgba(63, 122, 95, 0.45);
    outline-offset: 2px;
}

/* --- Cards, callouts, forms ----------------------------------------------- */
.card {
    border-radius: var(--r-rayon);
    border: 1px solid var(--bordure);
    box-shadow: none;
}

.box-shadow-1,
.box-shadow-2 {
    box-shadow: var(--r-ombre) !important;
}

.box-shadow-1-hover:hover {
    box-shadow: var(--r-ombre-haute) !important;
}

.form-control,
.form-select {
    border-radius: var(--r-rayon-petit);
    border: 1px solid #d9d4c9;
    min-height: 48px;
    font-size: 16px;
    color: var(--texte);
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--r-foret-3);
    box-shadow: 0 0 0 4px rgba(63, 122, 95, 0.15);
}

.form-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--r-encre);
    margin-bottom: 6px;
}

:root[data-theme="sombre"] .form-label {
    color: var(--texte);
}

.alert {
    border-radius: var(--r-rayon-petit);
}

.badge {
    font-family: var(--r-corps);
    letter-spacing: 0.01em;
}

.badge-primary {
    background-color: var(--r-argile);
}

.badge-dark {
    background-color: var(--r-foret);
    color: #fff;
}

/* --- Header --------------------------------------------------------------- */
#header .header-body {
    border-bottom: 1px solid var(--bordure) !important;
    box-shadow: none;
}

#header .header-nav-main nav > ul > li > a,
#header .header-nav-main nav > ul > li > a.nav-link {
    font-family: var(--r-corps);
    font-weight: 500;
    font-size: 15px;
    color: var(--r-texte) !important;
    text-transform: none;
    letter-spacing: 0;
}

#header .header-nav-main nav > ul > li > a:hover {
    color: var(--r-foret) !important;
}

/* --- Footer --------------------------------------------------------------- */
#footer {
    background-color: var(--r-foret) !important;
    border-top: 0;
}

#footer,
#footer p,
#footer li,
#footer .pied-titre {
    color: rgba(255, 255, 255, 0.82);
}

#footer a {
    color: #fff;
}

#footer a:hover {
    color: #f3d3c1;
}

#footer .pied-titre {
    font-family: var(--r-corps);
    font-weight: 600;
    color: #fff;
}

#footer .pied-avertissement {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.82);
}

#footer .footer-copyright,
#footer .footer-copyright p {
    background: var(--r-encre) !important;
    color: rgba(255, 255, 255, 0.7);
}

/* --- Tinted sections ------------------------------------------------------ */
section.section {
    border-top: 0;
}

.bg-color-grey,
.bg-color-light-scale-1 {
    background-color: var(--r-creme) !important;
}

section.section-primary,
.bg-color-primary,
.bg-color-primary-200 {
    background-color: var(--r-foret) !important;
}

section.section-primary .text-color-tertiary,
.bg-color-primary-200 .text-color-tertiary {
    color: #f3c9a9 !important;
}

/* ==========================================================================
   `r-` components of the redesigned pages
   ========================================================================== */

.r-conteneur {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

.r-section {
    padding: 88px 0;
}

.r-section-creme {
    background: var(--r-creme);
}

.r-section-sauge {
    background: var(--r-sauge);
}

.r-section-foret {
    background: var(--r-foret);
    color: #fff;
}

.r-section-foret h2,
.r-section-foret h3,
.r-section-foret p,
.r-section-foret li {
    color: #fff;
}

.r-surtitre {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--r-corps);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--r-foret-2);
    background: var(--r-sauge);
    border-radius: 999px;
    padding: 6px 14px;
    margin-bottom: 18px;
}

.r-section-foret .r-surtitre {
    background: rgba(255, 255, 255, 0.1);
    color: #d7e8de;
}

.r-titre-xl {
    font-size: clamp(2.3rem, 4.6vw, 3.6rem);
    line-height: 1.06;
    letter-spacing: -0.02em;
    margin: 0 0 20px;
}

.r-titre-l {
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    line-height: 1.12;
    margin: 0 0 16px;
}

.r-titre-m {
    font-size: 1.35rem;
    line-height: 1.25;
    margin: 0 0 8px;
}

.r-accent {
    color: var(--r-foret-3);
    font-style: italic;
}

.r-chapo {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--r-texte-2);
    max-width: 620px;
}

.r-section-foret .r-chapo {
    color: rgba(255, 255, 255, 0.82);
}

.r-entete-section {
    max-width: 720px;
    margin: 0 auto 48px;
    text-align: center;
}

.r-entete-section .r-chapo {
    margin: 0 auto;
}

.r-grille {
    display: grid;
    gap: 24px;
}

.r-grille-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.r-grille-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.r-grille-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 991px) {
    .r-grille-3, .r-grille-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .r-section { padding: 64px 0; }
}

@media (max-width: 640px) {
    .r-grille-2, .r-grille-3, .r-grille-4 { grid-template-columns: minmax(0, 1fr); }
    .r-section { padding: 48px 0; }
    .r-conteneur { padding: 0 16px; }
}

.r-carte {
    background: var(--surface-haute);
    border: 1px solid var(--bordure);
    border-radius: var(--r-rayon);
    padding: 28px;
}

.r-carte-ombre {
    box-shadow: var(--r-ombre);
}

.r-pastille {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--r-sauge);
    color: var(--r-foret);
    font-size: 18px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.r-pastille-argile {
    background: var(--r-argile-clair);
    color: var(--r-argile);
}

.r-liste-coches {
    list-style: none;
    padding: 0;
    margin: 0;
}

.r-liste-coches li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 10px;
}

.r-liste-coches li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--r-sauge) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231f4434' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M4 8.5l2.5 2.5L12 5.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.r-section-foret .r-liste-coches li::before {
    background-color: rgba(255, 255, 255, 0.14);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M4 8.5l2.5 2.5L12 5.5'/%3E%3C/svg%3E");
}

.r-bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 28px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.r-bouton-action {
    background: var(--r-argile);
    color: #fff !important;
    box-shadow: 0 6px 16px -8px rgba(174, 99, 50, 0.7);
}

.r-bouton-action:hover {
    background: var(--r-argile-fonce);
    color: #fff;
}

.r-bouton-discret {
    background: transparent;
    border-color: var(--bordure);
    color: var(--r-encre) !important;
}

.r-bouton-discret:hover {
    border-color: var(--r-foret-3);
}

.r-section-foret .r-bouton-discret {
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff !important;
}

.r-bouton-large {
    width: 100%;
}

.r-note {
    font-size: 14px;
    color: var(--r-texte-2);
}

.r-chiffre {
    font-family: var(--r-titre);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    color: var(--r-encre);
}

/* --- Accueil : bandeau principal ------------------------------------------ */
.r-hero {
    background:
        radial-gradient(1200px 500px at 85% -10%, rgba(63, 122, 95, 0.12), transparent 60%),
        radial-gradient(800px 400px at -10% 110%, rgba(217, 154, 61, 0.10), transparent 60%),
        var(--r-creme);
    padding: 64px 0 80px;
}

.r-hero-grille {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 56px;
    align-items: start;
}

@media (max-width: 991px) {
    .r-hero-grille { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .r-hero { padding: 32px 0 56px; }
}

.r-preuves {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-top: 28px;
    font-size: 14px;
    color: var(--r-texte-2);
}

.r-preuves span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.r-preuves i {
    color: var(--r-foret-3);
}

/* --- Simulateur ----------------------------------------------------------- */
.r-simulateur {
    background: var(--r-blanc);
    border: 1px solid var(--bordure);
    border-radius: 22px;
    box-shadow: var(--r-ombre-haute);
    padding: 28px;
}

.r-simulateur-titre {
    font-family: var(--r-corps);
    font-size: 15px;
    font-weight: 600;
    color: var(--r-texte-2);
    margin: 0 0 18px;
}

.r-choix-espece {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
    background: var(--r-creme);
    border-radius: 999px;
    padding: 4px;
}

.r-choix-espece input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.r-choix-espece label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border-radius: 999px;
    font-weight: 600;
    color: var(--r-texte-2);
    cursor: pointer;
    margin: 0;
}

.r-choix-espece input:checked + label {
    background: var(--r-blanc);
    color: var(--r-encre);
    box-shadow: 0 1px 3px rgba(19, 34, 27, 0.12);
}

.r-choix-espece input:focus-visible + label {
    outline: 3px solid rgba(63, 122, 95, 0.45);
}

.r-champs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.r-champ {
    margin-bottom: 14px;
}

.r-champ-plein {
    grid-column: 1 / -1;
}

@media (max-width: 420px) {
    .r-champs { grid-template-columns: minmax(0, 1fr); }
}

.r-silhouettes {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.r-silhouettes input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.r-silhouettes label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 2px 6px;
    border: 1px solid var(--bordure);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--r-texte-2);
    cursor: pointer;
    margin: 0;
    text-align: center;
}

.r-silhouettes svg {
    width: 38px;
    height: 26px;
}

.r-silhouettes input:checked + label {
    border-color: var(--r-foret-3);
    background: var(--r-sauge);
    color: var(--r-encre);
}

.r-silhouettes input:focus-visible + label {
    outline: 3px solid rgba(63, 122, 95, 0.45);
}

.r-aide-silhouette {
    font-size: 13px;
    color: var(--r-texte-2);
    margin: 6px 0 0;
    min-height: 1.3em;
}

.r-resultat-direct {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--r-foret);
    color: #fff;
    border-radius: 16px;
    padding: 18px 20px;
    margin: 6px 0 16px;
}

.r-resultat-direct small {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
}

.r-resultat-direct strong {
    font-family: var(--r-titre);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.1;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.r-resultat-direct .r-kcal {
    text-align: right;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
}

.r-resultat-direct .r-kcal b {
    display: block;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 600;
}

/* --- Steps, comparison, FAQ ----------------------------------------------- */
.r-etape-numero {
    font-family: var(--r-titre);
    font-size: 15px;
    font-weight: 600;
    color: var(--r-argile);
    margin-bottom: 8px;
    display: block;
}

.r-tableau {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface-haute);
    border: 1px solid var(--bordure);
    border-radius: var(--r-rayon);
    overflow: hidden;
    font-size: 15px;
}

.r-tableau th,
.r-tableau td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--bordure);
    vertical-align: top;
    text-align: left;
}

.r-tableau tr:last-child td {
    border-bottom: 0;
}

.r-tableau thead th {
    background: var(--r-creme);
    font-weight: 600;
    color: var(--r-encre);
}

.r-tableau .r-col-nous {
    background: rgba(231, 239, 233, 0.6);
}

.r-oui { color: var(--r-foret-3); font-weight: 600; }
.r-non { color: var(--r-texte-2); }

.r-faq details {
    border-bottom: 1px solid var(--bordure);
    padding: 18px 0;
}

.r-faq summary {
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    font-size: 17px;
    color: var(--r-encre);
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.r-faq summary::-webkit-details-marker { display: none; }

.r-faq summary::after {
    content: "+";
    font-family: var(--r-corps);
    font-size: 22px;
    line-height: 1;
    color: var(--r-foret-3);
}

.r-faq details[open] summary::after {
    content: "\2212";
}

.r-faq details p {
    margin: 12px 0 0;
    color: var(--r-texte-2);
}

/* --- Offres --------------------------------------------------------------- */
.r-offre {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface-haute);
    border: 1px solid var(--bordure);
    border-radius: 20px;
    padding: 32px 28px;
}

.r-offre-vedette {
    border: 2px solid var(--r-foret-3);
    box-shadow: var(--r-ombre-haute);
}

.r-offre-ruban {
    position: absolute;
    top: -13px;
    left: 28px;
    background: var(--r-foret);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 999px;
    padding: 5px 12px;
}

.r-offre-nom {
    font-family: var(--r-titre);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--r-encre);
    margin: 0 0 4px;
}

.r-offre-cible {
    color: var(--r-texte-2);
    font-size: 15px;
    margin: 0 0 20px;
}

.r-offre-prix {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
}

.r-offre-prix strong {
    font-family: var(--r-titre);
    font-size: 2.6rem;
    font-weight: 600;
    color: var(--r-encre);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.r-offre-prix span {
    color: var(--r-texte-2);
}

.r-offre-essai {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--r-foret-2);
    background: var(--r-sauge);
    border-radius: 999px;
    padding: 4px 10px;
    margin: 8px 0 20px;
}

.r-offre .r-liste-coches {
    margin-bottom: 24px;
    flex-grow: 1;
}

.r-bascule-periode {
    display: inline-flex;
    background: var(--r-creme);
    border: 1px solid var(--bordure);
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 40px;
}

.r-bascule-periode button {
    border: 0;
    background: transparent;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 600;
    color: var(--r-texte-2);
}

.r-bascule-periode button[aria-pressed="true"] {
    background: var(--r-blanc);
    color: var(--r-encre);
    box-shadow: 0 1px 3px rgba(19, 34, 27, 0.12);
}

/* --- Free result ---------------------------------------------------------- */
.r-resultat-entete {
    background: var(--r-creme);
    padding: 48px 0 32px;
}

.r-gamelle {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 640px) {
    .r-gamelle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.r-aliment {
    background: var(--surface-haute);
    border: 1px solid var(--bordure);
    border-radius: 14px;
    padding: 16px;
}

.r-aliment-pastille {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.r-aliment-nom {
    font-size: 13px;
    font-weight: 600;
    color: var(--r-texte-2);
}

.r-aliment-grammes {
    display: block;
    font-family: var(--r-titre);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--r-encre);
    line-height: 1.15;
    margin: 4px 0 2px;
    font-variant-numeric: tabular-nums;
}

.r-aliment-detail {
    font-size: 13px;
    color: var(--r-texte-2);
}

.r-barre-repartition {
    display: flex;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    margin: 18px 0 8px;
}

.r-verrou {
    position: relative;
    border-radius: var(--r-rayon);
    overflow: hidden;
}

.r-verrou-contenu {
    filter: blur(5px);
    opacity: 0.6;
    user-select: none;
    pointer-events: none;
}

.r-verrou-voile {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(180deg, rgba(251, 247, 240, 0.2), rgba(251, 247, 240, 0.85));
}

.r-verrou-voile .r-carte {
    max-width: 420px;
    text-align: center;
    box-shadow: var(--r-ombre-haute);
}

.r-objectif {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--r-sauge);
    border: 1px solid var(--r-sauge-2);
    border-radius: var(--r-rayon);
    padding: 18px 20px;
}

.r-objectif .r-pastille {
    background: var(--r-blanc);
    margin-bottom: 0;
}

.r-encadre-alerte {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #fdf4e3;
    border: 1px solid #f0dcb3;
    border-radius: var(--r-rayon);
    padding: 16px 18px;
    color: #5a4318;
}

.r-encadre-alerte .r-pastille {
    background: #fff;
    color: #9a6a12;
    margin-bottom: 0;
}

/* --- Sticky mobile action bar --------------------------------------------- */
.r-barre-mobile {
    display: none;
}

@media (max-width: 767px) {
    .r-barre-mobile {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        gap: 12px;
        align-items: center;
        justify-content: space-between;
        background: var(--r-blanc);
        border-top: 1px solid var(--bordure);
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 24px -16px rgba(19, 34, 27, 0.3);
    }

    .r-barre-mobile .r-bouton {
        min-height: 46px;
        padding: 0 20px;
    }

    body.r-avec-barre-mobile {
        padding-bottom: 76px;
    }
}

.r-masque-mobile {
    display: initial;
}

@media (max-width: 767px) {
    .r-masque-mobile { display: none !important; }
}

/* Reveal animation, off for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
    .r-apparait {
        animation: r-monte .5s ease both;
    }
    @keyframes r-monte {
        from { opacity: 0; transform: translateY(8px); }
        to { opacity: 1; transform: none; }
    }
}

/* --- Screen review adjustments -------------------------------------------- */
/* No thick left rule on blockquotes. */
.r-section blockquote,
.r-carte blockquote {
    border-left: 0;
    padding: 0;
    margin: 0 0 16px;
    font-size: 16px;
    font-style: normal;
}

.r-bouton {
    text-align: center;
    line-height: 1.25;
}

.r-silhouettes svg {
    width: 52px;
    height: 32px;
    color: var(--r-foret-2);
}

.r-silhouettes input:checked + label svg {
    color: var(--r-foret);
}

@media (max-width: 420px) {
    .r-silhouettes svg { width: 40px; height: 26px; }
    .r-silhouettes label { font-size: 11px; }
}

/* --- Logo ------------------------------------------------------------------ */
/* Production logo as an image (partials/_logo.html): 185 px on desktop, 150 px
   on small phones to leave room for the header button. */
.r-logo {
    display: block;
    width: 185px;
    max-width: 100%;
    height: auto;
}

@media (max-width: 420px) {
    .r-logo { width: 150px; }
}

/* --- Free result ---------------------------------------------------------- */
.r-resultat-entete {
    background: var(--r-creme);
    padding: 48px 0 32px;
}

.r-gamelle {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 640px) {
    .r-gamelle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.r-aliment {
    background: var(--surface-haute);
    border: 1px solid var(--bordure);
    border-radius: 14px;
    padding: 16px;
}

.r-aliment-pastille {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.r-aliment-nom {
    font-size: 13px;
    font-weight: 600;
    color: var(--r-texte-2);
}

.r-aliment-grammes {
    display: block;
    font-family: var(--r-titre);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--r-encre);
    line-height: 1.15;
    margin: 4px 0 2px;
    font-variant-numeric: tabular-nums;
}

.r-aliment-detail {
    font-size: 13px;
    color: var(--r-texte-2);
}

.r-barre-repartition {
    display: flex;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    margin: 18px 0 8px;
}

.r-verrou {
    position: relative;
    border-radius: var(--r-rayon);
    overflow: hidden;
}

.r-verrou-contenu {
    filter: blur(5px);
    opacity: 0.6;
    user-select: none;
    pointer-events: none;
}

.r-verrou-voile {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(180deg, rgba(251, 247, 240, 0.2), rgba(251, 247, 240, 0.85));
}

.r-verrou-voile .r-carte {
    max-width: 420px;
    text-align: center;
    box-shadow: var(--r-ombre-haute);
}

.r-objectif {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--r-sauge);
    border: 1px solid var(--r-sauge-2);
    border-radius: var(--r-rayon);
    padding: 18px 20px;
}

.r-objectif .r-pastille {
    background: var(--r-blanc);
    margin-bottom: 0;
}

/* Block with a button on the right: on narrow screens the button moves under
   the text instead of squeezing it. */
.r-objectif-action { flex-wrap: wrap; }
.r-objectif-action > .flex-grow-1 { flex: 1 1 14rem; min-width: 0; }
.r-objectif-action > form { margin-left: 60px; } /* below the text, after the pill */

.r-encadre-alerte {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #fdf4e3;
    border: 1px solid #f0dcb3;
    border-radius: var(--r-rayon);
    padding: 16px 18px;
    color: #5a4318;
}

.r-encadre-alerte .r-pastille {
    background: #fff;
    color: #9a6a12;
    margin-bottom: 0;
}

/* --- Sticky mobile action bar --------------------------------------------- */
.r-barre-mobile {
    display: none;
}

@media (max-width: 767px) {
    .r-barre-mobile {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        gap: 12px;
        align-items: center;
        justify-content: space-between;
        background: var(--r-blanc);
        border-top: 1px solid var(--bordure);
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 24px -16px rgba(19, 34, 27, 0.3);
    }

    .r-barre-mobile .r-bouton {
        min-height: 46px;
        padding: 0 20px;
    }

    body.r-avec-barre-mobile {
        padding-bottom: 76px;
    }
}

.r-masque-mobile {
    display: initial;
}

@media (max-width: 767px) {
    .r-masque-mobile { display: none !important; }
}

/* Reveal animation, off for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
    .r-apparait {
        animation: r-monte .5s ease both;
    }
    @keyframes r-monte {
        from { opacity: 0; transform: translateY(8px); }
        to { opacity: 1; transform: none; }
    }
}

/* --- Screen review adjustments -------------------------------------------- */
/* No thick left rule on blockquotes. */
.r-section blockquote,
.r-carte blockquote {
    border-left: 0;
    padding: 0;
    margin: 0 0 16px;
    font-size: 16px;
    font-style: normal;
}

.r-bouton {
    text-align: center;
    line-height: 1.25;
}

.r-silhouettes svg {
    width: 52px;
    height: 32px;
    color: var(--r-foret-2);
}

.r-silhouettes input:checked + label svg {
    color: var(--r-foret);
}

@media (max-width: 420px) {
    .r-silhouettes svg { width: 40px; height: 26px; }
    .r-silhouettes label { font-size: 11px; }
}

/* --- Free result: two columns, sticky offer -------------------------------- */
.r-resultat-grille {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 40px;
}

.r-offre-collante {
    position: sticky;
    top: 96px;
}

@media (max-width: 991px) {
    .r-resultat-grille { grid-template-columns: minmax(0, 1fr); }
    /* relative, not static: keeps the absolute "Recommended" ribbon inside the card. */
    .r-offre-collante { position: relative; top: auto; }
}

/* --- Member area: forest green sidebar ------------------------------------- */
:root {
    --espace-fond: var(--r-foret);
}

.espace-sidebar {
    background: var(--r-foret);
}

.espace-contenu {
    background: var(--r-creme);
}

:root[data-theme="sombre"] .espace-contenu {
    background: var(--surface-basse);
}

.espace-contenu .card {
    border-radius: var(--r-rayon);
}

/* Mobile menu button in forest green; terracotta stays for actions. */
#header .header-btn-collapse-nav {
    background: var(--r-foret);
    color: #fff;
    border-radius: 999px;
}

/* --- Member area dark theme: "dark text" turns light --------------------- */
/* .text-dark and .text-color-dark are forced to the green ink by the brand:
   lighten them in dark mode. */
:root[data-theme="sombre"] .text-dark,
:root[data-theme="sombre"] .text-color-dark,
:root[data-theme="sombre"] th,
:root[data-theme="sombre"] .r-chiffre,
:root[data-theme="sombre"] .r-aliment-grammes,
:root[data-theme="sombre"] .r-offre-nom,
:root[data-theme="sombre"] .r-offre-prix strong {
    color: var(--texte) !important;
}

:root[data-theme="sombre"] .badge-light,
:root[data-theme="sombre"] .input-group-text {
    background-color: var(--surface-haute);
    border-color: var(--bordure);
    color: var(--texte);
}

:root[data-theme="sombre"] .r-objectif,
:root[data-theme="sombre"] .r-carte {
    background: var(--surface-haute);
    border-color: var(--bordure);
}

:root[data-theme="sombre"] .r-objectif .r-pastille {
    background: var(--surface-basse);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="clair"]) .text-dark,
    :root:not([data-theme="clair"]) .text-color-dark,
    :root:not([data-theme="clair"]) .badge-light {
        color: var(--texte) !important;
    }
}

/* Pastille tertiaire (« Actif ») : sable en clair, sauge sombre en sombre. */
.badge-tertiary {
    background-color: var(--r-sauge);
    color: var(--r-foret);
}

:root[data-theme="sombre"] .badge-tertiary {
    background-color: rgba(143, 193, 159, 0.18);
    color: #cfe6d6 !important;
}

/* --- Member area dashboard ------------------------------------------------ */
.r-tableau-bord {
    display: grid;
    gap: 16px;
}

.r-tuile-animal {
    background: var(--surface-haute);
    border: 1px solid var(--bordure);
    border-radius: var(--r-rayon);
    padding: 20px;
}

.r-tuile-grille {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 991px) {
    .r-tuile-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.r-tuile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--r-creme);
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--texte);
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.r-tuile:hover {
    border-color: var(--r-sauge-2);
    box-shadow: var(--r-ombre);
    transform: translateY(-1px);
    color: var(--texte);
}

.r-tuile-libelle {
    font-size: 13px;
    font-weight: 600;
    color: var(--texte-secondaire);
}

.r-tuile-valeur {
    font-family: var(--r-titre);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--r-encre);
    line-height: 1.2;
}

.r-tuile-aide {
    font-size: 13px;
    color: var(--texte-secondaire);
}

.r-tuile-alerte {
    background: var(--r-argile-clair);
}

.r-tuile-alerte .r-tuile-valeur {
    color: var(--r-argile);
}

.r-valeur {
    background: linear-gradient(135deg, var(--r-foret), var(--r-foret-2));
    color: #fff;
    border-radius: var(--r-rayon);
    padding: 24px;
}

.r-valeur .r-titre-m,
.r-valeur .r-chiffre {
    color: #fff;
}

.r-valeur .r-note {
    color: rgba(255, 255, 255, 0.78);
}

.r-valeur-grille {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.r-valeur-grille > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.r-valeur-grille .r-chiffre {
    font-size: 2rem;
    line-height: 1;
}

@media (max-width: 767px) {
    .r-valeur-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

:root[data-theme="sombre"] .r-tuile {
    background: var(--surface-basse);
}

:root[data-theme="sombre"] .r-tuile-valeur {
    color: var(--texte);
}

.r-tuile,
.r-tuile:hover,
.r-tuile:focus,
.r-tuile * {
    text-decoration: none !important;
}

.r-tuile:focus-visible {
    outline: 2px solid var(--r-sauge-2);
    outline-offset: 2px;
}

/* --- Native motion, no script --------------------------------------------- */
/* Native cross-document view transitions (Chrome, Edge, Safari 18): a short
   fade instead of a white flash. Unsupported browsers load as usual. Header
   and member sidebar stay in place. */
@media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }

    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: .18s;
    }

    #header { view-transition-name: r-entete; }
    .espace-sidebar { view-transition-name: r-barre; }
    .espace-onglets { view-transition-name: r-onglets; }

    /* Section reveal on scroll driven by the browser (animation-timeline).
   Without support, nothing moves and everything is visible. */
    @supports (animation-timeline: view()) {
        .r-section > .r-conteneur > *,
        .r-offre,
        .r-tuile-animal,
        .r-valeur {
            animation: r-monte linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 35%;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Weekly health check-in ---------------------------------------------- */
.r-suivi {
    border-top: 1px solid var(--bordure);
    padding-top: 16px;
}

.r-suivi-titre {
    font-family: var(--r-titre);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--r-encre);
}

.r-suivi-question {
    font-size: 13px;
    font-weight: 600;
    color: var(--texte-secondaire);
    margin-bottom: 4px;
}

.r-suivi-choix {
    border: 1px solid var(--bordure);
    background: var(--surface-haute);
    color: var(--texte);
    border-radius: 999px;
    padding: 4px 12px;
}

.btn-check:checked + .r-suivi-choix {
    background: var(--r-foret);
    border-color: var(--r-foret);
    color: #fff;
}

.btn-check:focus-visible + .r-suivi-choix {
    outline: 2px solid var(--r-sauge-2);
    outline-offset: 2px;
}

.r-suivi-messages li {
    padding: 8px 12px;
    border-radius: 12px;
    margin-bottom: 6px;
    font-size: 14px;
}

.r-suivi-ok { background: var(--r-creme); }
.r-suivi-conseil { background: var(--r-creme); border: 1px solid var(--bordure); }
.r-suivi-veterinaire { background: var(--r-argile-clair); color: var(--r-encre); font-weight: 600; }
.r-suivi-veterinaire i { color: var(--r-argile); }

:root[data-theme="sombre"] .r-suivi-titre { color: var(--texte); }
:root[data-theme="sombre"] .r-suivi-veterinaire { color: var(--texte); }

/* --- Offer grid: payment methods under the cards --------------------------- */
.r-offres-paiement { display: grid; justify-items: center; gap: .85rem; margin-top: 2.5rem; text-align: center; }

/* On tablet the offer grid has two columns; the third card centres on its row. */
@media (min-width: 641px) and (max-width: 991px) {
    .r-offres .r-grille-3 > :last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
        width: calc(50% - 12px);
    }
}
