/* ==========================================================================
   Senolo Status Page — status.senolo.fr
   Design : arnaques.senolo.fr style (Inter, #002FA7, light only)
   ========================================================================== */

/* Inter auto-hébergé (RGPD : aucune requête vers Google) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/assets/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/assets/fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
    --primary: #002FA7;
    --primary-light: #0E58A4;
    --primary-dark: #001E6C;
    --secondary: #28A745;
    --secondary-light: #34D058;
    --white: #FFFFFF;
    --bg: #F7FAFC;
    --bg-warm: #FAFBFE;
    --text: #2D3748;
    --text-light: #4A5568;
    --text-muted: #4A5568;
    /* Couleurs vives : réservées aux pastilles / points d'état */
    --danger: #E53E3E;
    --danger-light: #FFF5F5;
    --warning: #ED8936;
    --warning-light: #FFFAF0;
    --success: #28A745;
    --success-light: #F0FFF4;
    /* Couleurs foncées : réservées au TEXTE d'état (contraste >= 4.5:1) */
    --danger-text: #C53030;
    --warning-text: #9A3412;
    --success-text: #1E7E34;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --radius: 16px;
    --radius-lg: 24px;
    --radius-full: 50px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-light);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   1. Header — sticky blur (style arnaques)
   -------------------------------------------------------------------------- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-sm);
}

.header__container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.header__logo {
    width: 36px;
    height: 36px;
}

.header__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.header__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 4px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-light);
    transition: color var(--transition);
}

.header__link:hover {
    color: var(--primary);
}

/* --------------------------------------------------------------------------
   2. Main content
   -------------------------------------------------------------------------- */
.main {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    animation: fadeIn 0.5s ease both;
}

/* --------------------------------------------------------------------------
   3. Global Status Banner
   -------------------------------------------------------------------------- */
.global-status {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--text-muted);
    margin-bottom: 32px;
}

.global-status--operational {
    border-left-color: var(--success);
    background: var(--success-light);
}

.global-status--operational .global-status__icon {
    color: var(--success);
}

.global-status--degraded {
    border-left-color: var(--warning);
    background: var(--warning-light);
}

.global-status--degraded .global-status__icon {
    color: var(--warning);
}

.global-status--down {
    border-left-color: var(--danger);
    background: var(--danger-light);
}

.global-status--down .global-status__icon {
    color: var(--danger);
}

.global-status__inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.global-status__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
}

.global-status__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.global-status__label {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

.global-status__uptime {
    font-size: 16px;
    color: var(--text-light);
    font-weight: 400;
}

.global-status__uptime strong {
    font-weight: 700;
    color: var(--success-text);
}

/* --------------------------------------------------------------------------
   4. Section titles
   -------------------------------------------------------------------------- */
.section__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   5. Services Grid
   -------------------------------------------------------------------------- */
.services {
    margin-bottom: 40px;
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.services__empty {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    color: var(--text-light);
    box-shadow: var(--shadow-sm);
}

.service-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    padding: 18px 20px;
    transition: box-shadow var(--transition), transform var(--transition);
}

.service-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.service-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.service-card__name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.service-card__dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

.service-card__dot--operational {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}

.service-card__dot--degraded {
    background: var(--warning);
    box-shadow: 0 0 0 3px rgba(237, 137, 54, 0.15);
    animation: pulse 2s infinite;
}

.service-card__dot--down {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15);
    animation: pulse 1.5s infinite;
}

.service-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.service-card__status {
    font-size: 16px;
    font-weight: 600;
}

.service-card__status--operational {
    color: var(--success-text);
}

.service-card__status--degraded {
    color: var(--warning-text);
}

.service-card__status--down {
    color: var(--danger-text);
}

.service-card__check {
    font-size: 14px;
    color: var(--text-muted);
}

/* Service card cliquable (lien vers le site) */
a.service-card--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.service-card--link:hover {
    border-color: var(--primary);
    color: inherit;
}

/* --------------------------------------------------------------------------
   6. Incidents
   -------------------------------------------------------------------------- */
.incidents {
    margin-bottom: 40px;
}

.incident-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-left: 5px solid var(--text-muted);
    padding: 24px;
    margin-bottom: 14px;
}

.incident-card:has(.incident-card__badge--minor) {
    border-left-color: var(--warning);
}

.incident-card:has(.incident-card__badge--major) {
    border-left-color: var(--danger);
}

.incident-card__header {
    margin-bottom: 16px;
}

.incident-card__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.incident-card__service {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.incident-card__badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 11px;
    border-radius: var(--radius-full);
}

.incident-card__badge--minor {
    background: rgba(154, 52, 18, 0.12);
    color: var(--warning-text);
}

.incident-card__badge--major {
    background: rgba(197, 48, 48, 0.1);
    color: var(--danger-text);
}

.incident-card__title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.incident-card__duration {
    font-size: 15px;
    color: var(--text-light);
}

.incident-card__scope {
    font-size: 14px;
    color: var(--text-light);
    background: rgba(255, 193, 7, 0.08);
    border-left: 3px solid #FFC107;
    padding: 6px 10px;
    border-radius: 4px;
    margin: 6px 0;
}
.incident-card__scope strong {
    color: var(--text);
    font-weight: 600;
}

/* Timeline — décalée à droite pour montrer l'appartenance */
.incident-card__timeline {
    position: relative;
    padding-left: 40px;
    margin-left: 12px;
    margin-bottom: 16px;
}

.incident-card__timeline::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: rgba(0, 47, 167, 0.12);
    border-radius: 2px;
}

/* Couper la ligne au dernier dot */
.incident-card__timeline .timeline-entry:last-child::after {
    content: '';
    position: absolute;
    left: -28px;
    top: 17px;
    bottom: -4px;
    width: 16px;
    background: var(--white);
    z-index: 0;
}

.timeline-entry {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 16px;
}

.timeline-entry:last-child {
    padding-bottom: 0;
}

.timeline-entry__dot {
    position: absolute;
    left: -28px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 1;
}

/* Repositionner le dot dans le contexte incident-card (padding-left: 40px) */
.incident-card__timeline .timeline-entry__dot {
    left: -28px;
}

/* Tous les dots remplis : meme taille, meme couleur, meme style */
.timeline-entry__dot--filled {
    background: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 47, 167, 0.10);
}

.timeline-entry__time {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 48px;
    padding-top: 1px;
}

.timeline-entry__message {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.5;
}

/* Encourage button */
.incident-card__actions {
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.encourage-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-light);
    background: var(--bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.encourage-btn:hover {
    border-color: #BE185D;
    color: #BE185D;
    background: rgba(236, 72, 153, 0.04);
    transform: translateY(-1px);
}

.encourage-btn:active {
    transform: scale(0.97);
}

.encourage-btn__icon {
    transition: transform var(--transition);
}

.encourage-btn--filled {
    color: #BE185D;
    border-color: #BE185D;
    background: rgba(236, 72, 153, 0.06);
}

.encourage-btn--filled .encourage-btn__icon {
    fill: #BE185D;
    stroke: #BE185D;
}

.encourage-btn--bounce .encourage-btn__icon {
    animation: heartBounce 400ms ease;
}

.encourage-btn__label {
    white-space: nowrap;
}

.encourage-btn__count {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   7. History
   -------------------------------------------------------------------------- */
.history {
    margin-bottom: 40px;
}

.history__empty {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    color: var(--text-light);
    box-shadow: var(--shadow-sm);
    font-size: 16px;
}

/* Masquer les éléments au-delà de 10 */
.history-card--hidden {
    display: none;
}

/* Bouton "Afficher plus" */
.history__show-more {
    display: block;
    width: 100%;
    min-height: 48px;
    margin-top: 14px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: var(--primary);
    background: var(--white);
    border: 1px solid rgba(0, 47, 167, 0.2);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.history__show-more:hover {
    background: rgba(0, 47, 167, 0.04);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.history__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.history-card__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background var(--transition);
}

.history-card__summary::-webkit-details-marker {
    display: none;
}

.history-card__summary:hover {
    background: var(--bg);
}

.history-card__info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.history-card__date {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.history-card__service {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.history-card__title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-card__right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.history-card__duration {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
}

.history-card__badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.history-card__badge--resolved {
    background: rgba(30, 126, 52, 0.12);
    color: var(--success-text);
}

.history-card__chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 300ms ease;
}

.history-card[open] .history-card__chevron {
    transform: rotate(180deg);
}

.history-card__timeline {
    padding: 0 20px 20px 20px;
    position: relative;
    padding-left: 60px;
    margin-left: 12px;
}

.history-card__timeline::before {
    content: '';
    position: absolute;
    left: 38px;
    top: 8px;
    bottom: 20px;
    width: 2px;
    background: rgba(0, 47, 167, 0.12);
    border-radius: 2px;
}

/* Couper la ligne au dernier dot (pas de trait qui dépasse) */
.history-card__timeline .timeline-entry:last-child::after {
    content: '';
    position: absolute;
    left: -28px;
    top: 17px;
    bottom: -4px;
    width: 16px;
    background: var(--white);
    z-index: 0;
}

.history-card__timeline .timeline-entry {
    padding-bottom: 12px;
}

.history-card__timeline .timeline-entry__dot {
    left: -28px;
}

/* --------------------------------------------------------------------------
   8. Notify form (par incident)
   -------------------------------------------------------------------------- */
.incident-card__notify {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.notify-form__row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notify-form__row svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.notify-form__input {
    flex: 1;
    min-height: 48px;
    padding: 12px 14px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.notify-form__input::placeholder {
    color: var(--text-muted);
}

.notify-form__input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 47, 167, 0.1);
}

.notify-form__btn {
    min-height: 48px;
    padding: 12px 18px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    transition: transform var(--transition), box-shadow var(--transition);
}

.notify-form__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 47, 167, 0.3);
}

.notify-form__btn:active {
    transform: scale(0.97);
}

.notify-form__btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.notify-form__message {
    margin-top: 8px;
    font-size: 15px;
    font-weight: 600;
    display: none;
}

.notify-form__message--success {
    color: var(--success-text);
}

.notify-form__message--error {
    color: var(--danger-text);
}

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */
.footer {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px 48px;
}

.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.footer__copy {
    font-size: 15px;
    color: var(--text-muted);
}

.footer__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 4px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition);
}

.footer__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 20px;
}

.footer__link:hover {
    color: var(--primary);
}

/* --------------------------------------------------------------------------
   10. Toast notifications
   -------------------------------------------------------------------------- */
.status-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.status-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   11. Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 currentColor;
    }
    50% {
        opacity: 0.85;
        box-shadow: 0 0 0 6px transparent;
    }
}

@keyframes heartBounce {
    0%   { transform: scale(1); }
    25%  { transform: scale(1.35); }
    50%  { transform: scale(0.9); }
    75%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* --------------------------------------------------------------------------
   12. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .main {
        padding: 20px 16px 48px;
    }

    .header__container {
        padding: 14px 16px;
    }

    .header__title {
        font-size: 17px;
    }

    .services__grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .service-card {
        padding: 14px 16px;
    }

    .incident-card {
        padding: 18px;
    }

    .incident-card__meta {
        flex-wrap: wrap;
    }

    .history-card__summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px 16px;
    }

    .history-card__info {
        flex-wrap: wrap;
        gap: 6px;
    }

    .history-card__right {
        width: 100%;
        justify-content: flex-end;
    }

    .notify-form__row {
        flex-direction: column;
    }

    .notify-form__btn {
        width: 100%;
        text-align: center;
    }

    .notify-form__row svg {
        display: none;
    }

    .global-status {
        padding: 16px 18px;
    }

    .global-status__label {
        font-size: 16px;
    }

    .footer__inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .footer__links {
        justify-content: center;
    }
}

/* --------------------------------------------------------------------------
   13. Accessibilité : respect du mouvement réduit
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
