/* ============================================================
   PG PROTOCOL — Page-Specific Styles
   ============================================================ */

/* --- Dashboard --- */
.dashboard-logo {
    text-align: center;
    padding-top: var(--space-md);
    margin-bottom: var(--space-sm);
}

/* wordmark très large (ratio ~9:1) : on cale sur la largeur, sinon il
   déborde sur mobile dès qu'on fixe une hauteur confortable */
.dashboard-logo__img {
    width: min(70%, 260px);
    height: auto;
    object-fit: contain;
}

/* ============================================================
   Logo — glitch discret en boucle
   L'aberration chromatique est obtenue avec deux drop-shadow
   decalees : sur un PNG detoure, elles dupliquent la silhouette
   en rose et cyan, comme un signal video desynchronise.
   Le glitch n'occupe que ~0,4 s du cycle : le reste du temps le
   logo est parfaitement net.
   ============================================================ */
@keyframes logoGlitch {
    0%, 88%, 94%, 100% {
        transform: none;
        filter: none;
        opacity: 1;
    }
    89% {
        transform: translate3d(-2px, 0, 0) skewX(-1.2deg);
        filter: drop-shadow(2px 0 0 rgba(240, 185, 95, 0.7))
                drop-shadow(-2px 0 0 rgba(240, 122, 106, 0.7));
    }
    90.5% {
        transform: translate3d(2px, 0, 0) skewX(1.4deg);
        filter: drop-shadow(-3px 0 0 rgba(240, 185, 95, 0.7))
                drop-shadow(3px 0 0 rgba(240, 122, 106, 0.7));
        opacity: 0.88;
    }
    92% {
        transform: translate3d(-1px, 0, 0);
        filter: drop-shadow(1px 0 0 rgba(95, 224, 132, 0.9));
        opacity: 0.82;
    }
}

/* Variante marquée : décrochages plus larges, tranches décalées, et un
   cycle court. Réservée à l'écran de connexion, où le logo est le seul
   élément à regarder. */
@keyframes logoGlitchStrong {
    0%, 78%, 95%, 100% {
        transform: none;
        filter: none;
        opacity: 1;
        clip-path: none;
    }
    79% {
        transform: translate3d(-4px, 0, 0) skewX(-2deg);
        filter: drop-shadow(4px 0 0 rgba(240, 185, 95, 0.85))
                drop-shadow(-4px 0 0 rgba(240, 122, 106, 0.85));
    }
    81% {
        transform: translate3d(4px, 0, 0) skewX(2.2deg);
        opacity: 0.88;
        filter: drop-shadow(-5px 0 0 rgba(240, 185, 95, 0.85))
                drop-shadow(5px 0 0 rgba(240, 122, 106, 0.85));
    }
    84% {
        transform: translate3d(-2px, 1px, 0);
        clip-path: inset(28% 0 46% 0);
        filter: drop-shadow(3px 0 0 rgba(95, 224, 132, 1));
    }
    86% {
        transform: translate3d(3px, -1px, 0);
        clip-path: inset(58% 0 14% 0);
        opacity: 0.9;
        filter: drop-shadow(-3px 0 0 rgba(240, 122, 106, 0.95));
    }
    88% {
        transform: none;
        clip-path: none;
        filter: none;
        opacity: 1;
    }
    91% {
        transform: scaleY(1.07);
        filter: drop-shadow(2px 0 0 rgba(240, 185, 95, 0.7));
    }
    93% {
        transform: none;
        filter: none;
    }
}

/* Dashboard : discret, il est affiché en permanence */
.dashboard-logo__img {
    animation: logoGlitch 7s steps(1, end) infinite;
}

/* Connexion : marqué et fréquent */
.login-logo__img {
    animation: logoGlitchStrong 4s steps(1, end) infinite;
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-logo__img,
    .login-logo__img,
    #splash img { animation: none; }
}
.logo-light { display: none; }
[data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: inline; }

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.dashboard-date {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.phase-card {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    background: var(--gradient-main);
    color: #fff;
    margin-bottom: var(--space-md);
}

.phase-card__week {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 800;
}

.phase-card__label {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: var(--space-md);
}

.phase-card .progress-bar {
    background: rgba(255, 255, 255, 0.2);
}

.phase-card .progress-bar__fill {
    background: #fff;
}

.today-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color 0.2s;
}

.today-card:hover {
    border-color: var(--red);
}

.today-card__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--red-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.today-card__icon svg {
    width: 22px;
    height: 22px;
    color: var(--red);
}

.today-card__info {
    flex: 1;
}

.today-card__day {
    font-weight: 700;
    font-size: 0.95rem;
}

.today-card__workout {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.today-card__arrow {
    color: var(--text-muted);
}

.dashboard-lab {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.dashboard-lab__detail {
    flex: 1;
    min-width: 0;
}

.dashboard-lab__row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: var(--space-xs) 0;
}

.dashboard-lab__row span:last-child {
    font-family: var(--font-mono);
    color: var(--text-muted);
}

/* --- Training --- */
.workout-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}
.workout-header__content {
    flex: 1;
    min-width: 0;
}

.motivation-btn {
    border-radius: 12px;
    background: rgba(95, 224, 132, 0.12);
    border: 2px solid var(--red);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.motivation-btn:active {
    background: rgba(95, 224, 132, 0.3);
}
.motivation-btn svg {
    width: 20px;
    height: 20px;
    color: var(--red);
}
.motivation-btn span {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--red);
}

.motivation-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.motivation-overlay video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.motivation-overlay__close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    z-index: 1001;
    color: #fff;
    font-size: 2rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}

.workout-header__name {
    font-size: 1.5rem;
    font-weight: 800;
}

.workout-header__muscles {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.workout-header__meta {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Supplements --- */
.lab-phase-banner {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    background: var(--gradient-main);
    color: #fff;
    margin-bottom: var(--space-lg);
}

.lab-phase-banner h2 {
    font-size: 1rem;
    font-weight: 700;
}

.lab-phase-banner p {
    font-size: 0.8rem;
    opacity: 0.8;
}

.lab-compliance {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.lab-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    margin-top: var(--space-lg);
}

.lab-section-title svg {
    width: 16px;
    height: 16px;
}

/* --- Check-in --- */
.checkin-weight {
    text-align: center;
    padding: var(--space-xl) 0;
}

.checkin-weight__unit {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-left: var(--space-xs);
}

.checkin-score-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.checkin-score-row:last-child {
    border-bottom: none;
}

.checkin-score-row__label {
    font-weight: 500;
    font-size: 0.9rem;
    flex-shrink: 0;
    white-space: nowrap;
}

/* --- Check-in: Select dropdown --- */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a5f72' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* --- Progress --- */
.period-pills {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.period-pill {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.period-pill.active {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

/* --- Fiches --- */
.fiche-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.fiche-card--week {
    border-left: 3px solid var(--red);
}

.fiche-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.fiche-card__date {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
}

.fiche-card__day {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.fiche-card__scores {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
}

.fiche-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.fiche-metric {
    text-align: center;
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.fiche-metric__value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
}

.fiche-metric__label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.fiche-section {
    padding: var(--space-sm) 0;
    border-top: 1px solid var(--border-subtle);
}

.fiche-section__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.fiche-section__header svg {
    width: 14px;
    height: 14px;
}

.fiche-section__body {
    padding-left: calc(14px + var(--space-sm));
}

.fiche-macros {
    display: flex;
    gap: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.fiche-notes {
    margin-top: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* --- Fiche Detailed --- */

/* Exercise cards */
.fiche-exercise {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
}

.fiche-exercise__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.fiche-exercise__num {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    background: var(--red-subtle);
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.fiche-exercise__name {
    font-size: 0.8rem;
    font-weight: 600;
}

.fiche-exercise__meta {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.fiche-exercise__status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    margin-left: auto;
    flex-shrink: 0;
}

.fiche-exercise__status.partial {
    background: var(--yellow);
}

.fiche-exercise__status.none {
    background: var(--text-muted);
}

/* Sets table */
.fiche-sets-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.fiche-sets-table th {
    text-transform: uppercase;
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 3px 6px;
    text-align: left;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-subtle);
}

.fiche-sets-table td {
    padding: 3px 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.fiche-sets-table td.val {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.fiche-set-check {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.fiche-set-check.done {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--green);
}

/* Supplement items */
.fiche-timing-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    padding: var(--space-xs) 0;
    margin-top: var(--space-xs);
}

.fiche-supp {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 4px 0;
}

.fiche-supp__check {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    flex-shrink: 0;
}

.fiche-supp__check.done {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--green);
}

.fiche-supp__info {
    flex: 1;
    min-width: 0;
}

.fiche-supp__name {
    font-size: 0.8rem;
    font-weight: 500;
}

.fiche-supp__dose {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.fiche-supp__time {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Metric cards grid */
.fiche-metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.fiche-metric-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
}

.fiche-metric-card--wide {
    grid-column: 1 / -1;
}

.fiche-metric-card__label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 2px;
}

.fiche-metric-card__value {
    font-size: 1.3rem;
    font-weight: 700;
}

.fiche-metric-card__unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Quality dots */
.fiche-quality-dots {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.fiche-quality-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.fiche-quality-dot.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--green);
    color: var(--green);
    font-weight: 700;
}

/* Steps progress */
.fiche-progress-wrap {
    margin-top: 6px;
}

.fiche-progress-bar {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.fiche-progress-bar__fill {
    height: 100%;
    border-radius: 2px;
    background: var(--gradient-main);
    transition: width 0.3s;
}

.fiche-progress-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Macro grid */
.fiche-macro-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xs);
    text-align: center;
}

.fiche-macro-col__value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.fiche-macro-col__value span {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-muted);
}

.fiche-macro-col__target {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
}

.fiche-macro-col__label {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin: 2px 0;
}

.fiche-macro-col__bar {
    height: 3px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
    width: 80%;
}

.fiche-macro-col__bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}

/* Fiche scores row */
.fiche-scores-row {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.fiche-score-item {
    flex: 1;
    text-align: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-xs) var(--space-sm);
}

.fiche-score-item__value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.fiche-score-item__label {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* --- Settings --- */
.settings-group {
    margin-bottom: var(--space-xl);
}

.settings-group__title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item__label {
    font-weight: 500;
}

.settings-item__desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Toggle switch */
.toggle-switch {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.toggle-switch::after {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.2s var(--ease-spring);
}

.toggle-switch.on {
    background: var(--red);
    border-color: var(--red);
}

.toggle-switch.on::after {
    background: #fff;
    left: 22px;
}

/* --- Splash Screen --- */
#splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b120d;
    overflow: hidden;
}

/* halo violet derrière la marque */
#splash::before {
    content: "";
    position: absolute;
    width: 90vmin;
    height: 90vmin;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(71, 196, 107, 0.45) 0%, rgba(95, 224, 132, 0.16) 45%, transparent 70%);
    animation: splashHalo 2s var(--ease-out) forwards;
}

#splash img {
    position: relative;
    width: min(86vw, 540px);
    height: auto;
    /* steps() par défaut : chaque décrochage est une coupure nette.
       Seule l'entrée (0% → 28%) réintroduit un easing, déclaré sur le
       keyframe 0% — un timing déclaré dans un keyframe ne s'applique
       qu'à l'intervalle qui démarre à ce keyframe. */
    animation: splashMark 1.8s steps(1, end) forwards;
}

@keyframes splashHalo {
    0%   { opacity: 0; transform: scale(0.6); }
    55%  { opacity: 1; transform: scale(1); }
    100% { opacity: 0.75; transform: scale(1.05); }
}

/* Entrée fluide puis trois décrochages francs. Le timing est défini
   keyframe par keyframe : easing sur l'apparition, steps() sur les
   glitchs pour obtenir des coupures nettes plutôt que des fondus. */
@keyframes splashMark {
    0% {
        opacity: 0;
        transform: scale(0.9);
        clip-path: none;
        filter: drop-shadow(0 0 24px rgba(95, 224, 132, 0.45));
        animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    }
    28% {
        opacity: 1;
        transform: scale(1.01);
        clip-path: none;
        filter: drop-shadow(0 0 24px rgba(95, 224, 132, 0.45));
    }

    /* décrochage 1 — aberration chromatique large */
    36% {
        transform: translate3d(-5px, 0, 0) skewX(-2.5deg);
        filter: drop-shadow(5px 0 0 rgba(240, 185, 95, 0.9))
                drop-shadow(-5px 0 0 rgba(240, 122, 106, 0.9));
    }
    40% {
        transform: translate3d(5px, 0, 0) skewX(2.5deg);
        opacity: 0.88;
        filter: drop-shadow(-6px 0 0 rgba(240, 185, 95, 0.9))
                drop-shadow(6px 0 0 rgba(240, 122, 106, 0.9));
    }
    44% {
        transform: none;
        opacity: 1;
        filter: drop-shadow(0 0 24px rgba(95, 224, 132, 0.45));
    }

    /* décrochage 2 — tranches décalées */
    58% {
        transform: translate3d(-4px, 2px, 0);
        opacity: 0.85;
        clip-path: inset(26% 0 44% 0);
        filter: drop-shadow(4px 0 0 rgba(95, 224, 132, 1));
    }
    61% {
        transform: translate3d(6px, -2px, 0);
        clip-path: inset(56% 0 16% 0);
        filter: drop-shadow(-4px 0 0 rgba(240, 122, 106, 0.95));
    }
    64% {
        transform: none;
        opacity: 1;
        clip-path: none;
        filter: drop-shadow(0 0 24px rgba(95, 224, 132, 0.45));
    }

    /* décrochage 3 — étirement vertical bref */
    80% {
        transform: translate3d(3px, 0, 0) scaleY(1.08);
        filter: drop-shadow(-3px 0 0 rgba(240, 185, 95, 0.85))
                drop-shadow(3px 0 0 rgba(240, 122, 106, 0.85));
    }
    83% {
        transform: none;
        filter: drop-shadow(0 0 24px rgba(95, 224, 132, 0.45));
    }

    100% {
        opacity: 1;
        transform: scale(1);
        clip-path: none;
        filter: drop-shadow(0 0 24px rgba(95, 224, 132, 0.45));
    }
}

#splash.fade-out {
    animation: splashFadeOut 0.4s ease-in forwards;
}

@keyframes splashFadeOut {
    0%   { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

/* --- Login --- */
body.logged-out .bottom-nav,
body.logged-out .more-menu,
body.logged-out .backdrop {
    display: none !important;
}

.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: var(--space-xl);
    max-width: 360px;
    margin: 0 auto;
}

.login-logo__img {
    width: min(94%, 340px);
    height: auto;
    margin-bottom: var(--space-lg);
}

.login-logo {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-xs);
}

.login-logo span {
    color: var(--red);
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: var(--space-xl);
    text-align: center;
}

.login-page .form-group {
    width: 100%;
}

.login-page .btn-full {
    width: 100%;
    margin-top: var(--space-md);
}

.login-hint {
    margin-top: var(--space-lg);
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
    text-align: center;
    max-width: 30ch;
}

/* --- Account section in settings --- */
.settings-account-email {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-logout {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--red);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--red);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--red);
    color: #fff;
}

/* --- Progress Photos --- */

/* Upload page: 3-column grid */
.photo-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.photo-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.photo-slot__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-align: center;
}

.photo-slot__preview {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
}

.photo-slot__placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-medium);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: border-color 0.2s, color 0.2s;
}

.photo-slot__placeholder:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.photo-slot__remove {
    position: absolute;
    top: 24px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Rapport / Coach: photo grid display */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.photo-grid__item {
    text-align: center;
}

.photo-grid__img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
}

.photo-grid__label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Lightbox overlay */
.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 6000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    cursor: pointer;
}

.photo-lightbox.show {
    opacity: 1;
}

.photo-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.photo-lightbox__close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Rapport --- */
.rpt-val-good { color: var(--green); }
.rpt-val-warn { color: #eab308; }
.rpt-val-bad  { color: #ef4444; }

.rpt-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
}
.rpt-badge--green  { background: rgba(16, 185, 129, 0.15); color: var(--green); }
.rpt-badge--red    { background: rgba(239, 68, 68, 0.12);  color: #ef4444; }
.rpt-badge--yellow { background: rgba(234, 179, 8, 0.12);  color: #eab308; }

.rpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.rpt-table th {
    background: var(--bg-secondary);
    padding: 10px 6px;
    text-align: center;
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}
.rpt-table th:first-child { text-align: left; }
.rpt-table td {
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
    font-variant-numeric: tabular-nums;
}
.rpt-table td:first-child { text-align: left; font-weight: 600; }
.rpt-table tr:last-child td { border-bottom: none; }

.rpt-note {
    border-left: 3px solid var(--red);
    background: var(--red-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.rpt-note__date {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.rpt-nutrition-grid {
    display: grid;
    grid-template-columns: auto repeat(4, 1fr);
    gap: 0;
    font-size: 0.78rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.rpt-nutrition-grid > div {
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
}
.rpt-nutrition-grid > div:nth-child(-n+5) {
    background: var(--bg-secondary);
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.rpt-nutrition-grid > div:nth-child(5n+1) {
    text-align: left;
    font-weight: 600;
}
