/* ========================================
   OPTIX PAGES COMMON STYLES
   Matches the neon cyberpunk design of index.html
   ======================================== */

/* --- VARIABLES (matching design-system.css) --- */
:root {
    /* Background */
    --bg-primary: #000000;
    --bg-secondary: #0a0a12;
    --bg-card: rgba(10, 10, 20, 0.85);

    /* Neon Accent Colors */
    --accent-blue: #2955ff;
    --accent-violet: #b366ff;
    --accent-cyan: #00f0ff;
    --accent-gradient: linear-gradient(135deg, var(--accent-blue) 30%, var(--accent-violet));
    --speed-gradient: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));

    /* Intense Glow Colors */
    --glow-blue: rgba(41, 85, 255, 0.6);
    --glow-violet: rgba(179, 102, 255, 0.6);
    --glow-cyan: rgba(0, 240, 255, 0.5);
    --glow-intense: 0 0 30px var(--glow-violet), 0 0 60px var(--glow-blue);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.55);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(41, 85, 255, 0.4);
    --border-neon: rgba(0, 240, 255, 0.3);

    /* Nav height */
    --nav-height: 64px;
}

/* --- BASE STYLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: var(--nav-height);
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ========================================
   ANIMATED BACKGROUND
   ======================================== */
.page-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.page-background__image {
    position: absolute;
    inset: 0;
    background-image: url('../img/blury background/wallpaperflare.com_wallpaper (5).jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.35;
}

.page-background__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.75) 0%,
            rgba(0, 0, 0, 0.85) 50%,
            rgba(0, 0, 0, 0.95) 100%);
}

.page-background__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 8s ease-in-out infinite;
}

.page-background__glow--blue {
    width: 450px;
    height: 450px;
    background: var(--accent-blue);
    top: 5%;
    left: 5%;
    animation-delay: 0s;
}

.page-background__glow--violet {
    width: 350px;
    height: 350px;
    background: var(--accent-violet);
    top: 40%;
    right: 10%;
    animation-delay: -4s;
}

.page-background__glow--small {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
    bottom: 15%;
    left: 25%;
    animation-delay: -2s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }

    25% {
        transform: translate(30px, -20px) scale(1.05);
        opacity: 0.4;
    }

    50% {
        transform: translate(-20px, 30px) scale(0.95);
        opacity: 0.35;
    }

    75% {
        transform: translate(20px, 20px) scale(1.02);
        opacity: 0.45;
    }
}

/* ========================================
   CONTAINER / DASHBOARD
   ======================================== */
.dashboard {
    padding: 80px 20px 60px;
    max-width: 550px;
    margin: auto;
    flex: 1;
    position: relative;
    z-index: 1;
}

.dashboard--wide {
    max-width: 1100px;
}

/* ========================================
   GLOW CARD (with shimmer border)
   ======================================== */
.card,
.glow-card {
    position: relative;
    background: linear-gradient(145deg, rgba(20, 20, 35, 0.9), rgba(10, 10, 20, 0.95));
    border-radius: 20px;
    padding: 40px 35px;
    backdrop-filter: blur(12px);
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(41, 85, 255, 0.08);
}

.card.visible,
.glow-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Shimmer border effect */
.card::before,
.glow-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1.5px;
    background: linear-gradient(135deg,
            rgba(41, 85, 255, 0.5),
            rgba(179, 102, 255, 0.2),
            rgba(41, 85, 255, 0.5));
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: border-shimmer 4s linear infinite;
    pointer-events: none;
}

.card:hover::before,
.glow-card:hover::before {
    background: linear-gradient(135deg,
            rgba(41, 85, 255, 0.7),
            rgba(179, 102, 255, 0.4),
            rgba(41, 85, 255, 0.7));
    background-size: 200% 200%;
}

@keyframes border-shimmer {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Card title */
.card h1,
.card h2,
.glow-card h1,
.glow-card h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 25px;
    text-align: center;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    text-align: center;
}

/* ========================================
   FORM CONTROLS
   ======================================== */
.form-control {
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(25, 25, 45, 0.8), rgba(15, 15, 30, 0.9));
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 0 0 transparent;
    transition: all 0.3s ease;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(41, 85, 255, 0.25),
        0 0 50px rgba(41, 85, 255, 0.1);
    background: linear-gradient(145deg, rgba(30, 30, 55, 0.9), rgba(20, 20, 40, 0.95));
}

/* ========================================
   BUTTONS
   ======================================== */
.btn,
.glow-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 32px;
    margin-top: 12px;
    border: none;
    border-radius: 14px;
    background: var(--accent-gradient);
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    box-shadow:
        0 0 25px rgba(41, 85, 255, 0.3),
        0 8px 25px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.btn:hover:enabled,
.glow-button:hover:enabled,
.btn:hover,
.glow-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 0 40px rgba(41, 85, 255, 0.5),
        0 0 80px rgba(41, 85, 255, 0.2),
        0 15px 40px rgba(0, 0, 0, 0.5);
}

.btn:active,
.glow-button:active {
    transform: translateY(-1px) scale(1.01);
}

.btn:disabled,
.glow-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Secondary/Danger button */
.btn.danger {
    background: linear-gradient(135deg, #ff4d6d 30%, #c9184a);
    box-shadow:
        0 0 25px rgba(255, 77, 109, 0.3),
        0 8px 25px rgba(0, 0, 0, 0.4);
}

.btn.danger:hover {
    box-shadow:
        0 0 40px rgba(255, 77, 109, 0.5),
        0 0 80px rgba(255, 77, 109, 0.2),
        0 15px 40px rgba(0, 0, 0, 0.5);
}

/* Loading state button */
.btn.loading,
.glow-button.loading {
    background: linear-gradient(135deg, #1a2a6e 30%, #3d2a6e);
    opacity: 0.85;
    cursor: wait;
    pointer-events: none;
    transform: none;
    box-shadow:
        0 0 15px rgba(41, 85, 255, 0.2),
        0 4px 15px rgba(0, 0, 0, 0.3);
    animation: pulse-loading 1.5s ease-in-out infinite;
}

.btn.loading:hover,
.glow-button.loading:hover {
    transform: none;
    box-shadow:
        0 0 15px rgba(41, 85, 255, 0.2),
        0 4px 15px rgba(0, 0, 0, 0.3);
}

@keyframes pulse-loading {

    0%,
    100% {
        opacity: 0.85;
    }

    50% {
        opacity: 0.7;
    }
}

/* ========================================
   NEON SPINNER (matching index.html design)
   ======================================== */
.spinner-border {
    display: none;
    margin: 25px auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top: 3px solid var(--accent-blue);
    border-right: 3px solid var(--accent-violet);
    animation: neon-spin 0.9s linear infinite;
    position: relative;
    box-shadow:
        0 0 20px rgba(41, 85, 255, 0.5),
        0 0 40px rgba(41, 85, 255, 0.3),
        0 0 60px rgba(179, 102, 255, 0.2),
        inset 0 0 15px rgba(41, 85, 255, 0.3);
}

.spinner-border::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top: 2px solid var(--accent-cyan);
    border-left: 2px solid rgba(0, 240, 255, 0.3);
    animation: neon-spin-reverse 1.2s linear infinite;
    opacity: 0.8;
}

.spinner-border::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(41, 85, 255, 0.2) 0%,
            rgba(179, 102, 255, 0.1) 40%,
            transparent 70%);
    animation: pulse-core 1.5s ease-in-out infinite;
}

@keyframes neon-spin {
    0% {
        transform: rotate(0deg);
        box-shadow:
            0 0 20px rgba(41, 85, 255, 0.5),
            0 0 40px rgba(41, 85, 255, 0.3),
            0 0 60px rgba(179, 102, 255, 0.2);
    }

    50% {
        box-shadow:
            0 0 25px rgba(179, 102, 255, 0.6),
            0 0 50px rgba(179, 102, 255, 0.4),
            0 0 80px rgba(41, 85, 255, 0.3);
    }

    100% {
        transform: rotate(360deg);
        box-shadow:
            0 0 20px rgba(41, 85, 255, 0.5),
            0 0 40px rgba(41, 85, 255, 0.3),
            0 0 60px rgba(179, 102, 255, 0.2);
    }
}

@keyframes neon-spin-reverse {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

@keyframes pulse-core {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.9);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* ========================================
   LINKS
   ======================================== */
.links {
    margin-top: 25px;
    font-size: 0.95rem;
    text-align: center;
}

.links a {
    display: block;
    margin-top: 10px;
    color: var(--text-muted);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.links a:hover {
    color: var(--accent-violet);
    text-shadow: 0 0 15px rgba(179, 102, 255, 0.4);
}

/* ========================================
   REMEMBER CHECKBOX (styled)
   ======================================== */
.remember-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
    margin: 10px 0 15px;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.remember-row:hover {
    background: rgba(41, 85, 255, 0.05);
}

.remember-row .remember-label {
    color: var(--text-secondary);
    line-height: 1;
}

.remember-row input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(145deg, rgba(20, 20, 40, 0.9), rgba(30, 30, 60, 0.8));
    display: inline-grid;
    place-items: center;
    transition: all 0.2s ease;
    box-shadow:
        inset 0 -2px 6px rgba(0, 0, 0, 0.5),
        0 0 0 0 transparent;
    cursor: pointer;
    outline: none;
    margin: 0;
    position: relative;
}

.remember-row input[type="checkbox"]::after {
    content: "";
    width: 10px;
    height: 6px;
    border-left: 2px solid transparent;
    border-bottom: 2px solid transparent;
    transform: rotate(-45deg) scale(0.8);
    opacity: 0;
    transition: all 0.2s ease;
}

.remember-row input[type="checkbox"]:checked {
    background: var(--accent-gradient);
    border: none;
    box-shadow:
        0 0 20px rgba(41, 85, 255, 0.4),
        inset 0 -2px 6px rgba(0, 0, 0, 0.3);
}

.remember-row input[type="checkbox"]:checked::after {
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    opacity: 1;
    transform: rotate(-45deg) scale(1);
}

.remember-row input[type="checkbox"]:focus-visible {
    box-shadow:
        0 0 0 3px rgba(41, 85, 255, 0.3),
        0 0 15px rgba(41, 85, 255, 0.2);
}

/* ========================================
   ERROR MESSAGES
   ======================================== */
#error,
#passwordErrorMsg,
.error-msg {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-bottom: 12px;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    background: rgba(5, 5, 10, 0.95);
    padding: 25px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

footer a {
    color: var(--accent-blue);
    margin: 0 12px;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

footer a:hover {
    color: var(--accent-violet);
    text-shadow: 0 0 15px rgba(179, 102, 255, 0.4);
}

/* ========================================
   UTILITIES
   ======================================== */
.d-none {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .dashboard {
        padding: 60px 16px 40px;
    }

    .card,
    .glow-card {
        padding: 30px 25px;
        border-radius: 16px;
    }

    .page-background__glow--blue {
        width: 280px;
        height: 280px;
    }

    .page-background__glow--violet {
        width: 220px;
        height: 220px;
    }

    .page-background__glow--small {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 480px) {
    .dashboard {
        padding: 50px 12px 30px;
    }

    .card,
    .glow-card {
        padding: 25px 20px;
    }

    .form-control {
        padding: 14px 16px;
    }

    .btn,
    .glow-button {
        padding: 14px 24px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 25px rgba(41, 85, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(41, 85, 255, 0.5);
    }
}

/* Password Visibility Toggle */
.password-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 18px;
    /* On déplace la marge ici */
}

.password-wrapper .form-control {
    padding-right: 45px;
    margin-bottom: 0;
    /* On enlève la marge de l'input */
}

.password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.25rem;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--accent-violet);
    text-shadow: 0 0 10px rgba(179, 102, 255, 0.4);
}