:root {
    /* ===== DESIGN SYSTEM V1 (dashboard / app screens — inchangé) ===== */
    --bg-main: #fdfbf6;
    --bg-card: #ffffff;
    --border-color: #1e1e19;

    --accent-primary: #ff6b6b;
    --accent-secondary: #4dabf7;
    --accent-warning: #fcc419;
    --accent-success: #51cf66;
    --accent-danger: #fa5252;
    --accent-purple: #cc5de8;

    --text-main: #1e1e19;
    --text-muted: #5e5e54;

    --font-heading: 'DM Sans', sans-serif;
    --font-main: 'Inter', sans-serif;

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;

    --border-thick: 3px solid var(--border-color);
    --shadow-hard: 4px 4px 0px var(--border-color);
    --shadow-hard-hover: 6px 6px 0px var(--border-color);
    --shadow-hard-active: 0px 0px 0px var(--border-color);

    --transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* ===== DESIGN SYSTEM V2 — LANDING PAGE (Soft Modern) ===== */
    --color-primary:       #2D6A4F;
    --color-primary-light: #52B788;
    --color-primary-xlight:#D8F3DC;
    --color-accent:        #E07A5F;
    --color-accent-light:  #FAE8E4;
    --color-bg:            #F7F8F3;
    --color-surface:       #FFFFFF;
    --color-surface-2:     #F0F4EE;
    --color-border:        #E2E8DF;
    --color-border-strong: #C7D4C3;
    --color-text-1:        #1A2E22;
    --color-text-2:        #4A6358;
    --color-text-3:        #8BA898;
    --color-success:       #2D6A4F;
    --color-warning:       #F4A261;
    --color-danger:        #C1121F;
    --color-danger-light:  #FFE8EA;

    --lp-shadow-1: 0 1px 3px rgba(45,106,79,0.06), 0 1px 2px rgba(45,106,79,0.04);
    --lp-shadow-2: 0 4px 12px rgba(45,106,79,0.08), 0 2px 4px rgba(45,106,79,0.04);
    --lp-shadow-3: 0 8px 24px rgba(45,106,79,0.12), 0 4px 8px rgba(45,106,79,0.06);

    --lp-radius-sm:   8px;
    --lp-radius-md:   12px;
    --lp-radius-lg:   16px;
    --lp-radius-xl:   24px;
    --lp-radius-2xl:  32px;
    --lp-radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    background-image: radial-gradient(var(--border-color) 2px, transparent 2px);
    background-size: 30px 30px;
    background-position: 0 0;
    transition: background-image 0.3s ease;
    max-width: 100%;
}

@media (max-width: 480px) {
    body {
        background-image: radial-gradient(rgba(30, 30, 25, 0.1) 1.5px, transparent 1.5px);
        background-size: 20px 20px;
    }
}

h1, h2, h3, h4, .logo {
    font-family: var(--font-heading);
    color: var(--text-main);
}

/* Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
}

.sidebar {
    width: 260px;
    background: #fff3bf; /* soft yellow */
    border-right: var(--border-thick);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    box-shadow: 4px 0 0 var(--border-color);
    z-index: 10;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 0 #fff;
    letter-spacing: -1px;
}
.logo span {
    color: var(--accent-primary);
}

nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nav-btn {
    background: #ffffff;
    border: var(--border-thick);
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: var(--shadow-hard);
    transition: var(--transition);
    text-align: left;
    display: flex;
    align-items: center;
}

.nav-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hard-hover);
    background: #e7f5ff;
}

.nav-btn.active {
    background: var(--accent-secondary);
    color: #ffffff;
    box-shadow: var(--shadow-hard);
    transform: none;
}
.nav-btn.active:hover {
    transform: translate(-1px, -1px);
}

.main-content {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
    min-width: 0;
}

/* Views */
.view {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    min-width: 0;
    animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.view.hidden {
    display: none;
}
@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.9) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 0 #fff;
    line-height: 1.2;
}

@media (max-width: 600px) {
    h2 { 
        font-size: 1.7rem; 
        margin-bottom: 1.5rem;
    }
}
@media (max-width: 400px) {
    h2 { 
        font-size: 1.5rem;
        word-wrap: break-word;
    }
}
.subtitle {
    font-size: 1.2rem;
    color: var(--accent-purple);
    font-family: var(--font-main);
    font-weight: 800;
    text-shadow: none;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: var(--border-thick);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-hard);
    transition: var(--transition);
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hard-hover);
}

.card h3 {
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
    border-bottom: 3px dashed var(--border-color);
    padding-bottom: 0.5rem;
}

@media (max-width: 600px) {
    .card h3 { font-size: 1.2rem; }
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}
.form-row {
    display: flex;
    gap: 1rem;
}
.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

input, select {
    width: 100%;
    max-width: 100%;
    background: #f1f3f5;
    border: var(--border-thick);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    outline: none;
    box-shadow: inset 3px 3px 0px rgba(0,0,0,0.05);
    transition: var(--transition);
}

input[type="checkbox"] {
    width: auto;
    box-shadow: none;
}

input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
}

input:focus, select:focus {
    background: #ffffff;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 4px #e7f5ff, inset 3px 3px 0px rgba(0,0,0,0.02);
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.8rem 1rem;
    border: var(--border-thick);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    background: #ffffff;
    color: var(--text-main);
    box-shadow: var(--shadow-hard);
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .btn {
        white-space: normal;
        padding: 0.8rem 0.5rem;
        font-size: 1rem;
    }
}

@media (hover: hover) {
    .btn:hover {
        transform: translate(-2px, -2px);
        box-shadow: var(--shadow-hard-hover);
    }
    .btn-primary:hover { background: #ffe066; }
    .btn-secondary:hover { background: #8ce99a; }
}

.btn:active {
    transform: translate(4px, 4px);
    box-shadow: var(--shadow-hard-active);
}

.btn-primary { background: var(--accent-warning); }
.btn-secondary { background: var(--accent-success); }

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
}

.advice-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    width: 100%;
}

/* --- Advice Page Table Styles --- */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.advice-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 280px;
    font-size: 0.9rem;
}

.advice-table th,
.advice-table td {
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--border-color);
    text-align: left;
    vertical-align: top;
    line-height: 1.4;
}

.advice-table thead tr {
    background: var(--accent-warning);
    font-family: var(--font-heading);
}

.advice-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

@media (max-width: 768px) {
    .advice-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    /* Reset grid-column spans on mobile so nothing breaks layout */
    .advice-grid > .card[style*="grid-column"],
    .advice-grid > .card {
        grid-column: auto !important;
    }
    /* Inner sub-grids (used for tips layout inside cards) */
    .advice-grid .advice-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    /* Ensure the advice section h2 title wraps */
    #advice-view h2 {
        font-size: 1.6rem;
        text-align: center;
        word-break: break-word;
        hyphens: auto;
        padding: 0 0.25rem;
    }
    /* Random tip card full width */
    #random-tip-container {
        margin-bottom: 1.25rem;
    }
    /* Card inner text sizes */
    .advice-table {
        font-size: 0.85rem;
    }
    .advice-table th,
    .advice-table td {
        padding: 0.5rem 0.6rem;
    }
}

@media (max-width: 768px) and (min-width: 769px) {
    .advice-grid {
        grid-template-columns: 1fr;
    }
}

/* Hide utility for mobile */
@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }
}

.weigh-in-card {
    display: none;
    background: #e3f2fd !important;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    gap: 1.5rem;
}

.weigh-in-text {
    flex: 1;
}

.weigh-in-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.weigh-in-actions .btn {
    width: auto;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
}

.weigh-in-actions input {
    width: 150px;
}

/* Progress Circle */
.progress-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #e7f5ff;
}

.progress-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-success) 0deg, #ffffff 0deg);
    border: var(--border-thick);
    box-shadow: var(--shadow-hard);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: background 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-circle.danger {
    background: conic-gradient(var(--accent-danger) 0deg, #ffffff 0deg) !important;
}

.circle-inner {
    width: 140px;
    height: 140px;
    background: #ffffff;
    border-radius: 50%;
    border: var(--border-thick);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.remaining-value {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 0.2rem;
    text-shadow: 2px 2px 0 #e9ecef;
}

.remaining-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    line-height: 1.3;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding-top: 1rem;
    border-top: 3px dashed var(--border-color);
    font-size: 1rem;
    font-weight: 800;
}

/* Macros */
.macro-card {
    background: #ffe3e3;
    display: flex;
    flex-direction: column;
}

.macro-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding-bottom: 0.5rem;
}
.macro-value {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--text-main);
    text-shadow: 3px 3px 0 #fff;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.macro-label {
    font-weight: 800;
    font-size: 1.1rem;
}

.add-actions-card {
    background: #d3f9d8;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* History List */
.history-card {
    grid-column: 1 / -1;
    background: #ffffff;
}

.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem;
}

.history-list::-webkit-scrollbar { width: 8px; }
.history-list::-webkit-scrollbar-track { background: #f1f3f5; border-radius: 10px; border: 2px solid var(--border-color); }
.history-list::-webkit-scrollbar-thumb { background: var(--accent-secondary); border-radius: 10px; border: 2px solid var(--border-color); }

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #ffffff;
    border: var(--border-thick);
    border-radius: var(--radius-sm);
    box-shadow: 3px 3px 0px var(--border-color);
    transition: var(--transition);
}

.history-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px var(--border-color);
}

.history-title-group {
    flex: 1;
}

.history-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    text-transform: capitalize;
    margin-bottom: 0.25rem;
}

.history-details {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-muted);
}
.history-details strong {
    color: var(--accent-primary);
}

.history-actions {
    display: flex;
    gap: 0.5rem;
}

.history-actions button {
    background: #ffffff;
    border: 2px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 2px 2px 0px var(--border-color);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (hover: hover) {
    .history-actions .btn-edit:hover {
        background: var(--accent-warning);
        transform: translate(-2px, -2px);
        box-shadow: 4px 4px 0px var(--border-color);
    }

    .history-actions .btn-delete:hover {
        background: var(--accent-danger);
        color: #fff;
        transform: translate(-2px, -2px);
        box-shadow: 4px 4px 0px var(--border-color);
    }
}

.history-actions .btn-edit:active {
    background: var(--accent-warning);
    transform: translate(2px, 2px);
    box-shadow: 0px 0px 0px var(--border-color);
}

.history-actions .btn-delete:active {
    background: var(--accent-danger);
    color: #fff;
    transform: translate(2px, 2px);
    box-shadow: 0px 0px 0px var(--border-color);
}

/* Stats */
.stats-card {
    background: #fff0f6; /* light pink */
    border: var(--border-thick);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-hard);
    margin-top: 1.5rem;
}
.stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}
.stat .label {
    font-weight: 800;
    color: var(--text-muted);
}
.stat .value {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--text-main);
}

.empty-state {
    text-align: center;
    font-weight: 800;
    color: var(--text-muted);
    padding: 2rem;
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-sm);
    background: #f8f9fa;
}

/* Advice Page Special Styles */
.did-you-know-card {
    background: var(--accent-purple) !important;
    color: #ffffff;
    text-align: center;
    border-color: var(--border-color);
}
.did-you-know-card .tip-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    display: block;
}
.did-you-know-card .tip-content {
    font-size: 1.1rem;
    font-weight: 700;
}

/* --- LANDING PROCESS SECTION --- */
.process-section {
    padding: 5rem 2rem;
    background: #fdfbf6;
    text-align: center;
}

.process-section h2 {
    font-size: 2.2rem;
    margin-bottom: 3rem;
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.process-step {
    padding: 2rem;
    text-align: left;
    transition: transform 0.3s ease;
}

.process-step:hover {
    transform: translateY(-5px);
}

.process-step .step-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.process-icon-img {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    display: block;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.process-step h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.process-step ul {
    list-style: none;
    padding: 0;
}

.process-step ul li {
    margin-bottom: 0.75rem;
    position: relative;
    padding-left: 1.5rem;
    line-height: 1.4;
}

.process-step ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-success);
    font-weight: 800;
}

/* --- DAILY PROGRESS BAR --- */
.daily-progress-container {
    grid-column: 1 / -1;
    background: white;
    padding: 1.5rem;
}

.daily-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.daily-progress-title {
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.daily-progress-percentage {
    font-weight: 800;
    color: var(--accent-secondary);
}

.daily-progress-track {
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.daily-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
    width: 0%;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.advice-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: var(--border-thick);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: 1rem;
}

.advice-table th, .advice-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.advice-table th {
    background: #f1f3f5;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-main);
}

.advice-table tr:last-child td {
    border-bottom: none;
}

.advice-table td:first-child {
    border-right: 2px solid var(--border-color);
    background: #fdfbf6;
    width: 35%;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
}

/* ============================================================
   MODALS V2 — Soft Modern (bottom sheet mobile / centré desktop)
   ============================================================ */

/* Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 46, 34, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end; /* bottom sheet sur mobile */
    justify-content: center;
    z-index: 1000;
    padding: 0;
    overflow: hidden;
    transition: opacity 0.22s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Desktop : centré */
@media (min-width: 768px) {
    .modal-overlay {
        align-items: center;
        padding: 20px;
    }
}

/* Contenu modal */
.modal-content {
    background: var(--color-surface);
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: var(--lp-radius-2xl) var(--lp-radius-2xl) 0 0; /* 32px top uniquement */
    box-shadow: 0 20px 48px rgba(45, 106, 79, 0.16), 0 8px 16px rgba(45, 106, 79, 0.08);
    padding: 0;
    transform: translateY(0);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    position: relative;
    rotate: unset;
    /* Scrollbar cachée */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-content::-webkit-scrollbar,
#ai-items-detail::-webkit-scrollbar {
    display: none;
}

#ai-items-detail {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-overlay.hidden .modal-content {
    transform: translateY(100%);
    transition: transform 0.22s ease-in;
}

/* Desktop : centré, radius full */
@media (min-width: 768px) {
    .modal-content {
        max-width: 480px;
        border-radius: var(--lp-radius-xl); /* 24px tous côtés */
        max-height: 85vh;
    }

    .modal-overlay.hidden .modal-content {
        transform: translateY(-20px) scale(0.97);
        opacity: 0;
        transition: transform 0.22s ease-in, opacity 0.22s ease-in;
    }
}

/* Drag handle */
.modal-drag-handle {
    width: 40px;
    height: 4px;
    background: var(--color-border);
    border-radius: var(--lp-radius-full);
    margin: 12px auto 0;
}

@media (min-width: 768px) {
    .modal-drag-handle { display: none; }
}

/* Header modal */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
    margin-bottom: 20px;
}

.modal-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-1);
    margin: 0;
    line-height: 1.25;
    text-shadow: none;
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    color: var(--color-text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.modal-close-btn:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border-color: var(--color-danger);
}

/* Corps du modal */
.modal-body {
    padding: 0 24px 24px;
}

/* Labels dans modales */
.modal-body label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-2);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

/* Inputs dans modales */
.modal-body input[type="number"],
.modal-body input[type="text"],
.modal-body select {
    width: 100%;
    height: 52px;
    min-height: 52px;
    background: var(--color-surface-2);
    border: 1.5px solid var(--color-border);
    border-radius: var(--lp-radius-md);
    font-family: 'DM Sans', sans-serif;
    font-size: 16px; /* iOS zoom prevention — ne pas descendre sous 16px */
    font-weight: 600;
    color: var(--color-text-1);
    padding: 0 16px;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    box-sizing: border-box;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

/* Select wrapper — gère la flèche custom via pseudo-élément (compatible iOS Safari) */
/* Contexte de positionnement pour TOUS les select-wrapper */
.select-wrapper {
    position: relative !important;
    display: block;
    width: 100%;
}
.modal-body .select-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 52px;
}

/* Flèche chevron via pseudo-élément — indépendant de appearance */
.modal-body .select-wrapper::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%232D6A4F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 20px 20px;
    pointer-events: none; /* laisse les clics passer au select */
}

/* Select dans le wrapper — appearance none + taille garantie */
.modal-body .select-wrapper select {
    width: 100% !important;
    padding: 14px 44px 14px 16px !important;
    min-height: 52px !important;
    height: auto !important;
    line-height: 1.5 !important;
    background-color: var(--color-surface-2) !important;
    background-image: none !important; /* la flèche est sur le ::after du wrapper */
    -webkit-appearance: none !important;
    appearance: none !important;
    font-size: 16px !important; /* iOS Safari zoom prevention */
    cursor: pointer;
    box-sizing: border-box !important;
}

.modal-body input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
    background: var(--color-surface);
}

/* ============================================================
   CUSTOM SELECT DROPDOWN
   Remplace le picker natif mobile par un dropdown CSS identique
   à ce qu'on voit sur desktop.
============================================================ */

/* Wrapper en position relative pour le dropdown absolu */
.modal-body .select-wrapper {
    position: relative;
    display: block;
    width: 100%;
    min-height: 52px;
}

/* Cache le ::after (flèche) quand le custom select est actif */
.modal-body .select-wrapper.cs-open::after,
.modal-body .select-wrapper .cs-trigger ~ .cs-trigger-arrow {
    display: none;
}
.modal-body .select-wrapper::after {
    display: none; /* la flèche est dans .cs-trigger-arrow */
}

/* Bouton déclencheur */
.cs-trigger {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    background: var(--color-surface-2);
    border: 1.5px solid var(--color-border);
    border-radius: var(--lp-radius-md, 12px);
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-1);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.cs-trigger:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

.cs-open .cs-trigger {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.cs-trigger-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cs-trigger-arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: transform 0.18s ease;
}

.cs-open .cs-trigger-arrow {
    transform: rotate(180deg);
}

/* Liste dropdown */
.cs-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 2000;
    background: var(--color-surface);
    border: 1.5px solid var(--color-primary);
    border-top: none;
    border-bottom-left-radius: var(--lp-radius-md, 12px);
    border-bottom-right-radius: var(--lp-radius-md, 12px);
    box-shadow: var(--shadow-3);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 220px;
    overflow-y: auto;
    display: none;
    -webkit-overflow-scrolling: touch;
}
/* Ouverture vers le haut quand pas assez d'espace en bas */
.cs-dropup .cs-dropdown {
    top: auto;
    bottom: 100%;
    border-top: 1.5px solid var(--color-primary);
    border-bottom: none;
    border-radius: var(--lp-radius-md, 12px) var(--lp-radius-md, 12px) 0 0;
}

.cs-open .cs-dropdown {
    display: block;
}

/* Options */
.cs-option {
    padding: 13px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-1);
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid var(--color-border);
}

.cs-option:last-child {
    border-bottom: none;
}

.cs-option:hover,
.cs-option:active {
    background: var(--color-surface-2);
    color: var(--color-primary);
}

.cs-option.cs-selected {
    background: var(--color-primary-xlight);
    color: var(--color-primary);
    font-weight: 700;
}

/* Groupes (optgroup simulés) */
.cs-optgroup-label {
    padding: 8px 16px 4px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-text-3);
    pointer-events: none;
}

.modal-body select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
    /* background-color au lieu de background pour préserver la flèche SVG */
    background-color: var(--color-surface);
    outline: none;
}

/* Form group */
.modal-body .form-group { margin-bottom: 16px; }

/* Form row 2 colonnes */
.modal-body .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-body .form-row .form-group { margin-bottom: 0; }

/* Hint IA */
.ai-hint {
    background: var(--color-primary-xlight);
    border: 1px solid var(--color-primary-light);
    border-radius: var(--lp-radius-md);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--color-text-2);
    line-height: 1.5;
}

.ai-hint strong { color: var(--color-text-1); }

.ai-hint details summary {
    color: var(--color-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-hint details summary::-webkit-details-marker { display: none; }
.ai-hint details[open] summary::after { content: ' ▲'; font-size: 10px; }
.ai-hint details:not([open]) summary::after { content: ' ▼'; font-size: 10px; }

.ai-hint details > div {
    margin-top: 8px;
    padding: 10px;
    background: var(--color-surface);
    border-radius: var(--lp-radius-sm);
    border: 1px solid var(--color-border);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--color-text-1);
    font-style: italic;
    line-height: 1.5;
}

/* Bouton submit dans les modales */
.modal-body .btn-primary {
    width: 100%;
    height: 52px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: var(--lp-radius-full);
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.18s, transform 0.12s;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-body .btn-primary:hover {
    background: #C96A4F;
    transform: none;
    box-shadow: var(--shadow-1);
}

.modal-body .btn-primary:active { transform: scale(0.98); }

/* Modal Objectif Atteint — centré (pas de bottom sheet) */
#goal-reached-modal {
    align-items: center;
    padding: 20px;
}

#goal-reached-modal .modal-content {
    border-radius: var(--lp-radius-xl) !important;
    transform: scale(1);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
    max-width: 380px;
}

#goal-reached-modal.hidden .modal-content {
    transform: scale(0.92);
    opacity: 0;
    transition: transform 0.22s ease-in, opacity 0.22s ease-in;
}

/* Zone liste activités scrollable */
#manage-activities-list {
    max-height: 50vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    scrollbar-width: none;
}

#manage-activities-list::-webkit-scrollbar { display: none; }

/* Zone édition inline */
#edit-custom-activity-form {
    background: var(--color-surface-2);
    border: 1.5px dashed var(--color-border-strong);
    border-radius: var(--lp-radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

#edit-custom-activity-form p {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-1);
    margin-bottom: 12px;
}

/* Bouton fermer du modal gestion activités */
#manage-activities-modal .btn[onclick="closeManageActivitiesModal()"] {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-3);
    border-radius: var(--lp-radius-md);
    height: 44px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.15s;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

#manage-activities-modal .btn[onclick="closeManageActivitiesModal()"]:hover {
    background: var(--color-surface-2);
    transform: none;
}

/* Suppression de l'ancien .close-btn rouge — remplacé par .modal-close-btn */
.close-btn {
    display: none !important;
}

/* AI Estimate Container */
.ai-estimate-container {
    margin-top: 1rem;
    padding: 1.25rem;
    background: #f0f7ff;
    border-radius: var(--radius-sm);
    border: 2px solid var(--accent-secondary);
    box-shadow: 4px 4px 0 var(--accent-secondary);
}

@media (max-width: 480px) {
    .ai-estimate-container {
        padding: 1rem;
        box-shadow: 3px 3px 0 var(--accent-secondary);
    }
}

/* Modal Grid Layout */
.modal-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .modal-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        align-items: start;
    }

    .modal-full-width {
        grid-column: 1 / -1;
    }
}

/* Responsive Dashboard Layout */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        padding: 0.75rem;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border-right: none;
        border-bottom: var(--border-thick);
        box-shadow: 0 4px 0px var(--border-color);
        gap: 0.75rem;
        position: sticky;
        top: -1px;
        z-index: 100;
        transition: all 0.4s ease;
    }
    .sidebar .logo, .sidebar .sidebar-user {
        transition: all 0.4s ease;
        max-height: 250px;
        opacity: 1;
        overflow: hidden;
        width: 100%;
        text-align: center;
    }
    .sidebar.scrolled {
        padding: 0.5rem 0.75rem;
        gap: 0;
    }
    .sidebar.scrolled .logo,
    .sidebar.scrolled .sidebar-user {
        max-height: 0 !important;
        opacity: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border-width: 0 !important;
    }
    nav {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        width: 100%;
        justify-content: center;
        gap: 0.4rem;
    }
    .nav-btn {
        flex: 1 1 calc(50% - 0.4rem);
        min-width: 110px;
        text-align: center;
        justify-content: center;
        padding: 0.5rem 0.3rem;
        font-size: 0.85rem;
        white-space: normal;
        line-height: 1.2;
    }
    .main-content {
        padding: 1.25rem 1.25rem;
    }
    
    /* Grids & Cards */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Reorder dashboard items on mobile */
    #dashboard-view .daily-progress-container { order: 1; }
    #dashboard-view .add-actions-card { order: 2; }
    #dashboard-view .weigh-in-card { order: 3; }
    #dashboard-view .progress-card { order: 4; }
    #dashboard-view .history-card { order: 5; }

    .card {
        padding: 1.2rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    /* Prevent all text from escaping card bounds */
    .card p,
    .card li,
    .card h3,
    .card h4,
    .card span {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    .card ul,
    .card ol {
        padding-left: 1rem;
        max-width: 100%;
    }
    /* Advice specific */
    .advice-content {
        max-width: 100%;
    }
    #advice-view {
        max-width: 100%;
    }
    /* Ensure details elements inside cards have word-wrap */
    .card details,
    .card summary {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    h2 {
        font-size: 1.8rem;
        text-align: center;
        margin-bottom: 1.5rem;
        width: 100%;
    }

    .dashboard-header {
        flex-direction: column !important;
        gap: 1rem;
        align-items: center !important;
        text-align: center;
    }

    .weigh-in-card {
        flex-direction: column !important;
        text-align: center !important;
        padding: 1.5rem 1.25rem !important;
        gap: 1.52rem !important;
    }

    .weigh-in-text {
        width: 100%;
    }

    .weigh-in-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }

    .weigh-in-actions .btn, 
    .weigh-in-actions input {
        width: 100% !important;
        max-width: 280px;
    }

    .weigh-in-card h3 {
        text-align: center;
        margin-bottom: 0 !important;
        font-size: 1.3rem !important;
        line-height: 1.4;
    }
    
    /* Forms */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    /* History List */
    .history-item {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    .history-actions {
        width: auto;
    }
    
    .macro-value {
        font-size: 3rem;
    }
    .remaining-value {
        font-size: 2.2rem;
    }
}

@media (max-width: 400px) {
    .progress-circle {
        width: 160px;
        height: 160px;
    }
    .circle-inner {
        width: 120px;
        height: 120px;
    }
    .remaining-value {
        font-size: 1.8rem;
    }
    .macro-value {
        font-size: 2.5rem;
    }
    .remaining-label {
        font-size: 0.65rem;
        letter-spacing: 0.5px;
    }
}

/* ============================================================
   AUTH SCREEN V2 — Soft Modern (design system V2)
   Toutes les classes préfixées "auth-" pour isolation totale
   ============================================================ */

/* Fond et centrage */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg);
    background-image: none; /* neutralise le dots pattern du body */
    padding: 24px 20px;
}

/* Card principale */
.auth-container {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border-radius: var(--lp-radius-xl);
    box-shadow: var(--lp-shadow-3);
    padding: 40px 32px;
    animation: authFadeIn 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Bouton retour */
.auth-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-2);
    padding: 0;
    margin-bottom: 20px;
    min-height: 44px;
    transition: color 150ms ease-out;
    text-decoration: none;
}

.auth-back-btn:hover {
    color: var(--color-primary);
}

/* Logo */
.auth-logo {
    font-family: 'DM Sans', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

/* Bannière d'erreur — le JS écrit textContent directement */
.auth-error {
    display: block;
    background: var(--color-danger-light);
    border-left: 3px solid var(--color-danger);
    border-radius: var(--lp-radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-danger);
    line-height: 1.5;
}

.auth-error.hidden {
    display: none !important;
}

/* En-tête formulaire */
.auth-form-header {
    margin-bottom: 24px;
}

.auth-form-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text-1);
    text-align: center;
    margin: 0 0 4px 0;
    line-height: 1.3;
    text-shadow: none;
}

.auth-form-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: var(--color-text-2);
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

/* Groupe input avec floating label */
.auth-input-group {
    position: relative;
    margin-bottom: 16px;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-3);
    pointer-events: none;
    transition: color 180ms ease;
    z-index: 1;
}

/* Override fort des styles globaux d'input dans le contexte auth */
.auth-container .auth-input-group input,
.auth-container .auth-input-group input[type="email"],
.auth-container .auth-input-group input[type="password"],
.auth-container .auth-input-group input[type="text"] {
    width: 100%;
    height: 56px;
    background: var(--color-surface-2) !important;
    border: 1.5px solid var(--color-border) !important;
    border-radius: var(--lp-radius-md) !important;
    padding: 22px 52px 8px 44px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    color: var(--color-text-1) !important;
    box-shadow: none !important;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
    -webkit-appearance: none;
    appearance: none;
    max-width: 100%;
}

.auth-container .auth-input-group input:focus,
.auth-container .auth-input-group input[type="email"]:focus,
.auth-container .auth-input-group input[type="password"]:focus,
.auth-container .auth-input-group input[type="text"]:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12) !important;
    background: var(--color-surface) !important;
}

/* Label monté : quand focus ou valeur saisie */
/* Note: le sélecteur + cible le label directement après l'input */
.auth-input-group input:focus + label,
.auth-input-group input:not(:placeholder-shown) + label,
.auth-input-group input:-webkit-autofill + label {
    top: 10px !important;
    transform: translateY(0) !important;
    font-size: 11px !important;
    color: var(--color-primary) !important;
    font-weight: 600 !important;
}

/* Floating label — positionné après l'input dans le DOM */
.auth-input-group label {
    display: block !important;
    position: absolute !important;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: var(--color-text-3);
    pointer-events: none;
    transition: top 180ms ease, transform 180ms ease, font-size 180ms ease, color 180ms ease, font-weight 180ms ease;
    background: transparent;
    white-space: nowrap;
    margin-bottom: 0;
    line-height: 1;
}

/* Bouton oeil (toggle password) */
.auth-eye-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-3);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    transition: color 150ms ease;
    z-index: 2;
}

.auth-eye-btn:hover {
    color: var(--color-text-2);
}

/* Lien mot de passe oublié */
.auth-forgot-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    min-height: 44px;
    align-items: center;
}

.auth-link-small {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: none;
    transition: opacity 150ms ease;
}

.auth-link-small:hover {
    opacity: 0.75;
    text-decoration: underline;
}

/* Bouton primaire auth */
.auth-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    background: var(--color-accent);
    color: #ffffff;
    border: none;
    border-radius: var(--lp-radius-full);
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease-out, box-shadow 150ms ease-out, transform 150ms ease-out, opacity 150ms ease;
    box-shadow: var(--lp-shadow-2);
    margin-bottom: 20px;
    white-space: nowrap;
}

.auth-btn-primary:hover:not(:disabled):not(.btn-disabled) {
    background: #C96A4F;
    box-shadow: var(--lp-shadow-3);
    transform: translateY(-1px);
}

.auth-btn-primary:active:not(:disabled):not(.btn-disabled) {
    transform: translateY(0);
    box-shadow: var(--lp-shadow-1);
}

.auth-btn-primary.btn-disabled,
.auth-btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--color-surface-2);
    color: var(--color-text-3);
    box-shadow: none;
    transform: none;
}

/* Séparateur "ou" */
.auth-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.auth-separator-line {
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.auth-separator-text {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--color-text-3);
    white-space: nowrap;
}

/* Texte switch ("Pas encore de compte ?") */
.auth-switch-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--color-text-2);
    text-align: center;
    margin-bottom: 10px;
}

/* Bouton secondaire auth */
.auth-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    border: none;
    border-radius: var(--lp-radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease-out, transform 150ms ease-out;
    white-space: nowrap;
}

.auth-btn-secondary:hover {
    background: #f0c8bd;
    transform: translateY(-1px);
}

/* ---- Bloc RGPD ---- */
.auth-rgpd-block {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--lp-radius-md);
    padding: 16px;
    margin-bottom: 20px;
    transition: background 150ms ease, border-color 150ms ease;
}

.auth-rgpd-block:has(input:checked) {
    border-color: var(--color-primary-light);
    background: var(--color-primary-xlight);
}

.auth-rgpd-label {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    /* override global label styles */
    font-weight: 400;
    font-size: 14px;
    color: var(--color-text-1);
    margin-bottom: 0;
}

.auth-rgpd-checkbox-wrap {
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    width: 20px;
    height: 20px;
}

/* Cacher la vraie checkbox — override complet des styles globaux */
.auth-rgpd-checkbox-wrap input[type="checkbox"],
.auth-container .auth-rgpd-checkbox-wrap input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    cursor: pointer;
    box-shadow: none !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    z-index: 2;
}

/* Checkbox custom */
.auth-rgpd-custom-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-surface);
    transition: background 150ms ease, border-color 150ms ease;
    pointer-events: none;
}

.auth-rgpd-check {
    opacity: 0;
    transition: opacity 100ms ease;
}

/* État coché */
.auth-rgpd-checkbox-wrap input[type="checkbox"]:checked ~ .auth-rgpd-custom-checkbox {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.auth-rgpd-checkbox-wrap input[type="checkbox"]:checked ~ .auth-rgpd-custom-checkbox .auth-rgpd-check {
    opacity: 1;
}

/* Focus visible pour accessibilité */
.auth-rgpd-checkbox-wrap input[type="checkbox"]:focus-visible ~ .auth-rgpd-custom-checkbox {
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

.auth-rgpd-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--color-text-1);
    line-height: 1.55;
}

.auth-rgpd-link {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
    transition: opacity 150ms ease;
}

.auth-rgpd-link:hover {
    opacity: 0.75;
}

.auth-rgpd-note {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-3);
    font-style: normal;
}

/* ---- Lien inline (connexion depuis inscription) ---- */
.auth-link-inline {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    transition: opacity 150ms ease;
}

.auth-link-inline:hover {
    opacity: 0.75;
    text-decoration: underline;
}

/* ---- Bloc succès reset ---- */
.auth-success-block {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--color-primary-xlight);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--lp-radius-sm);
    padding: 12px 16px;
    margin-top: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--color-primary);
    line-height: 1.5;
}

.auth-success-block svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-success-block.hidden {
    display: none !important;
}

/* ---- Lien retour (reset → login) ---- */
.auth-link-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: none;
    min-height: 44px;
    transition: opacity 150ms ease;
}

.auth-link-back:hover {
    opacity: 0.75;
    text-decoration: underline;
}

/* ============================================================
   AUTH SCREEN V2 — Responsive mobile 375px
   ============================================================ */
@media (max-width: 480px) {
    .auth-screen {
        padding: 16px 0;
        align-items: flex-start;
        min-height: 100vh;
    }

    .auth-container {
        border-radius: 0;
        box-shadow: none;
        padding: 32px 20px;
        min-height: 100vh;
        max-width: 100%;
    }
}

@media (max-width: 375px) {
    .auth-form-title {
        font-size: 20px;
    }
    .auth-btn-primary {
        font-size: 15px;
    }
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    text-align: center;
}

/* Profile Header Card */
.profile-header-card {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.profile-email-container {
    font-size: 1.1rem;
    font-family: var(--font-heading);
}

.logout-btn {
    width: auto;
    background: var(--accent-danger);
    color: #fff;
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
    border-color: var(--accent-danger);
    box-shadow: 4px 4px 0 rgba(250, 82, 82, 0.4);
}

.logout-btn:hover {
    background: #ff8787;
    border-color: #ff8787;
    box-shadow: 6px 6px 0 rgba(250, 82, 82, 0.4);
    color: #fff;
}

@media (max-width: 768px) {
    .profile-header-card {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
    .profile-email-container {
        margin-bottom: 0.5rem;
    }
    .profile-email-container span {
        display: inline-block;
        margin-left: 0.25rem;
    }
}

/* ============================================================
   LANDING PAGE V2 — Soft Modern Design System
   Toutes les classes sont préfixées "lp-" pour isoler du reste
   ============================================================ */

/* Reset hérité pour la landing */
.landing-page {
    width: 100%;
    min-height: 100vh;
    background-color: var(--color-bg);
    font-family: 'Inter', sans-serif;
    color: var(--color-text-1);
    animation: lp-page-in 0.5s ease-out both;
}

@keyframes lp-page-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Animations au scroll ---- */
.lp-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s cubic-bezier(0.22,1,0.36,1),
                transform 0.55s cubic-bezier(0.22,1,0.36,1);
}

.lp-reveal.lp-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Délais en cascade pour les enfants d'une grille */
.lp-reveal-d1 { transition-delay: 0.08s; }
.lp-reveal-d2 { transition-delay: 0.16s; }
.lp-reveal-d3 { transition-delay: 0.24s; }
.lp-reveal-d4 { transition-delay: 0.32s; }

/* ---- Logo commun ---- */
.lp-logo {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--color-text-1);
    letter-spacing: -0.5px;
    text-decoration: none;
    user-select: none;
}

.lp-logo span {
    color: var(--color-primary);
}

/* ---- Boutons communs ---- */
.lp-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 14px 28px;
    background: var(--color-accent);
    color: #ffffff;
    border: none;
    border-radius: var(--lp-radius-md);
    cursor: pointer;
    transition: background 200ms ease-out, box-shadow 200ms ease-out, transform 200ms ease-out;
    text-decoration: none;
    white-space: nowrap;
    gap: 6px;
    margin-top: 32px;
}

.lp-btn-primary:hover {
    background: #C96A4F;
    box-shadow: var(--lp-shadow-2);
    transform: translateY(-1px);
}

.lp-btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--lp-shadow-1);
}

.lp-btn-full {
    width: 100%;
    margin-top: 0;
    padding: 16px 28px;
    font-size: 1.0625rem;
    box-shadow: 0 4px 16px rgba(224,122,95,0.35);
}

.lp-btn-full:hover {
    box-shadow: 0 6px 24px rgba(224,122,95,0.45);
    transform: translateY(-2px);
}

.lp-btn-full:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(224,122,95,0.3);
}

.lp-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: transparent;
    color: var(--color-accent);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    border: 1.5px solid var(--color-accent);
    border-radius: var(--lp-radius-md);
    cursor: pointer;
    transition: border-color 200ms ease-out, background 200ms ease-out, color 200ms ease-out;
    white-space: nowrap;
}

.lp-btn-ghost:hover {
    background: var(--color-accent-light);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.lp-btn-white {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 36px auto 0;
    padding: 16px 36px;
    background: var(--color-accent);
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 1.0625rem;
    font-weight: 700;
    border: 2px solid var(--color-accent);
    border-radius: var(--lp-radius-md);
    cursor: pointer;
    transition: background 220ms ease-out, color 220ms ease-out, transform 220ms ease-out, box-shadow 220ms ease-out;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(224,122,95,0.35);
}

.lp-btn-white:hover {
    background: #C96A4F;
    border-color: #C96A4F;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(224,122,95,0.45);
}

.lp-btn-white:active {
    transform: translateY(0);
}

/* Focus visible — accessibilité */
.lp-btn-primary:focus-visible,
.lp-btn-ghost:focus-visible,
.lp-btn-white:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ---- Titres et textes communs ---- */
.lp-section-title {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 600;
    color: var(--color-text-1);
    line-height: 1.2;
    margin-bottom: 0;
    text-align: center;
}

/* ---- Inner width ---- */
.lp-section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   HEADER sticky
   ============================================================ */
.lp-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(247, 248, 243, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
    transition: border-color 200ms ease;
}

.lp-header--scrolled {
    border-bottom-color: var(--color-border);
}

.lp-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================================
   HERO
   ============================================================ */
.lp-hero {
    padding: 64px 20px 48px;
    background: var(--color-bg);
}

.lp-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: center;
}

.lp-hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    text-align: left;
}

.lp-hero-title {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(2.25rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--color-text-1);
    line-height: 1.08;
    margin: 0;
    max-width: 560px;
}

.lp-hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1rem, 2vw, 1.125rem);
    font-weight: 400;
    color: var(--color-text-2);
    line-height: 1.65;
    margin: 20px 0 0;
    max-width: 480px;
}

.lp-hero-meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: var(--color-text-3);
    margin: 16px 0 0;
    line-height: 1.5;
}

.lp-meta-check {
    color: var(--color-primary);
    font-weight: 600;
}

/* ---- Mock-UI Hero — pur CSS ---- */
.lp-hero-graphic {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--lp-radius-xl);
    box-shadow: var(--lp-shadow-3);
    border: 1px solid var(--color-border);
    padding: 24px;
    max-width: 380px;
    margin: 0 auto;
    animation: lp-float 5s ease-in-out infinite;
    z-index: 0;
}

@keyframes lp-float {
    0%, 100% { transform: translateY(0px) rotate(-1deg); }
    50%       { transform: translateY(-10px) rotate(0.5deg); }
}

.lp-hero-graphic:hover {
    animation-play-state: paused;
    transform: rotate(0deg) translateY(-4px);
    box-shadow: 0 16px 40px rgba(45,106,79,0.18);
    transition: box-shadow 250ms ease-out;
}

.lp-hero-graphic::before {
    content: '';
    position: absolute;
    inset: -40px;
    background: var(--color-primary-xlight);
    border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
    opacity: 0.45;
    z-index: -1;
    filter: blur(40px);
    pointer-events: none;
}

.lp-mock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 14px;
}

.lp-mock-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-3);
}

.lp-mock-kcal {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary);
}

.lp-mock-bar-track {
    height: 6px;
    background: var(--color-border);
    border-radius: var(--lp-radius-full);
    overflow: hidden;
    margin-bottom: 14px;
}

.lp-mock-bar-fill {
    height: 100%;
    width: 72%;
    background: linear-gradient(90deg, var(--color-primary), #52B788);
    border-radius: var(--lp-radius-full);
    animation: lp-bar-grow 1.6s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: 0.4s;
}

@keyframes lp-bar-grow {
    from { width: 0%; }
    to   { width: 72%; }
}

.lp-mock-macros {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.lp-mock-pill {
    background: var(--color-primary-xlight);
    border-radius: var(--lp-radius-sm);
    padding: 5px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    border: 1px solid rgba(45,106,79,0.15);
}

.lp-mock-meals {
    display: flex;
    flex-direction: column;
}

.lp-mock-meal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--color-border);
}

.lp-mock-meal-last {
    border-bottom: none;
}

.lp-mock-meal-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: var(--color-text-2);
}

.lp-mock-meal-kcal {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* ============================================================
   FEATURES
   ============================================================ */
.lp-features {
    padding: 80px 0;
    background: var(--color-bg);
}

.lp-features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 48px;
}

.lp-feature-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--lp-radius-lg);
    padding: 32px 28px;
    box-shadow: var(--lp-shadow-1);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: box-shadow 250ms ease-out, transform 250ms ease-out, border-color 250ms ease-out;
}

.lp-feature-card:hover {
    box-shadow: var(--lp-shadow-2);
    transform: translateY(-3px);
    border-color: var(--color-border-strong);
}

.lp-feature-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--color-primary-xlight);
    border-radius: var(--lp-radius-sm);
    color: var(--color-primary);
    flex-shrink: 0;
}

.lp-feature-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-1);
    margin: 0;
    line-height: 1.3;
}

.lp-feature-text {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--color-text-2);
    line-height: 1.6;
    margin: 0;
}

/* ============================================================
   PROCESS
   ============================================================ */
.lp-process {
    padding: 80px 0;
    background: var(--color-bg);
}

.lp-process-intro {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--color-text-2);
    line-height: 1.6;
    text-align: center;
    max-width: 540px;
    margin: 16px auto 0;
}

.lp-process-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 720px;
    margin: 48px auto 0;
}

.lp-process-step {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    padding-bottom: 40px;
    position: relative;
}

/* Connecteur vertical entre étapes */
.lp-process-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 36px;
    top: 80px;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}

.lp-step-number {
    font-family: 'DM Sans', sans-serif;
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
    min-width: 80px;
    user-select: none;
    flex-shrink: 0;
}

.lp-step-body {
    flex: 1;
    padding-top: 12px;
}

.lp-step-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-1);
    margin: 0 0 12px 0;
}

.lp-step-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lp-step-list li {
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    color: var(--color-text-2);
    line-height: 1.6;
    padding-left: 16px;
    position: relative;
}

.lp-step-list li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: 500;
}

.lp-process-highlight {
    max-width: 720px;
    margin: 8px auto 0;
    background: var(--color-surface);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--lp-radius-sm);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.lp-process-illus {
    width: 140px;
    height: 140px;
    object-fit: contain;
    flex-shrink: 0;
}

.lp-process-highlight p {
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-style: italic;
    color: var(--color-text-2);
    margin: 0;
    line-height: 1.6;
}

/* Photo band */
.lp-photo-band {
    width: 100%;
    height: 320px;
    overflow: hidden;
}

.lp-photo-band img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 60%;
    display: block;
}

@media (max-width: 600px) {
    .lp-photo-band {
        height: 220px;
    }

    .lp-process-highlight {
        flex-direction: column;
        gap: 16px;
    }

    .lp-process-illus {
        width: 110px;
        height: 110px;
    }
}

/* ============================================================
   PRICING
   ============================================================ */
.lp-pricing {
    padding: 80px 0;
    background: var(--color-bg);
}

.lp-pricing-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--lp-radius-xl);
    box-shadow: var(--lp-shadow-3);
    padding: 40px;
    max-width: 480px;
    margin: 48px auto 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.lp-pricing-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    border-radius: var(--lp-radius-full);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.lp-pricing-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.lp-price-amount {
    font-family: 'DM Sans', sans-serif;
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--color-text-1);
    line-height: 1;
}

.lp-price-period {
    font-family: 'Inter', sans-serif;
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--color-text-3);
}

.lp-pricing-divider {
    height: 1px;
    background: var(--color-border);
    margin: 28px 0;
}

.lp-pricing-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lp-pricing-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--color-text-2);
    line-height: 1.5;
}

.lp-check-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--color-primary);
    margin-top: 1px;
}

.lp-pricing-note {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: var(--color-text-3);
    text-align: center;
    margin: 12px 0 0;
}

/* ============================================================
   CTA FINAL
   ============================================================ */
.lp-cta-final {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1a4a35 0%, #2D6A4F 50%, #3a8a65 100%);
    padding: 100px 20px;
    text-align: center;
}

.lp-cta-final::before,
.lp-cta-final::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.lp-cta-final::before {
    width: 500px;
    height: 500px;
    top: -180px;
    right: -120px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.lp-cta-final::after {
    width: 350px;
    height: 350px;
    bottom: -120px;
    left: -80px;
    background: radial-gradient(circle, rgba(82,183,136,0.25) 0%, transparent 70%);
}

.lp-cta-final-inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

.lp-cta-final-title {
    font-family: 'DM Sans', sans-serif !important;
    font-size: clamp(2rem, 4.5vw, 3.25rem) !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin: 0 !important;
    line-height: 1.1 !important;
    letter-spacing: -0.02em !important;
    text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.lp-cta-final-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 20px auto 0;
    max-width: 480px;
    line-height: 1.65;
}

.lp-cta-final-meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 20px 0 0;
    letter-spacing: 0.01em;
}

.lp-meta-check-white {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

/* ============================================================
   FOOTER
   ============================================================ */
.lp-footer {
    border-top: 1px solid var(--color-border);
    padding: 24px 20px;
    background: var(--color-bg);
}

.lp-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.lp-logo-footer {
    font-size: 1.125rem;
}

.lp-footer-copy {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: var(--color-text-3);
    margin: 0;
}

.lp-footer-links {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 12px;
}

.lp-footer-links a {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: var(--color-text-3);
    text-decoration: none;
    transition: color 150ms ease;
}

.lp-footer-links a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.lp-footer-links span {
    color: var(--color-border-strong);
    font-size: 0.875rem;
}

/* ============================================================
   DESKTOP — min-width: 768px
   ============================================================ */
@media (min-width: 768px) {

    /* Header */
    .lp-header {
        height: 64px;
        padding: 0 40px;
    }

    /* Hero — 2 colonnes */
    .lp-hero {
        padding: 96px 40px;
    }

    .lp-hero-inner {
        grid-template-columns: 55fr 45fr;
        gap: 64px;
    }

    .lp-hero-graphic {
        margin: 0;
        margin-left: auto;
    }

    /* Section inner */
    .lp-section-inner {
        padding: 0 40px;
    }

    /* Features — 3 colonnes */
    .lp-features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    /* Process */
    .lp-step-number {
        font-size: 4.5rem;
    }

    /* Pricing */
    .lp-pricing-card {
        padding: 40px;
    }

    /* Footer */
    .lp-footer {
        padding: 32px 40px;
    }

    .lp-footer-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
}

@media (max-width: 767px) {
    .lp-hero-content {
        text-align: center;
        align-items: center;
    }

    .lp-hero-title {
        text-align: center;
    }

    .lp-hero-subtitle {
        text-align: center;
    }

    .lp-hero-meta {
        text-align: center;
    }

    .lp-step-number {
        font-size: 3rem;
        min-width: 56px;
    }

    .lp-process-step {
        gap: 20px;
    }

    .lp-process-step:not(:last-child)::after {
        left: 27px;
    }

    .lp-pricing-card {
        padding: 28px 24px;
    }

    .lp-price-amount {
        font-size: 3.5rem;
    }

    .lp-cta-final {
        padding: 64px 20px;
    }
}

/* ============================================================
   Respect prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .landing-page,
    .lp-btn-primary,
    .lp-btn-ghost,
    .lp-btn-white,
    .lp-feature-card,
    .lp-hero-graphic,
    .lp-footer-links a,
    .lp-header {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* --- Anciens styles landing remplacés — les classes ci-dessous
   ne sont plus dans le HTML mais on les laisse vides pour éviter
   tout risque de casse si du JS y fait référence --- */
.landing-header {}
.hero-section {}
.hero-content {}
.hero-image {}
.features-section {}
.features-grid {}
.feature-card {}
.feature-icon-img {}
.feature-mockup {}
.goals-section {}
.goals-content {}
.goals-image {}
.landing-footer {}
.login-btn {}
/* Advice Section */
.advice-content {
    font-family: var(--font-main);
}

.advice-content details {
    transition: var(--transition);
}

.advice-content details[open] {
    background: #fff9db;
    transform: scale(1.02);
}

.advice-content summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.advice-content summary::after {
    content: '❯';
    transition: transform 0.2s;
}

.advice-content details[open] summary::after {
    transform: rotate(90deg);
}

.advice-content summary::-webkit-details-marker {
    display: none;
}

/* === Bloc Bilan Suivi Premium (Tactile & Stratifié) === */
.suivi-bilan-card {
    background: #fff9db;
    border: var(--border-thick);
    border-radius: var(--radius-lg);
    box-shadow: 8px 8px 0px var(--border-color);
    padding: 1.5rem;
    display: block; /* Passage en block pour contrôle total des marges */
    transition: var(--transition);
    position: relative;
}

.bilan-warning-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border-radius: var(--radius-sm);
    border: 2px solid #f59f00;
    color: #f59f00;
    font-size: 0.9rem;
    font-weight: 800;
    box-shadow: 4px 4px 0px var(--border-color);
    margin-bottom: 1.75rem; /* Espacement forcé */
}

.bilan-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem; /* Garder pour l'écart horizontal desktop */
    margin-bottom: 1.75rem; /* Espacement forcé vers le footer */
}

.bilan-stat-card {
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    box-shadow: 4px 4px 0px var(--border-color);
    transition: var(--transition);
    cursor: default;
}

.bilan-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 7px 7px 0px var(--border-color);
}

.bilan-stat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.bilan-stat-card.calories::before { background: var(--accent-warning); }
.bilan-stat-card.proteins::before { background: var(--accent-secondary); }

.bilan-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed #eee;
    padding-bottom: 0.5rem;
}

.bilan-stat-header span {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.bilan-stat-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--border-color);
}

.bilan-stat-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.bilan-stat-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    line-height: 1;
    color: var(--text-main);
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.bilan-stat-unit {
    font-size: 1rem;
    color: var(--text-muted);
}

.bilan-stat-target {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.bilan-stat-target strong {
    color: var(--text-main);
}

.bilan-footer-premium {
    padding: 1rem;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 4px 4px 0px var(--border-color); /* Augmenté à 4px pour l'unité */
}

.bilan-period-badge {
    position: absolute;
    top: -15px;
    right: 20px;
    background: var(--accent-secondary);
    color: white;
    padding: 0.4rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    box-shadow: 3px 3px 0px var(--border-color);
    z-index: 5;
}

.bilan-footer-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-success);
}

@media (max-width: 480px) {
    .bilan-grid {
        display: block; /* Passage en block sur mobile pour éviter grid overlap */
        margin-bottom: 1.5rem;
    }
    .bilan-stat-card {
        margin-bottom: 1.5rem; /* Espacement entre Calories et Protéines */
    }
    .bilan-stat-card:last-child {
        margin-bottom: 0;
    }
    .suivi-bilan-card {
        padding: 1.25rem;
    }
    .bilan-stat-value {
        font-size: 1.8rem;
    }
}

/* === Grille Suivi === */
#suivi-view .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

#suivi-view .progress-card {
    grid-column: span 1 !important;
}

/* === Carte Objectifs === */
/* Goal entries — Suivi page */
.goal-entry {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}
.goal-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.goal-entry:first-child {
    padding-top: 0;
}
.goal-entry-bar {
    width: 3px;
    border-radius: 99px;
    flex-shrink: 0;
}
.goal-entry-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.goal-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.goal-entry-icon {
    font-size: 16px;
    line-height: 1;
}
.goal-entry-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-1);
    flex: 1;
}
.goal-entry-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--color-primary-xlight);
    color: var(--color-primary);
    padding: 3px 9px;
    border-radius: 99px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
}
.goal-entry-dot {
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: goal-pulse 1.8s infinite;
}
@keyframes goal-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}
.goal-entry-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.goal-entry-date {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: var(--color-text-3);
}
.goal-entry-targets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.goal-entry-target-chip {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-2);
    background: var(--color-surface-2);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
}

/* AI Estimation & Loader */
.ai-estimate-container textarea:focus {
    border-color: var(--accent-secondary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(61, 126, 255, 0.1);
}

#btn-ai-estimate:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--accent-secondary);
}

#btn-ai-estimate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #cbd5e0 !important;
}

.ai-loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: ai-spin 1s ease-in-out infinite;
}

@keyframes ai-spin {
    to { transform: rotate(360deg); }
}

.ai-success {
    color: var(--accent-success);
}

.ai-error {
    color: var(--accent-danger);
}

@media (max-width: 768px) {
    #suivi-view .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* AI Detail Styles */
/* --- DESIGN PREMIUM MODALE IA --- */
.ai-item-badge {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 4px 4px 0 var(--border-color);
    transition: var(--transition);
    animation: slideIn 0.3s ease-out;
    margin-bottom: 0.75rem;
}

.ai-item-badge:last-child {
    margin-bottom: 0;
}

.ai-item-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-main);
    flex: 1;
}

.ai-item-macros {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.macro-pill {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1.5px solid var(--border-color);
}

.macro-pill.cals { background: #fff4e6; color: #fd7e14; }
.macro-pill.prot { background: #e7f5ff; color: #228be6; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}
/* --- AI PREMIUM (NIVEAU 1) EXPERIENCE --- */

@keyframes ai-pulse {
    0%, 100% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; filter: drop-shadow(0 0 8px var(--accent-purple)); }
}

#ai-feedback {
    font-weight: 800;
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    min-height: 1.5rem;
}

.ai-status-text {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.95rem;
    animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

#ai-items-detail {
    margin-top: 0.5rem;
    padding: 1.25rem;
    background: #fdfbf6;
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.modal-input-premium {
    font-size: 1.4rem !important;
    padding: 1rem !important;
    text-align: center;
}

.form-group-macro {
    position: relative;
}

.macro-icon-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 800;
}

.macro-icon-label.cals { color: #fd7e14; }
.macro-icon-label.prot { color: #228be6; }

.ai-estimate-container {
    background: #f8f0ff; /* Subtle magic purple */
    border: 3px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: 6px 6px 0px var(--accent-purple);
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .ai-estimate-container {
        padding: 1rem;
        box-shadow: 4px 4px 0px var(--accent-purple);
        margin-bottom: 0.75rem; /* Réduit de 1.5rem */
    }

    #ai-items-detail {
        margin-bottom: 0.75rem; /* Réduit de 1.5rem */
        padding: 1rem;
    }

    .modal-full-width .btn-primary {
        margin-top: 0.5rem !important; /* Réduit de 1rem */
        padding: 1rem;
    }
}

/* ============================================================
   DASHBOARD V2 — Soft Modern Design System
   Refonte complète E-04 + Navigation
   ============================================================ */

/* ---- Variables shadow manquantes (alias des lp-shadow) ---- */
:root {
    --shadow-1: var(--lp-shadow-1);
    --shadow-2: var(--lp-shadow-2);
    --shadow-3: var(--lp-shadow-3);
    --shadow-4: 0 20px 48px rgba(45,106,79,0.16), 0 8px 16px rgba(45,106,79,0.08);
    --radius-full: 9999px;
}

/* ============================================================
   NAVIGATION — Sidebar Desktop V2
   ============================================================ */

@media (min-width: 768px) {
    /* Neutralise le body dot pattern sur les écrans app */
    #app {
        background: var(--color-bg);
    }

    .sidebar {
        width: 240px;
        min-height: 100vh;
        background: var(--color-surface);
        border-right: 1px solid var(--color-border);
        box-shadow: 1px 0 0 var(--color-border);
        padding: 28px 16px;
        display: flex;
        flex-direction: column;
        gap: 4px;
        /* Efface les anciens styles V1 */
        border-bottom: none;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }

    .sidebar .logo {
        font-family: 'DM Sans', sans-serif;
        font-size: 22px;
        font-weight: 700;
        color: var(--color-primary);
        text-shadow: none;
        margin-bottom: 28px;
        padding: 0 8px;
        letter-spacing: -0.5px;
        line-height: 1;
    }

    .sidebar .logo span {
        color: var(--color-primary-light);
    }

    .sidebar nav {
        flex-direction: column;
        gap: 2px;
        width: 100%;
    }

    .nav-btn {
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 10px;
        color: var(--color-text-2);
        font-family: 'Inter', sans-serif;
        font-size: 14px;
        font-weight: 500;
        padding: 10px 12px;
        text-align: left;
        cursor: pointer;
        transition: background 150ms ease-out, color 150ms ease-out;
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        min-height: 44px;
        letter-spacing: 0;
    }

    .nav-btn:hover {
        background: var(--color-surface-2);
        color: var(--color-text-1);
        transform: none;
        box-shadow: none;
    }

    .nav-btn.active {
        background: var(--color-primary-xlight);
        color: var(--color-primary);
        font-weight: 600;
        box-shadow: none;
        transform: none;
    }

    .nav-btn.active:hover {
        background: var(--color-primary-xlight);
        transform: none;
    }

    .main-content {
        padding: 28px 28px 28px 32px;
        background: var(--color-bg);
        flex: 1;
        min-height: 100vh;
    }

    /* bottom nav cachée sur desktop */
    .bottom-nav {
        display: none !important;
    }
}

/* ============================================================
   NAVIGATION — Bottom Nav Mobile V2
   ============================================================ */

.bottom-nav {
    display: none !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 16px rgba(45, 106, 79, 0.06);
    z-index: 100;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
    align-items: stretch;
}

@media (max-width: 767px) {
    /* Bottom nav uniquement quand l'app est visible (utilisateur connecté) */
    body:has(#app:not(.hidden)) .bottom-nav {
        display: flex !important;
    }

    /* Sidebar cachée sur mobile */
    .sidebar {
        display: none !important;
    }

    /* Layout mobile : colonne unique */
    .dashboard-layout {
        flex-direction: column;
    }

    /* Main content : padding-bottom pour la bottom nav */
    .main-content {
        padding: 16px 16px 88px 16px;
        background: var(--color-bg);
    }
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-3);
    transition: color 150ms ease-out;
    padding: 8px 4px;
    position: relative;
    min-height: 44px;
}

.bottom-nav-item.active {
    color: var(--color-primary);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 0 0 3px 3px;
}

.bottom-nav-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.bottom-nav-label {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

/* ============================================================
   DASHBOARD V2 — Header
   ============================================================ */

.db-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.db-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.db-date-label {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-3);
    margin: 0;
    line-height: 1.4;
}

.db-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text-1);
    text-shadow: none;
    margin: 0;
    line-height: 1.25;
}

.db-nav-days {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.db-day-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-2);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-1);
    transition: background 150ms ease-out, color 150ms ease-out, box-shadow 150ms ease-out;
    line-height: 1;
    padding: 0;
    font-family: inherit;
}

.db-day-btn:hover {
    background: var(--color-primary-xlight);
    color: var(--color-primary);
    box-shadow: var(--shadow-2);
}

.db-goal-text {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-3);
    margin: 0;
}

/* ============================================================
   DASHBOARD V2 — Grille
   ============================================================ */

/* Override de la dashboard-grid dans le contexte dashboard-view */
#dashboard-view .dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 768px) {
    #dashboard-view .dashboard-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* ============================================================
   DASHBOARD V2 — Cards (override .card dans le dashboard)
   ============================================================ */

#dashboard-view .card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-1);
    transition: box-shadow 150ms ease-out;
    /* Efface les anciens styles V1 */
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

#dashboard-view .card:hover {
    box-shadow: var(--shadow-2);
    transform: none;
}

/* ============================================================
   DASHBOARD V2 — Barre progression journalière
   ============================================================ */

.db-progress-card {
    grid-column: 1 / -1;
    padding: 16px 20px !important;
}

.db-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.db-progress-title {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-1);
}

.db-progress-pct {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary);
}

.db-progress-track {
    width: 100%;
    height: 8px;
    background: var(--color-surface-2);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 8px;
    display: block;
    position: relative;
}

.db-progress-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
    border-radius: var(--radius-full);
    transition: width 0.5s ease-out;
    width: 0%;
    min-width: 0;
    max-width: 100%;
}

.db-progress-status {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-3);
    margin: 0;
    line-height: 1.4;
}

/* ============================================================
   DASHBOARD V2 — Carte pesée (weigh-in)
   ============================================================ */

#weigh-in-card.weigh-in-card {
    display: none; /* géré par JS */
    background: var(--color-primary-xlight) !important;
    border: 1px solid var(--color-primary-light) !important;
    border-radius: 16px;
    padding: 16px 20px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    box-shadow: none !important;
    /* Efface anciens styles V1 */
    transform: none;
}

#weigh-in-card.weigh-in-card:hover {
    box-shadow: none !important;
    transform: none;
}

#weigh-in-card h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-1);
    border: none;
    padding: 0;
    margin: 0;
    line-height: 1.35;
}

#weigh-input {
    height: 44px;
    width: 130px;
    max-width: 130px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border) !important;
    border-radius: 10px !important;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-1);
    padding: 0 12px;
    box-shadow: none !important;
}

#weigh-input:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12) !important;
    background: var(--color-surface) !important;
}

/* ============================================================
   DASHBOARD V2 — Anneaux de progression
   ============================================================ */

/* Cercles Calories + Protéines toujours côte à côte */
#dashboard-view .dashboard-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Override complet progress-card dans le dashboard */
#dashboard-view .progress-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: var(--color-accent-light);
    border: 1px solid #f0c4b8;
    border-radius: 16px;
    box-shadow: var(--shadow-1);
}

#dashboard-view .progress-card.macro-card {
    background: var(--color-primary-xlight);
    border-color: var(--color-primary-light);
}

#dashboard-view .progress-card h3 {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    padding: 0;
    margin: 0 0 16px 0;
    line-height: 1;
    align-self: flex-start;
}

#dashboard-view .progress-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: none;
    box-shadow: none;
    background: conic-gradient(var(--color-accent) 0deg, var(--color-surface) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: background 0.6s ease-out;
}

#dashboard-view .macro-card .progress-circle {
    background: conic-gradient(var(--color-primary) 0deg, var(--color-surface) 0deg);
}

#dashboard-view .progress-circle.danger {
    background: conic-gradient(var(--color-danger) 0deg, var(--color-surface) 0deg) !important;
}

#dashboard-view .circle-inner {
    width: 100px;
    height: 100px;
    background: var(--color-surface);
    border-radius: 50%;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-1);
}

#dashboard-view .remaining-value {
    font-family: 'DM Sans', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-1);
    text-shadow: none;
    line-height: 1;
    margin-bottom: 2px;
}

#dashboard-view .remaining-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1;
}

#dashboard-view .progress-stats {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-2);
}

#dashboard-view .progress-stats strong {
    font-weight: 600;
    color: var(--color-text-1);
}

/* ============================================================
   DASHBOARD V2 — Carte actions
   ============================================================ */

#dashboard-view .add-actions-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: var(--shadow-1);
    padding: 14px 16px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    align-items: center;
    grid-column: 1 / -1;
}

/* Override btn-primary / btn-secondary dans le dashboard */
#dashboard-view .add-actions-card .btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    border: none;
    box-shadow: none;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    flex: 1;
    transition: background 150ms ease-out;
    cursor: pointer;
}

#dashboard-view .add-actions-card .btn-primary:hover {
    background: var(--color-primary-light);
    transform: none;
    box-shadow: var(--shadow-1);
}

#dashboard-view .add-actions-card .btn-secondary {
    background: var(--color-primary-xlight);
    color: var(--color-primary);
    border: none;
    box-shadow: none;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    flex: 1;
    transition: background 150ms ease-out;
    cursor: pointer;
}

#dashboard-view .add-actions-card .btn-secondary:hover {
    background: #c5eccc;
    transform: none;
    box-shadow: none;
}

/* ============================================================
   DASHBOARD V2 — Bouton Valider pesée (Soft Modern)
   ============================================================ */

.weigh-in-btn {
    height: 44px;
    padding: 0 20px;
    background: var(--color-accent);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(224,122,95,0.25);
    transition: background 150ms ease-out, box-shadow 150ms ease-out, transform 100ms ease-out;
}

.weigh-in-btn:hover {
    background: #C96A4F;
    box-shadow: 0 4px 12px rgba(224,122,95,0.3);
}

.weigh-in-btn:active {
    transform: scale(0.97);
}

/* ============================================================
   DASHBOARD V2 — Journal du jour (history)
   ============================================================ */

#dashboard-view .history-card {
    grid-column: 1 / -1;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: var(--shadow-1);
    padding: 16px 20px;
}

#dashboard-view .history-card h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-1);
    border: none;
    padding: 0;
    margin: 0 0 14px 0;
    line-height: 1.35;
}

#dashboard-view .history-list {
    gap: 8px;
    padding: 0;
}

#dashboard-view .history-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: none;
    transition: box-shadow 150ms ease-out, border-color 150ms ease-out;
}

#dashboard-view .history-item:hover {
    box-shadow: var(--shadow-1);
    border-color: var(--color-border-strong);
    transform: none;
}

#dashboard-view .history-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-1);
}

#dashboard-view .history-details {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-3);
}

#dashboard-view .history-details strong {
    color: var(--color-accent);
    font-weight: 600;
}

#dashboard-view .history-actions button {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    color: var(--color-text-3);
    box-shadow: none;
    transition: all 150ms ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
}

#dashboard-view .history-actions .btn-edit:hover {
    background: var(--color-primary-xlight);
    color: var(--color-primary);
    border-color: var(--color-primary-light);
    transform: none;
    box-shadow: none;
}

#dashboard-view .history-actions .btn-delete:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border-color: var(--color-danger);
    transform: none;
    box-shadow: none;
}

/* ============================================================
   DASHBOARD V2 — Empty state
   ============================================================ */

#dashboard-view .empty-state {
    background: var(--color-surface-2);
    border: 1.5px dashed var(--color-border-strong);
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-3);
}

/* ============================================================
   DASHBOARD V2 — Ordre mobile des cards
   ============================================================ */

@media (max-width: 767px) {
    #daily-progress-container { order: 1; }
    .add-actions-card { order: 2; }
    #weigh-in-card { order: 3; }
    #dashboard-view .progress-card { order: 4; }
    #dashboard-view .history-card { order: 5; }
}

/* ============================================================
   DASHBOARD V2 — Neutralisation background body sur les vues app
   ============================================================ */

#app.dashboard-layout {
    background: var(--color-bg);
    background-image: none;
}

/* ============================================================
   E-05 — SUIVI / HISTORIQUE V2
   ============================================================ */

#history-view {
    overflow-y: auto;
    padding-bottom: 88px;
    background: var(--color-bg);
}

.history-header {
    padding: 20px 20px 4px;
}

#history-view h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text-1);
    margin: 0;
}

/* Chips période */
.history-period-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 16px 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.history-period-chips::-webkit-scrollbar { display: none; }

.history-period-chip {
    flex-shrink: 0;
    padding: 8px 18px;
    background: var(--color-surface-2);
    color: var(--color-text-2);
    border: none;
    border-radius: var(--radius-full, 9999px);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.history-period-chip--active {
    background: var(--color-primary);
    color: #ffffff;
}

/* Score */
.history-score-card {
    background: var(--color-primary);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin: 0 16px 16px;
    color: #ffffff;
}

.history-score-title {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
}

.history-score-value {
    font-family: 'DM Sans', sans-serif;
    font-size: 40px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 8px;
}

.history-score-msg {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    line-height: 1.4;
    margin: 0;
}

/* Label de section */
.history-section-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-text-3);
    padding: 4px 20px 10px;
}

/* Cartes détail communes */
.history-detail-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin: 0 16px 12px;
    box-shadow: var(--shadow-1);
}

.history-detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.history-detail-icon {
    font-size: 20px;
    line-height: 1;
}

.history-detail-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-1);
}

.history-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.history-stat-box {
    background: var(--color-surface-2);
    border-radius: var(--radius-md);
    padding: 12px;
}

.history-stat-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-3);
    margin-bottom: 4px;
}

.history-stat-value {
    font-family: 'DM Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-1);
    line-height: 1.1;
}

.history-stat-unit {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: var(--color-text-3);
    margin-top: 2px;
}

.history-diff {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-2);
    margin-bottom: 10px;
}

.history-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
}

.history-badge--ok {
    background: var(--color-primary-xlight);
    color: var(--color-primary);
}

.history-badge--warn {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

/* Carte Poids */
.history-weight-extremes {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.history-weight-point {
    flex: 1;
    background: var(--color-surface-2);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
}

.history-weight-point-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-3);
    margin-bottom: 6px;
}

.history-weight-point-val {
    font-family: 'DM Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-1);
}

.history-weight-arrow {
    color: var(--color-text-3);
    font-size: 20px;
    flex-shrink: 0;
}

.history-weight-delta {
    display: inline-block;
    background: var(--color-surface-2);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-2);
    margin-bottom: 16px;
}

.history-weight-delta--good {
    background: var(--color-primary-xlight);
    color: var(--color-primary);
}

.history-weight-delta--warn {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.history-chart-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-2);
    margin-bottom: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.history-chart-wrap {
    height: 200px;
    position: relative;
    margin-bottom: 12px;
}

#weight-chart {
    width: 100% !important;
    height: 100% !important;
}

.history-weight-empty {
    text-align: center;
    padding: 24px 0;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--color-text-3);
    line-height: 1.5;
}

.history-chart-legend {
    display: flex;
    gap: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: var(--color-text-3);
    align-items: center;
    flex-wrap: wrap;
}

.history-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

/* Carte Objectifs */
.history-goal-chip {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    font-family: 'Inter', sans-serif;
}

.history-goal-chip:last-child { border-bottom: none; }

.history-goal-date {
    font-size: 12px;
    color: var(--color-text-3);
    min-width: 52px;
    flex-shrink: 0;
}

.history-goal-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-1);
}

/* Contenu scroll */
.history-content {
    padding-bottom: 8px;
}

/* Desktop */
@media (min-width: 768px) {
    .history-score-card { margin: 0 24px 20px; }
    .history-detail-card { margin: 0 24px 14px; }
    .history-section-label { padding: 4px 24px 10px; }
    .history-period-chips { padding: 16px 24px; }
    .history-header { padding: 24px 24px 4px; }
    .history-stat-value { font-size: 26px; }
    .history-chart-wrap { height: 260px; }
}

/* ============================================================
   E-06 — Conseils V2 Soft Modern
   ============================================================ */

/* Header */
.advice-header {
    padding: 8px 0 20px;
}
.advice-title {
    font-family: var(--font-heading, 'DM Sans', sans-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-1, #1a1a2e);
    margin: 0 0 4px;
    line-height: 1.2;
}
.advice-subtitle {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 13px;
    color: var(--color-text-3, #9ca3af);
    margin: 0;
}

/* Tip du jour */
.advice-tip-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: linear-gradient(135deg, var(--color-primary, #2D6A4F) 0%, #1b4332 100%);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 24px;
    color: #ffffff;
}
.advice-tip-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.18);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.advice-tip-icon svg { stroke: #ffffff; }
.advice-tip-body { flex: 1; }
.advice-tip-label {
    display: block;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
    margin-bottom: 5px;
}
.advice-tip-text {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    font-weight: 500;
}

/* Grille de 4 cartes */
.advice-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
}
@media (max-width: 480px) {
    .advice-cards-grid { grid-template-columns: 1fr; }
}

/* Carte individuelle */
.advice-card {
    background: var(--color-surface, #ffffff);
    border-radius: 16px;
    padding: 18px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.advice-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.advice-card-icon--green { background: #d1fae5; }
.advice-card-icon--green svg { stroke: #059669; }
.advice-card-icon--blue { background: #dbeafe; }
.advice-card-icon--blue svg { stroke: #2563eb; }
.advice-card-icon--purple { background: #ede9fe; }
.advice-card-icon--purple svg { stroke: #7c3aed; }
.advice-card-icon--orange { background: #ffedd5; }
.advice-card-icon--orange svg { stroke: #ea580c; }

.advice-card-title {
    font-family: var(--font-heading, 'DM Sans', sans-serif);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-1, #1a1a2e);
    margin: 0 0 8px;
}
.advice-card-text {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 12px;
    color: var(--color-text-2, #4b5563);
    line-height: 1.5;
    margin: 0 0 10px;
}
.advice-list {
    margin: 0 0 12px;
    padding-left: 16px;
}
.advice-list li {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 12px;
    color: var(--color-text-2, #4b5563);
    line-height: 1.6;
    margin-bottom: 3px;
}
.advice-example-block {
    background: var(--color-surface-2, #f7f8f3);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 10px;
}
.advice-example-label {
    display: block;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-primary, #2D6A4F);
    margin-bottom: 6px;
}
.advice-example-block p {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 11px;
    color: var(--color-text-2, #4b5563);
    margin: 0 0 3px;
    line-height: 1.5;
}
.advice-tip-inline {
    background: #eff6ff;
    border-radius: 8px;
    padding: 8px 10px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 11px;
    color: #1d4ed8;
    line-height: 1.5;
    margin-top: 10px;
}

/* Section bloc (Peser + Accordéons) */
.advice-section-block {
    background: var(--color-surface, #ffffff);
    border-radius: 16px;
    padding: 20px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}
.advice-section-title {
    font-family: var(--font-heading, 'DM Sans', sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-1, #1a1a2e);
    margin: 0 0 6px;
}
.advice-section-intro {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 13px;
    color: var(--color-text-2, #4b5563);
    line-height: 1.5;
    margin: 0 0 16px;
}

/* Duo grid pour perte / prise */
.advice-duo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
@media (max-width: 380px) {
    .advice-duo-grid { grid-template-columns: 1fr; }
}
.advice-duo-card {
    border-radius: 12px;
    padding: 14px 12px;
}
.advice-duo-card--red {
    background: #fff5f5;
    border: 1px solid #fecaca;
}
.advice-duo-card--green {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.advice-duo-label {
    display: block;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.advice-duo-card--red .advice-duo-label { color: #dc2626; }
.advice-duo-card--green .advice-duo-label { color: #16a34a; }
.advice-duo-card p {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 12px;
    color: var(--color-text-2, #4b5563);
    line-height: 1.5;
    margin: 0;
}

/* Étapes numérotées */
.advice-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}
.advice-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.advice-step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: var(--color-primary-xlight, #d1fae5);
    color: var(--color-primary, #2D6A4F);
    border-radius: 50%;
    font-family: var(--font-heading, 'DM Sans', sans-serif);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.advice-step strong {
    display: block;
    font-family: var(--font-heading, 'DM Sans', sans-serif);
    font-size: 13px;
    color: var(--color-text-1, #1a1a2e);
    margin-bottom: 3px;
}
.advice-step p {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 12px;
    color: var(--color-text-2, #4b5563);
    margin: 0;
    line-height: 1.5;
}

/* Citation */
.advice-quote {
    background: var(--color-surface-2, #f7f8f3);
    border-left: 3px solid var(--color-primary, #2D6A4F);
    border-radius: 0 10px 10px 0;
    padding: 12px 14px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 13px;
    font-style: italic;
    color: var(--color-text-2, #4b5563);
    line-height: 1.5;
}

/* Accordéons */
.advice-accordion {
    border-bottom: 1px solid var(--color-border, #e8eae0);
}
.advice-accordion:last-child { border-bottom: none; }
.advice-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    font-family: var(--font-heading, 'DM Sans', sans-serif);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-1, #1a1a2e);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.advice-accordion-summary::-webkit-details-marker { display: none; }
.advice-accordion-summary::after {
    content: '+';
    font-size: 18px;
    font-weight: 400;
    color: var(--color-primary, #2D6A4F);
    flex-shrink: 0;
    transition: transform 0.2s;
}
details[open] .advice-accordion-summary::after {
    transform: rotate(45deg);
}
.advice-accordion-body {
    padding: 0 0 14px;
}
.advice-accordion-body p {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 13px;
    color: var(--color-text-2, #4b5563);
    line-height: 1.6;
    margin: 0;
}

/* ============================================================
   E-07 — Profil V2 Soft Modern
   ============================================================ */

/* Carte compte */
.pv-account-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--color-surface, #fff);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 14px;
}
.pv-avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    background: var(--color-primary-xlight, #d1fae5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pv-avatar svg { stroke: var(--color-primary, #2D6A4F); }
.pv-account-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pv-account-label {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-3, #9ca3af);
}
.pv-account-email {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-1, #1a1a2e);
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pv-logout-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.pv-logout-btn svg { stroke: #dc2626; }
.pv-logout-btn:hover { background: #fee2e2; }

/* Carte formulaire */
.pv-form-card {
    background: var(--color-surface, #fff);
    border-radius: 16px;
    padding: 20px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 14px;
}
.pv-section-title {
    font-family: var(--font-heading, 'DM Sans', sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-1, #1a1a2e);
    margin: 0 0 16px;
}
.pv-label {
    display: block;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-2, #4b5563);
    margin-bottom: 6px;
}
.pv-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--color-surface-2, #f7f8f3);
    border: 1.5px solid var(--color-border, #e8eae0);
    border-radius: 10px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 15px;
    color: var(--color-text-1, #1a1a2e);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.pv-input:focus { border-color: var(--color-primary, #2D6A4F); background: #fff; }
.pv-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--color-surface-2, #f7f8f3);
    border: 1.5px solid var(--color-border, #e8eae0);
    border-radius: 10px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 15px;
    color: var(--color-text-1, #1a1a2e);
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    transition: border-color 0.15s;
}
.pv-select:focus { border-color: var(--color-primary, #2D6A4F); background-color: #fff; }
.pv-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.pv-input-unit {
    position: relative;
    display: flex;
    align-items: center;
}
.pv-input-unit .pv-input {
    padding-right: 44px;
}
.pv-unit {
    position: absolute;
    right: 14px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-3, #9ca3af);
    pointer-events: none;
}
.pv-hint {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 12px;
    color: var(--color-text-3, #9ca3af);
    line-height: 1.5;
    margin: 6px 0 0;
}
.pv-suggestion {
    display: inline-block;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary, #2D6A4F);
    cursor: pointer;
    text-decoration: underline;
    margin-top: 6px;
}
.pv-submit-btn {
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    background: var(--color-accent) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(224,122,95,0.25) !important;
    transform: none !important;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}
.pv-submit-btn:hover {
    background: #C96A4F !important;
    box-shadow: 0 4px 16px rgba(224,122,95,0.35) !important;
    transform: none !important;
}
.pv-submit-btn:active {
    background: #B55A3F !important;
    transform: scale(0.98) !important;
    box-shadow: 0 1px 4px rgba(224,122,95,0.2) !important;
}

/* Stats BMR/TDEE */
.pv-stats-card {
    background: var(--color-surface, #fff);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 14px;
}
.pv-stat-row {
    display: flex;
    align-items: center;
    gap: 0;
}
.pv-stat-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 0;
}
.pv-stat-sep {
    width: 1px;
    height: 48px;
    background: var(--color-border, #e8eae0);
    flex-shrink: 0;
}
.pv-stat-label {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-3, #9ca3af);
}
.pv-stat-value {
    font-family: var(--font-heading, 'DM Sans', sans-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-primary, #2D6A4F);
}
.pv-stat-unit {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 10px;
    color: var(--color-text-3, #9ca3af);
}
.pv-stats-note {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 11px;
    color: var(--color-text-3, #9ca3af);
    text-align: center;
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--color-border, #e8eae0);
}

/* Section RGPD */
/* ── Carte Abonnement ────────────────────────────────────────── */
.pv-subscription-card {
    background: var(--color-surface, #fff);
    border-radius: 16px;
    padding: 20px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}
.pv-sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.pv-sub-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-1, #1a1a1a);
}
.pv-sub-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--color-surface-2, #f2f0eb);
    color: var(--color-text-2, #5a5a5a);
}
.pv-sub-badge.active   { background: var(--color-primary-xlight, #D8F3DC); color: var(--color-primary, #2D6A4F); }
.pv-sub-badge.trialing { background: #FEF3C7; color: #92400E; }
.pv-sub-badge.past_due { background: #FEE2E2; color: #991B1B; }
.pv-sub-badge.canceled { background: var(--color-surface-2, #f2f0eb); color: var(--color-text-2, #5a5a5a); }
.pv-sub-desc {
    font-size: 13px;
    color: var(--color-text-2, #5a5a5a);
    margin-bottom: 14px;
    line-height: 1.5;
}
.pv-sub-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pv-sub-btn-primary {
    width: 100%;
    padding: 12px 16px;
    background: var(--color-primary, #2D6A4F);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.pv-sub-btn-primary:active { opacity: 0.85; }
.pv-sub-btn-secondary {
    width: 100%;
    padding: 11px 16px;
    background: transparent;
    color: var(--color-primary, #2D6A4F);
    border: 1.5px solid var(--color-primary, #2D6A4F);
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.pv-sub-btn-secondary:active { opacity: 0.75; }

.pv-rgpd-card {
    background: var(--color-surface, #fff);
    border-radius: 16px;
    padding: 20px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}
.pv-rgpd-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
@media (max-width: 380px) {
    .pv-rgpd-actions { flex-direction: column; }
}
.pv-rgpd-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 14px;
    background: var(--color-surface-2, #f7f8f3);
    border: 1.5px solid var(--color-border, #e8eae0);
    border-radius: 10px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-2, #4b5563);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.pv-rgpd-btn:hover { background: #f0fdf4; border-color: var(--color-primary, #2D6A4F); color: var(--color-primary, #2D6A4F); }
.pv-rgpd-btn svg { stroke: currentColor; }
.pv-danger-zone {
    padding-top: 14px;
    border-top: 1px solid var(--color-border, #e8eae0);
}
.pv-danger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 11px 14px;
    background: #fff5f5;
    border: 1.5px solid #fecaca;
    border-radius: 10px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 13px;
    font-weight: 600;
    color: #dc2626;
    cursor: pointer;
    transition: background 0.15s;
}
.pv-danger-btn:hover { background: #fee2e2; }
.pv-danger-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pv-danger-btn svg { stroke: currentColor; }

/* Modal suppression compte */
.pv-delete-modal {
    padding: 28px 20px 20px;
    max-width: 380px;
    width: 92%;
}
.pv-delete-modal-title {
    font-family: var(--font-heading, 'DM Sans', sans-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-1, #1a1a2e);
    margin: 0 0 12px;
}
.pv-delete-modal-text {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 13px;
    color: var(--color-text-2, #4b5563);
    line-height: 1.6;
    margin: 0 0 12px;
}
.pv-delete-modal-actions {
    display: flex;
    gap: 10px;
}
.pv-delete-cancel-btn {
    flex: 1;
    padding: 12px;
    background: var(--color-surface-2, #f7f8f3);
    border: 1.5px solid var(--color-border, #e8eae0);
    border-radius: 10px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-2, #4b5563);
    cursor: pointer;
}
.pv-delete-cancel-btn:hover { background: #f0f0f0; }

/* form-group dans le profil : espacement */
#profile-view .form-group {
    margin-bottom: 14px;
}
#profile-view .form-group:last-child {
    margin-bottom: 0;
}

/* ── Paywall ─────────────────────────────────────────────────── */
.paywall-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(248, 246, 240, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
}
.paywall-overlay.hidden { display: none; }

.paywall-card {
    background: #fff;
    border-radius: 24px;
    padding: 36px 28px 28px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.10);
}

.paywall-logo {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 24px;
}
.paywall-logo span { color: var(--color-primary, #2D6A4F); }

.paywall-icon {
    width: 72px;
    height: 72px;
    background: var(--color-primary-xlight, #D8F3DC);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--color-primary, #2D6A4F);
}

.paywall-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
    line-height: 1.3;
}

.paywall-subtitle {
    font-size: 14px;
    color: #5a5a5a;
    line-height: 1.6;
    margin-bottom: 24px;
}

.paywall-price-block {
    background: var(--color-primary-xlight, #D8F3DC);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
}
.paywall-amount {
    font-family: 'DM Sans', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary, #2D6A4F);
}
.paywall-period {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-primary, #2D6A4F);
}

.paywall-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.paywall-benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #3a3a3a;
}
.paywall-benefits li svg {
    flex-shrink: 0;
    color: var(--color-primary, #2D6A4F);
}

.paywall-btn-primary {
    width: 100%;
    padding: 15px;
    background: var(--color-primary, #2D6A4F);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 12px;
}
.paywall-btn-primary:disabled { opacity: 0.6; }
.paywall-btn-primary:active   { opacity: 0.85; }

.paywall-legal {
    font-size: 11px;
    color: #999;
    margin-bottom: 20px;
    line-height: 1.5;
}
.paywall-legal a { color: var(--color-primary, #2D6A4F); }

.paywall-btn-logout {
    background: none;
    border: none;
    font-size: 13px;
    color: #aaa;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px;
}
.paywall-btn-logout:hover { color: #666; }


/* ── Trial banner ─────────────────────────────────────────────────────── */
.trial-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #fff8f0 0%, #fff3e8 100%);
    border: 1px solid #f0c080;
    border-radius: 12px;
    padding: 10px 16px;
    margin: 0 4px 12px;
    font-size: 0.85rem;
    color: #8a5a00;
    font-weight: 500;
}
.trial-banner::before {
    content: '⏳';
    font-size: 1rem;
    flex-shrink: 0;
}
