:root {
    --primary:      #c41e3a;
    --primary-dark: #a01830;
    --primary-glow: rgba(196, 30, 58, 0.22);
    --card-bg:      rgba(8, 4, 4, 0.82);
    --input-bg:     rgba(4, 2, 2, 0.90);
    --text-main:    #f2f2f2;
    --text-muted:   #909090;
    --text-dim:     #505050;
    --border-light:  rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.11);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        linear-gradient(rgba(6, 3, 3, 0.82), rgba(6, 3, 3, 0.82)),
        url('../images/background.jpg') center center / cover no-repeat fixed;
    background-color: #060303;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-main);
}

/* Particles canvas sits behind main content */
#particles-canvas-container {
    opacity: 1;
}

.hyperion-main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ── Neon border wrapper ─────────────────────────────────────────────────── */

.login-neon-wrapper {
    position: relative;
    border-radius: 18px;
    width: 100%;
    max-width: 424px;
    border: 1px solid rgba(196, 30, 58, 0.55);
    animation: neon-border-pulse 2.8s ease-in-out infinite, card-appear 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes neon-border-pulse {
    0%, 100% {
        border-color: rgba(196, 30, 58, 0.45);
        box-shadow:
            0 0  8px rgba(196, 30, 58, 0.40),
            0 0 24px rgba(196, 30, 58, 0.18),
            0 0 50px rgba(196, 30, 58, 0.08),
            0 32px 72px rgba(0, 0, 0, 0.65);
    }
    /* flicker rapide */
    42% {
        border-color: rgba(255, 60, 85, 0.95);
        box-shadow:
            0 0 18px rgba(196, 30, 58, 0.80),
            0 0 50px rgba(196, 30, 58, 0.42),
            0 0 90px rgba(196, 30, 58, 0.18),
            0 32px 72px rgba(0, 0, 0, 0.65);
    }
    48% {
        border-color: rgba(196, 30, 58, 0.30);
        box-shadow:
            0 0  5px rgba(196, 30, 58, 0.18),
            0 0 14px rgba(196, 30, 58, 0.08),
            0 32px 72px rgba(0, 0, 0, 0.65);
    }
    54% {
        border-color: rgba(255, 60, 85, 0.95);
        box-shadow:
            0 0 18px rgba(196, 30, 58, 0.80),
            0 0 50px rgba(196, 30, 58, 0.42),
            0 0 90px rgba(196, 30, 58, 0.18),
            0 32px 72px rgba(0, 0, 0, 0.65);
    }
}

@keyframes card-appear {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Glassmorphism card ──────────────────────────────────────────────────────  */

.hyperion-login-container {
    position: relative;
    z-index: 1;
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    backdrop-filter: blur(24px) saturate(1.3);
    border-radius: 16px;
    padding: 44px;
    width: 100%;
}

/* ── Logo ──────────────────────────────────────────────────────────────────── */

.hyperion-logo {
    text-align: center;
    margin-bottom: 28px;
}

.hyperion-logo img {
    width: 100px;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(196, 30, 58, 0.45));
    animation: logo-float 3.5s ease-in-out infinite;
}

@keyframes logo-float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-7px); }
}

/* ── Textes ──────────────────────────────────────────────────────────────── */

.hyperion-login-container h1 {
    color: var(--text-main);
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.hyperion-subtitle {
    color: var(--text-muted);
    text-align: center;
    font-size: 13px;
    margin-bottom: 30px;
}

/* ── Formulaire ──────────────────────────────────────────────────────────── */

.hyperion-form-group {
    margin-bottom: 18px;
}

.hyperion-form-group label {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 8px;
}

.hyperion-lock-icon {
    display: inline-block;
    margin-right: 6px;
}

.hyperion-form-group input[type="text"],
.hyperion-form-group input[type="password"] {
    width: 100%;
    padding: 13px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.25s;
    outline: none;
}

.hyperion-form-group input[type="text"]:focus,
.hyperion-form-group input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 0 12px rgba(196, 30, 58, 0.20);
}

.hyperion-form-group input:-webkit-autofill,
.hyperion-form-group input:-webkit-autofill:hover,
.hyperion-form-group input:-webkit-autofill:focus,
.hyperion-form-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0px 1000px #040202 inset !important;
    -webkit-text-fill-color: #f2f2f2 !important;
    caret-color: #f2f2f2 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ── Bouton ──────────────────────────────────────────────────────────────── */

.hyperion-btn-submit {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    margin-top: 10px;
}

/* Shimmer sweep on hover */
.hyperion-btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transform: skewX(-20deg);
    transition: none;
}

.hyperion-btn-submit:hover::before {
    animation: btn-shimmer 0.55s ease-out forwards;
}

@keyframes btn-shimmer {
    from { left: -80%; }
    to   { left: 140%; }
}

.hyperion-btn-submit:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 22px rgba(196, 30, 58, 0.50);
}

.hyperion-btn-submit:active {
    transform: scale(0.98);
}

.hyperion-btn-submit:disabled {
    background: #2a2a2a;
    color: var(--text-dim);
    cursor: not-allowed;
    box-shadow: none;
}

/* ── Messages ────────────────────────────────────────────────────────────── */

.hyperion-info {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.26);
    color: #93c5fd;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    text-align: center;
}

.hyperion-error {
    background: rgba(196, 30, 58, 0.10);
    border: 1px solid rgba(196, 30, 58, 0.30);
    color: #f08090;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    text-align: center;
}

.hyperion-error .bx {
    vertical-align: middle;
    margin-right: 5px;
}

.rate-limit-info {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.26);
    color: #fcd34d;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    text-align: center;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.hyperion-login-footer {
    text-align: center;
    margin-top: 28px;
}

.login-footer-text {
    font-size: 11px;
    color: var(--text-dim);
}

.login-back-link {
    display: block;
    text-align: center;
    margin-top: 22px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.login-back-link:hover {
    color: var(--text-muted);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .hyperion-login-container {
        padding: 28px 18px;
    }

    .hyperion-login-container h1 {
        font-size: 20px;
    }

    .hyperion-logo img {
        width: 80px;
    }
}

/* ── Shake animation ─────────────────────────────────────────────────────── */

@keyframes hyperion-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.hyperion-error-shake {
    animation: hyperion-shake 0.5s;
}
