* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --background: #070708;
    --card: rgba(13, 13, 15, 0.94);
    --border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --text-secondary: #8d8d96;
    --text-muted: #55555d;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 50% 0%, rgba(130,132,225,.11), transparent 38%), #070708;
    color: var(--text);
    font-family: "Aptos", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
}

#gridBackground {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.grid-cell {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.055);
    background: rgba(255, 255, 255, 0.008);
    opacity: 0.25;
    transform: scale(1);
    transform-origin: center;
    transition:
        transform 0.18s ease,
        opacity 0.18s ease,
        box-shadow 0.18s ease;
    will-change: transform, opacity;
}

.login-page {
    position: relative;
    z-index: 5;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 455px;
}

.login-embed {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card);
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.55),
        0 0 60px rgba(255, 255, 255, 0.015),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.login-embed::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ffffff;
    opacity: 0.9;
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.12);
}

.embed-header {
    position: relative;
    height: 58px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 21px;
    border-bottom: 1px solid var(--border);
    color: #c4c4ca;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.header-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: #ffffff;
}

.header-icon svg {
    width: 16px;
    height: 16px;
}

.embed-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    color: #777780;
    font-size: 10px;
    font-weight: 500;
}

.header-status span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
    animation: statusPulse 2s ease-in-out infinite;
}

.embed-content {
    padding: 29px;
}

.title-row {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.title-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: #ffffff;
}

.title-icon svg {
    width: 19px;
    height: 19px;
}

.embed-content h2 {
    padding-top: 1px;
    color: #ffffff;
    font-size: 20px;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -0.35px;
}

.embed-content p {
    margin-top: 7px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.input-container {
    margin-top: 26px;
}

.input-container label {
    display: block;
    margin-bottom: 9px;
    color: #c7c7cd;
    font-size: 12px;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #09090b;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}

.input-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.25);
    background: #0b0b0d;
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.035);
}

.input-icon {
    width: 48px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #65656d;
    transition:
        color 0.25s ease,
        transform 0.25s ease;
}

.input-icon svg {
    width: 17px;
    height: 17px;
}

.input-wrapper:focus-within .input-icon {
    color: #ffffff;
    transform: scale(1.08);
}

.input-wrapper input {
    width: 100%;
    height: 100%;
    padding: 0 14px 0 0;
    border: none;
    outline: none;
    background: transparent;
    color: #ffffff;
    font-family: "Courier New", monospace;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.input-wrapper input::placeholder {
    color: #46464d;
}

button {
    position: relative;
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    padding: 0 18px;
    border: none;
    border-radius: 11px;
    outline: none;
    background: #ffffff;
    color: #09090b;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        opacity 0.2s ease,
        box-shadow 0.2s ease;
}

button span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

button:hover svg {
    transform: translateX(3px);
}

button:active {
    transform: scale(0.97);
}

button:disabled {
    cursor: not-allowed;
}

.loader {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(0, 0, 0, 0.18);
    border-top-color: #09090b;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.message {
    display: none;
    width: 100%;
    margin-top: 13px;
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.5;
}

.message.error {
    display: block;
    border: 1px solid rgba(255, 77, 90, 0.18);
    background: rgba(255, 77, 90, 0.07);
    color: #ff7b84;
}

.message.success {
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.045);
    color: #ffffff;
}

.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 17px;
    color: var(--text-muted);
    font-size: 10px;
}

.footer-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-icon svg {
    width: 13px;
    height: 13px;
}

.separator {
    opacity: 0.45;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes statusPulse {
    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.85);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

@media (max-width: 520px) {
    .login-page {
        padding: 16px;
    }

    .login-card {
        max-width: 100%;
    }

    .embed-content {
        padding: 23px;
    }

    .embed-header {
        padding: 0 17px;
    }

    .header-status {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

#loginParticles { position:fixed; inset:0; z-index:1; overflow:hidden; pointer-events:none; }
#loginParticles i { position:absolute; top:-16px; left:var(--x); width:var(--size); height:var(--size); border-radius:50%; background:#f4f6ff; box-shadow:0 0 calc(var(--size) * 4) rgba(209,220,255,.65); opacity:.58; animation:loginSnow var(--duration) linear var(--delay) infinite; }
@keyframes loginSnow { from { transform:translate3d(0,-18px,0) scale(.7); } to { transform:translate3d(var(--drift),108vh,0) scale(1.15); } }
@media (prefers-reduced-motion:reduce) { #loginParticles i { animation:none; } }

/* ============ ÉCRAN DE CHARGEMENT ============ */
.login-loading {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 11px;
    padding: 24px;
    background: #070708;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .42s ease, visibility .42s ease;
}

.login-loading.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }
.login-loading-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 8px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 16px;
    background: rgba(255,255,255,.035);
    color: #f8f8fa;
    animation: loadingMark 1.8s ease-in-out infinite;
}
.login-loading-mark svg { width: 27px; height: 27px; }
.login-loading h1 { font-family: "Bahnschrift", "Segoe UI Variable", sans-serif; font-size: clamp(19px, 3vw, 25px); font-weight: 700; letter-spacing: -.045em; }
.login-loading p { color: #777780; font-size: 12px; }
.login-loading-progress { width: min(190px, 58vw); height: 2px; margin-top: 7px; overflow: hidden; background: rgba(255,255,255,.12); }
.login-loading-progress span { display: block; width: 48%; height: 100%; background: linear-gradient(90deg, #777780, #fff, #777780); animation: loadingProgress 1.15s ease-in-out infinite; }
@keyframes loadingMark { 0%, 100% { transform: scale(1); border-color: rgba(255,255,255,.14); } 50% { transform: scale(1.06); border-color: rgba(255,255,255,.35); } }
@keyframes loadingProgress { from { transform: translateX(-105%); } to { transform: translateX(220%); } }
