/*
 * Les pages publiques d'`app.<domaine>`, à l'identité de l'app et du site vitrine.
 * Les jetons reprennent la palette « Ambre » de l'app mobile : en cas d'écart, c'est l'app qui
 * a raison. Aucune couleur ne s'écrit hors de ces deux blocs.
 */

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/manrope-latin-aA_waSK.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/manrope-latin-ext-PPaTnwi.woff2") format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Newsreader';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/newsreader-latin-Fay8EF3.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Newsreader';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/newsreader-latin-ext-NC2DH1O.woff2") format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bg: #faf7f2;
    --surface: #fffdf9;
    --sunken: #f6f1e9;
    --separator: #f0e8dd;
    --border-control: #e7dccd;
    --border: #e2d6c6;
    --ink: #241e1a;
    --muted: #6f6256;
    --subtle: #96897a;
    --accent: #b45309;
    --accent-soft: #fbf0e0;
    --accent-border: #e7c7ac;
    --on-accent: #fffdf9;
    --focus-border: #b45309;
    --danger: #e5484d;
    --danger-soft: #fdeeeb;
    --danger-border: #f9d2d0;
    --success: #4f7a3f;
    --success-soft: #eef3e2;
    --carbs: #7f8fb5;
    --proteins: #c2554e;
    --lipids: #d99a2e;

    --radius-sm: 6px;
    --radius-control: 8px;
    --radius-button: 10px;
    --radius-card: 12px;
    --radius-field: 15px;

    --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;

    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1d1714;
        --surface: #26201b;
        --sunken: #1f1a16;
        --separator: #382f27;
        --border-control: #423830;
        --border: #423830;
        --ink: #f7f1e8;
        --muted: #bdb0a0;
        --subtle: #9c8f7e;
        --accent: #e0913a;
        --accent-soft: #473421;
        --accent-border: #5e4224;
        --on-accent: #17120f;
        --focus-border: #7a5329;
        --danger: #ff6b70;
        --danger-soft: #442b27;
        --danger-border: #633533;
        --success: #8fb35c;
        --success-soft: #26301e;
        --carbs: #93a2c4;
        --proteins: #e0776c;
        --lipids: #e8ab3f;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: radial-gradient(1000px 560px at 6% -80px, var(--accent-soft), transparent 70%) no-repeat, var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, p, ul {
    margin: 0;
}

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

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* La page : marque, carte, pied de page, en une colonne centrée. */

.page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: calc(440px + 2 * 22px);
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    padding: 32px 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    color: var(--ink);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
    border-radius: var(--radius-control);
}

.brand svg {
    display: block;
    width: 32px;
    height: 32px;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
}

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 16px;
    color: var(--subtle);
    font-size: 12.5px;
}

.footer a {
    color: inherit;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Texte */

.eyebrow {
    color: var(--subtle);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.3;
    text-transform: uppercase;
}

.title {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.1;
    text-wrap: balance;
}

.muted {
    color: var(--muted);
    font-size: 15px;
}

.note {
    color: var(--subtle);
    font-size: 13px;
    line-height: 1.5;
}

.heading {
    font-weight: 700;
}

.list {
    padding-left: 20px;
}

.list li + li {
    margin-top: 2px;
}

.rule {
    height: 1px;
    margin: 4px 0;
    border: 0;
    background: var(--separator);
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chip {
    display: inline-block;
    padding: 0 6px;
    background: var(--sunken);
    border-radius: var(--radius-sm);
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* Écran de fin : médaillon, titre et texte centrés. */

.state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.medallion {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 6px;
    border-radius: 50%;
}

.medallion svg {
    width: 26px;
    height: 26px;
}

.medallion--success {
    background: var(--success-soft);
    color: var(--success);
}

.medallion--neutral {
    background: var(--accent-soft);
    color: var(--accent);
}

/* Bandeaux */

.banner {
    padding: 12px 14px;
    border: 1px solid;
    border-radius: var(--radius-button);
    color: var(--ink);
    font-size: 14.5px;
}

.banner--error {
    background: var(--danger-soft);
    border-color: var(--danger-border);
}

/* Aide repliable */

.help {
    padding: 12px 14px;
    background: var(--sunken);
    border-radius: var(--radius-button);
    font-size: 14.5px;
    line-height: 1.5;
}

.help summary {
    cursor: pointer;
    font-weight: 700;
}

.help summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.help[open] summary {
    margin-bottom: 8px;
}

.help p + p {
    margin-top: 6px;
}

.help ol {
    margin: 6px 0;
}

.help li + li {
    margin-top: 6px;
}

/* Formulaire */

.form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 14px;
    font-weight: 700;
}

.field input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    background: var(--surface);
    border: 1px solid var(--border-control);
    border-radius: var(--radius-field);
    color: var(--ink);
    font: inherit;
    font-size: 16px;
    outline: none;
}

.field input::placeholder {
    color: var(--subtle);
    opacity: 1;
}

.field input:focus {
    border-color: var(--focus-border);
}

.field input[aria-invalid="true"] {
    border-color: var(--danger);
}

.field__error {
    color: var(--danger);
    font-size: 13px;
}

.field .help-text {
    color: var(--muted);
    font-size: 13px;
}

.field--code input {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.field--code input::placeholder {
    letter-spacing: normal;
    text-transform: none;
}

/* Bouton */

.button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 54px;
    padding: 0 20px;
    background: var(--accent);
    border: 0;
    border-radius: var(--radius-button);
    color: var(--on-accent);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.button:hover {
    filter: brightness(1.08);
}

.button--danger {
    background: var(--danger);
}

.button--danger:focus-visible {
    outline-color: var(--danger);
}

/* Bon cadeau */

.voucher {
    padding: 22px 16px;
    font: inherit;
    background: var(--accent-soft);
    border: 1.5px dashed var(--accent-border);
    border-radius: var(--radius-card);
    text-align: center;
}

.voucher__duration {
    display: block;
    color: var(--accent);
    font-family: var(--font-serif);
    font-size: 44px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.1;
}

.voucher__plan {
    display: block;
    margin-top: 4px;
    font-weight: 700;
}

/* Cibles d'installation */

.installs {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.installs__group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-row {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 56px;
    padding: 0 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    color: var(--ink);
    text-decoration: none;
}

.link-row:hover {
    border-color: var(--accent-border);
}

.link-row:focus-visible {
    outline-offset: 2px;
}

.link-row__logo {
    display: block;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.link-row__name {
    flex: 1;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.link-row__arrow {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--subtle);
}

/* Aliment partagé */

.photo {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: var(--sunken);
    border-radius: var(--radius-card);
}

.facts {
    padding: 0;
    list-style: none;
}

.facts li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--separator);
}

.facts li:last-child {
    border-bottom: 0;
}

.facts__label {
    flex: 1;
    color: var(--muted);
}

.facts__value {
    font-weight: 700;
}

.facts__calories .facts__label {
    color: var(--ink);
    font-weight: 700;
}

.facts__calories .facts__value {
    color: var(--accent);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot--carbs {
    background: var(--carbs);
}

.dot--proteins {
    background: var(--proteins);
}

.dot--lipids {
    background: var(--lipids);
}

@media (max-width: 380px) {
    .card {
        padding: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}
