@import url('https://fonts.googleapis.com/css2?family=Londrina+Solid:wght@300;400;900&family=Raleway:wght@400;600;700;800;900&display=swap');

:root {
    --system-bg: #37322f;
    --system-text: #fffaf0;
    --system-muted: rgba(255, 250, 240, 0.72);
    --system-soft: rgba(255, 250, 240, 0.12);
    --system-border: rgba(255, 250, 240, 0.22);
    --system-accent: #e96646;
    --system-accent-soft: rgba(233, 102, 70, 0.2);
    --system-green: #74c46b;
    --system-red: #e14249;
    --system-bg-svg: url('/assets/system/signage-system_background-black.svg');
    --system-frame-top: url('/assets/system/signage-system_separator-cut-black.svg');
    --system-frame-bottom: url('/assets/system/signage-system_separator-cut-black.svg');
    --system-frame-height: clamp(74px, 8.8vw, 148px);
    --system-frame-safe: clamp(92px, 10.6vw, 176px);
}

* { box-sizing: border-box; }

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    cursor: none;
    user-select: none;
}

body {
    min-height: 100vh;
    background-color: var(--system-bg);
    color: var(--system-text);
    font-family: 'Raleway', Arial, sans-serif;
}

.system-page {
    position: relative;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    background-color: var(--system-bg);
    isolation: isolate;
}

.system-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: var(--system-bg-svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 1;
    pointer-events: none;
}

.system-page::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to bottom, rgba(55, 50, 47, 0.5), transparent 24%, transparent 76%, rgba(55, 50, 47, 0.55)),
        radial-gradient(circle at center, transparent 0%, rgba(55, 50, 47, 0.22) 100%);
    pointer-events: none;
}

/* =========================================================
   Cadres système : collés aux bords, sans espace
   ========================================================= */
.system-frame {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 5;
    width: 100vw;
    height: var(--system-frame-height);
    pointer-events: none;
    background-image: var(--system-frame-bottom);
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.system-frame--top {
    top: 0;
    bottom: auto;
    background-position: center top;
    transform: scaleY(-1);
    transform-origin: top center;
}

.system-frame--bottom {
    bottom: 0;
    top: auto;
    background-position: center bottom;
}

.system-inner {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    padding: clamp(80px, 10vw, 150px) clamp(40px, 6vw, 110px);
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    justify-items: center;
    text-align: center;
}

.system-logo {
    width: clamp(150px, 16vw, 290px);
    max-height: clamp(72px, 9vw, 138px);
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 14px 35px rgba(0, 0, 0, 0.22));
}

.system-content {
    width: min(1220px, 88vw);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(18px, 2.3vw, 34px);
}

.system-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75em;
    padding: 0.72em 1.22em;
    border: 2px solid var(--system-border);
    border-radius: 999px;
    background: rgba(255, 250, 240, 0.08);
    color: var(--system-text);
    font-size: clamp(13px, 1.35vw, 22px);
    font-weight: 900;
    letter-spacing: 0.13em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.system-dot {
    width: 0.78em;
    height: 0.78em;
    border-radius: 999px;
    flex: 0 0 auto;
    background: var(--system-green);
    box-shadow: 0 0 0 0.34em rgba(116, 196, 107, 0.18);
}

.system-dot--red {
    background: var(--system-red);
    box-shadow: 0 0 0 0.34em rgba(225, 66, 73, 0.18);
}

.system-dot--pulse {
    animation: systemPulse 1.7s ease-in-out infinite;
}

@keyframes systemPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.78); }
}

.system-title {
    margin: 0;
    font-family: 'Londrina Solid', Impact, sans-serif;
    font-size: clamp(72px, 10vw, 170px);
    font-weight: 900;
    line-height: 0.82;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--system-text);
    text-shadow: 0 12px 42px rgba(0, 0, 0, 0.28);
}

.system-subtitle {
    margin: 0;
    max-width: 22ch;
    font-size: clamp(28px, 4vw, 70px);
    font-weight: 900;
    line-height: 0.98;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--system-text);
}

.system-message {
    margin: 0;
    max-width: 48ch;
    color: var(--system-muted);
    font-size: clamp(18px, 2vw, 34px);
    font-weight: 700;
    line-height: 1.32;
}

.system-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: calc(100vw - 96px);
    min-width: min(880px, 82vw);
    padding: clamp(18px, 3.2vw, 52px) clamp(28px, 4.7vw, 82px);
    border: 3px solid rgba(255, 250, 240, 0.52);
    border-radius: 28px;
    background: rgba(0, 0, 0, 0.24);
    color: var(--system-text);
    font-family: 'Londrina Solid', Impact, sans-serif;
    font-size: clamp(74px, 11vw, 190px);
    font-weight: 900;
    line-height: 0.82;
    letter-spacing: 0.08em;
    white-space: nowrap;
    overflow: hidden;
    text-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

.system-code.is-success {
    color: var(--system-green);
    letter-spacing: 0.03em;
}

.system-footer {
    width: min(1180px, 86vw);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    color: rgba(255, 250, 240, 0.55);
    font-size: clamp(12px, 1vw, 18px);
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

.system-footer span:last-child { text-align: right; }

/* Typographie technique conservée pour les informations d'écran.
   Exemple : 1920 × 1080 · Paysage */
.system-screen-meta,
.system-footer #info {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: clamp(18px, 1.85vw, 34px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.04em;
    color: var(--system-text);
    text-transform: uppercase;
    text-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
    font-variant-numeric: tabular-nums;
}

.system-screen-meta--small {
    font-size: clamp(14px, 1.35vw, 24px);
}

.system-dev-grid {
    width: min(1280px, 90vw);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 1.4vw, 24px);
    text-align: left;
}

.system-dev-card {
    min-height: 112px;
    padding: clamp(16px, 1.8vw, 30px);
    border: 1px solid var(--system-border);
    border-radius: 22px;
    background: rgba(255, 250, 240, 0.08);
}

.system-dev-label {
    margin-bottom: 12px;
    color: var(--system-muted);
    font-size: clamp(11px, 0.95vw, 15px);
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.system-dev-value {
    color: var(--system-text);
    font-size: clamp(17px, 1.45vw, 28px);
    font-weight: 800;
    line-height: 1.15;
    word-break: break-word;
}

/* =========================================================
   Page appairage
   ========================================================= */

.system-page--pair .system-inner {
    padding-top: max(var(--system-frame-safe), 8vh);
    padding-bottom: max(var(--system-frame-safe), 8vh);
    padding-left: clamp(22px, 5vw, 96px);
    padding-right: clamp(22px, 5vw, 96px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(18px, 3.2vh, 42px);
}

.system-page--pair header {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
}

.system-page--pair .system-logo {
    width: clamp(140px, 12.6vw, 235px);
    max-height: clamp(64px, 7.1vw, 104px);
}

.system-page--pair .system-content {
    width: min(1120px, 90vw);
    max-height: calc(100vh - (2 * var(--system-frame-safe)) - 16px);
    gap: clamp(12px, 1.8vh, 22px);
    flex: 0 1 auto;
}

.system-page--pair .system-kicker {
    margin-bottom: clamp(2px, 0.7vh, 6px);
}

.system-page--pair .system-code {
    min-width: 0;
    max-width: min(1180px, 94vw);
    padding: clamp(20px, 3vw, 48px) clamp(48px, 5.2vw, 110px);
    font-size: clamp(68px, 10.1vw, 198px);
    letter-spacing: 0.052em;
    box-sizing: border-box;
    white-space: nowrap;
}

.system-page--pair .system-message {
    max-width: 54ch;
    font-size: clamp(16px, 1.65vw, 28px);
    line-height: 1.24;
}

.system-page--pair .system-screen-meta {
    margin-top: clamp(0px, 0.5vh, 8px);
    color: rgba(255, 250, 240, 0.82);
    font-size: clamp(15px, 1.35vw, 24px);
    font-weight: 650;
    letter-spacing: 0.055em;
    text-shadow: 0 8px 26px rgba(0, 0, 0, 0.24);
    white-space: nowrap;
}

@media (max-width: 900px) {
    :root {
        --system-frame-height: clamp(48px, 10vw, 84px);
        --system-frame-safe: clamp(68px, 13vw, 104px);
    }

    .system-inner {
        padding: 90px 24px;
    }

    .system-footer {
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        text-align: center;
    }

    .system-footer span:last-child { text-align: center; }

    .system-code {
        min-width: 0;
        width: auto;
        max-width: calc(100vw - 36px);
    }

    .system-dev-grid { grid-template-columns: 1fr; }

    .system-page--pair .system-inner {
        padding-top: max(var(--system-frame-safe), 60px);
        padding-bottom: max(var(--system-frame-safe), 60px);
        padding-left: 18px;
        padding-right: 18px;
        gap: clamp(14px, 2.5vh, 26px);
    }

    .system-page--pair .system-content {
        width: min(640px, 94vw);
        gap: 12px;
    }

    .system-page--pair .system-code {
        max-width: calc(100vw - 44px);
        padding: 16px 30px;
        border-radius: 20px;
        font-size: clamp(48px, 11.8vw, 92px);
        letter-spacing: 0.035em;
    }

    .system-page--pair .system-message {
        font-size: clamp(13px, 2.8vw, 18px);
        line-height: 1.22;
    }

    .system-page--pair .system-screen-meta {
        font-size: clamp(12px, 2.5vw, 16px);
    }
}

@media (max-width: 560px) {
    .system-page--pair .system-code {
        padding-left: 24px;
        padding-right: 24px;
        font-size: clamp(38px, 10.4vw, 60px);
        letter-spacing: 0.018em;
    }

    .system-page--pair .system-kicker {
        font-size: 12px;
        letter-spacing: 0.08em;
    }
}

@media (max-height: 620px) {
    :root {
        --system-frame-height: 58px;
        --system-frame-safe: 72px;
    }

    .system-page--pair .system-inner {
        padding-top: var(--system-frame-safe);
        padding-bottom: var(--system-frame-safe);
        gap: 10px;
    }

    .system-page--pair .system-logo {
        width: clamp(96px, 13vw, 160px);
        max-height: 60px;
    }

    .system-page--pair .system-kicker {
        font-size: clamp(10px, 1.45vw, 14px);
        padding: 0.52em 0.9em;
    }

    .system-page--pair .system-code {
        padding: 12px 20px;
        font-size: clamp(44px, 9.8vw, 98px);
        border-radius: 18px;
    }

    .system-page--pair .system-message {
        max-width: 58ch;
        font-size: clamp(11px, 1.55vw, 15px);
        line-height: 1.18;
    }

    .system-page--pair .system-screen-meta {
        font-size: clamp(11px, 1.4vw, 15px);
    }
}

@media (max-height: 430px) {
    :root {
        --system-frame-height: 46px;
        --system-frame-safe: 54px;
    }

    .system-page--pair .system-inner {
        gap: 7px;
        padding-left: 24px;
        padding-right: 24px;
    }

    .system-page--pair .system-logo {
        width: 110px;
        max-height: 42px;
    }

    .system-page--pair .system-kicker {
        transform: scale(0.92);
    }

    .system-page--pair .system-code {
        font-size: clamp(36px, 8.8vw, 76px);
        padding: 9px 16px;
        border-radius: 16px;
    }

    .system-page--pair .system-message {
        display: none;
    }
}

/* =========================================================
   Pages système unifiées (empty / maintenance / dev)
   ========================================================= */

.system-page--empty .system-inner,
.system-page--maintenance .system-inner,
.system-page--dev .system-inner {
    padding-top: max(var(--system-frame-safe), 8vh);
    padding-bottom: max(var(--system-frame-safe), 8vh);
    padding-left: clamp(28px, 6vw, 112px);
    padding-right: clamp(28px, 6vw, 112px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 4vh, 56px);
}

.system-page--empty .system-logo,
.system-page--maintenance .system-logo,
.system-page--dev .system-logo {
    width: clamp(140px, 12.6vw, 235px);
    max-height: clamp(64px, 7.1vw, 104px);
}

.system-card {
    width: min(1040px, 88vw);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(16px, 2.4vh, 30px);
    padding: clamp(26px, 4vw, 58px);
    border: 3px solid rgba(255, 250, 240, 0.34);
    border-radius: clamp(24px, 2.4vw, 38px);
    background: rgba(0, 0, 0, 0.20);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

.system-card--soft {
    border-color: rgba(255, 250, 240, 0.24);
    background: rgba(255, 250, 240, 0.065);
}

.system-card--maintenance {
    border-color: rgba(233, 102, 70, 0.62);
    background: rgba(233, 102, 70, 0.10);
}

.system-card .system-title {
    font-size: clamp(58px, 7.6vw, 138px);
}

.system-card .system-subtitle {
    max-width: 24ch;
    font-size: clamp(26px, 3.2vw, 56px);
}

.system-card .system-message {
    max-width: 56ch;
    font-size: clamp(16px, 1.65vw, 28px);
}

.system-page--maintenance .system-dot {
    background: var(--system-accent);
    box-shadow: 0 0 0 0.34em rgba(233, 102, 70, 0.18);
}

.system-page--dev .system-content {
    width: min(1280px, 90vw);
}

.system-page--dev .system-dev-grid {
    margin-top: clamp(8px, 1vh, 18px);
}

@media (max-width: 900px) {
    .system-card {
        width: min(680px, 94vw);
        padding: 24px 20px;
    }

    .system-card .system-title {
        font-size: clamp(44px, 10vw, 78px);
    }

    .system-card .system-subtitle {
        font-size: clamp(22px, 5.6vw, 40px);
    }

    .system-card .system-message {
        font-size: clamp(13px, 3.1vw, 18px);
    }
}

@media (max-height: 620px) {
    .system-page--empty .system-inner,
    .system-page--maintenance .system-inner,
    .system-page--dev .system-inner {
        gap: 14px;
    }

    .system-page--empty .system-logo,
    .system-page--maintenance .system-logo,
    .system-page--dev .system-logo {
        width: clamp(96px, 13vw, 160px);
        max-height: 60px;
    }

    .system-card {
        padding: 18px 24px;
        gap: 10px;
    }

    .system-card .system-title {
        font-size: clamp(38px, 7vw, 76px);
    }

    .system-card .system-subtitle {
        font-size: clamp(18px, 3.4vw, 32px);
    }

    .system-card .system-message {
        font-size: clamp(11px, 1.7vw, 15px);
        line-height: 1.18;
    }
}