/* ================================================================
   BBS FELIN -- Styles CRT retro
   Palette : Phosphore P1 (vert) + Ambre P3
   Polices : Orbitron (titres), Share Tech Mono (texte), Noto Naskh Arabic (arabe)
   Fond noir, scanlines, glitch chromatic aberration
   ================================================================ */

/* -- Import polices -------------------------------------------- */
@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&family=Noto+Naskh+Arabic:wght@400;700&display=swap");

/* -- Reset minimal --------------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* -- Base ------------------------------------------------------ */
body {
    background-color: #000000;
    color: #55FF55;
    font-family: "Share Tech Mono", "Courier New", monospace;
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* -- Scanlines ------------------------------------------------- */
.crt-screen::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.12) 0px,
        rgba(0, 0, 0, 0.12) 1px,
        transparent 1px,
        transparent 3px
    );
    z-index: 9999;
}

/* ================================================================
   PHASE 0 — Prompt d entree (clic pour debloquer audio)
   ================================================================ */

.prompt-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.prompt-text {
    color: #55FF55;
    font-family: "Share Tech Mono", monospace;
    font-size: 1.2em;
    letter-spacing: 0.08em;
    text-shadow: 0 0 6px rgba(85, 255, 85, 0.4);
}

.prompt-cursor {
    animation: blink 0.8s step-start infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ================================================================
   PHASE A — Barre de progression modem
   ================================================================ */

.modem-phase {
    display: none;                 /* affiche par landing.js */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2em;
}

.modem-text {
    color: #55FF55;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.9em;
    margin-bottom: 1.5em;
    text-align: center;
    min-height: 1.4em;
    letter-spacing: 0.05em;
}

.modem-bar {
    width: 65%;
    max-width: 500px;
    height: 8px;
    background-color: #111;
    border: 1px solid #227722;
    border-radius: 2px;
    overflow: hidden;
}

.modem-bar-fill {
    width: 0%;
    height: 100%;
    background-color: #39FF14;
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
    transition: none;             /* geree par JS pour les saccades */
}

.mute-btn {
    position: fixed;
    top: 1em;
    right: 1em;
    color: #FFB000;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.75em;
    background: none;
    border: 1px solid #FFB000;
    padding: 0.3em 0.6em;
    cursor: pointer;
    z-index: 10000;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.mute-btn:hover {
    opacity: 1;
}

/* ================================================================
   PHASE C — Landing
   ================================================================ */

.landing-phase {
    display: none;                 /* affiche par landing.js */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2em;
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

/* -- Logo ASCII ------------------------------------------------ */
.crt-logo {
    color: #55FF55;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.55em;
    line-height: 1.2;
    text-align: center;
    margin-bottom: 1.5em;
    white-space: pre;
    text-shadow: 0 0 6px rgba(85, 255, 85, 0.3);
}

/* -- Tagline avec glitch --------------------------------------- */
.tagline {
    font-family: "Orbitron", sans-serif;
    font-weight: 900;
    font-size: 2.2em;
    color: #55FF55;
    text-align: center;
    letter-spacing: 0.08em;
    margin-bottom: 2em;
    position: relative;
    text-shadow: 0 0 10px rgba(85, 255, 85, 0.5);
    animation: pulse 4s ease-in-out infinite;
}

/* -- Glitch : chromatic aberration quand la classe est active --- */
.tagline.glitch-active {
    animation: glitchShift 0.2s steps(2) forwards;
}

.tagline.glitch-active::before,
.tagline.glitch-active::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
}

.tagline.glitch-active::before {
    color: #00FFFF;
    text-shadow: -2px 0 #00FFFF;
    clip-path: inset(0 0 50% 0);
    animation: glitchTop 0.2s steps(2) forwards;
}

.tagline.glitch-active::after {
    color: #FF0044;
    text-shadow: 2px 0 #FF0044;
    clip-path: inset(50% 0 0 0);
    animation: glitchBottom 0.2s steps(2) forwards;
}

@keyframes pulse {
    0%, 100% { opacity: 0.88; }
    50% { opacity: 1; }
}

@keyframes glitchShift {
    0% { transform: translate(0); }
    25% { transform: translate(-2px, 1px); }
    50% { transform: translate(2px, -1px); }
    75% { transform: translate(-1px, -1px); }
    100% { transform: translate(0); }
}

@keyframes glitchTop {
    0% { transform: translate(0); }
    50% { transform: translate(-3px, 0); }
    100% { transform: translate(0); }
}

@keyframes glitchBottom {
    0% { transform: translate(0); }
    50% { transform: translate(3px, 0); }
    100% { transform: translate(0); }
}

/* -- Bouton connexion ------------------------------------------ */
.login-btn {
    display: inline-block;
    font-family: "Orbitron", sans-serif;
    font-weight: 700;
    font-size: 0.85em;
    color: #000000;
    background-color: #55FF55;
    padding: 0.7em 1.8em;
    text-decoration: none;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
}

.login-btn:hover {
    background-color: #77FF77;
    box-shadow: 0 0 15px rgba(85, 255, 85, 0.5);
}

/* -- Footer ---------------------------------------------------- */
.crt-footer {
    color: #227722;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.7em;
    text-align: center;
    margin-top: 3em;
}

/* ================================================================
   Dashboard (connecte)
   ================================================================ */

.dashboard-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5em;
}

.dash-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5em;
}

.dash-nav-user {
    color: #55FF55;
    font-weight: 700;
}

.dash-nav-links a {
    color: #FFB000;
    text-decoration: none;
    margin-left: 1em;
    font-size: 0.8em;
}

.dash-nav-links a:hover {
    text-shadow: 0 0 6px rgba(255, 176, 0, 0.5);
}

.dash-title {
    font-family: "Orbitron", sans-serif;
    font-weight: 700;
    font-size: 1.6em;
    color: #55FF55;
    text-align: center;
    margin: 0.5em 0 0.2em;
    text-shadow: 0 0 8px rgba(85, 255, 85, 0.3);
}

.dash-subtitle {
    font-family: "Orbitron", sans-serif;
    font-size: 0.85em;
    color: #FFB000;
    text-align: center;
    margin-bottom: 1em;
}

.crt-separator-thin {
    color: #227722;
    text-align: center;
    margin: 0.8em 0;
    font-size: 0.7em;
}

.dash-content {
    padding: 1em 0;
}

.dash-content p {
    padding-left: 1em;
}

/* ================================================================
   Profil
   ================================================================ */

.profile-info {
    padding: 1em 0;
}

.profile-info p {
    padding-left: 1em;
}

.profile-section-title {
    color: #FFB000;
    font-family: "Orbitron", sans-serif;
    font-size: 0.9em;
    margin: 0.5em 0;
    text-align: center;
}

.profile-form {
    padding: 0.5em 1em;
}

.profile-toggle-btn {
    display: inline-block;
    margin-top: 0.8em;
    color: #55FF55;
    background: none;
    border: 1px solid #55FF55;
    padding: 0.4em 1em;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.profile-toggle-btn:hover {
    background-color: #55FF55;
    color: #000000;
}

/* ================================================================
   Page d erreur CRT
   ================================================================ */

.error-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 4em 2em;
    text-align: center;
}

.error-title {
    font-family: "Orbitron", sans-serif;
    font-weight: 700;
    font-size: 1.5em;
    color: #FFB000;
    margin-bottom: 1em;
    text-shadow: 0 0 8px rgba(255, 176, 0, 0.4);
}

.error-message {
    color: #996600;
    margin-bottom: 2em;
    line-height: 1.6;
}

.error-links {
    margin-bottom: 3em;
}

.error-link {
    color: #55FF55;
    text-decoration: none;
    border: 1px solid #55FF55;
    padding: 0.4em 1em;
    font-size: 0.85em;
    transition: background-color 0.2s, color 0.2s;
}

.error-link:hover {
    background-color: #55FF55;
    color: #000000;
}

/* ================================================================
   Couleurs texte utilitaires
   ================================================================ */

.crt-text-green {
    color: #55FF55;
    margin-bottom: 0.5em;
}

.crt-text-amber {
    color: #FFB000;
    margin-bottom: 0.5em;
}

.crt-text-amber-dim {
    color: #996600;
    margin-bottom: 0.5em;
    font-family: "Noto Naskh Arabic", "Traditional Arabic", serif;
    font-size: 1.125em;
}

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 768px) {
    .tagline {
        font-size: 1.3em;
        letter-spacing: 0.03em;
    }

    /* Pas de glitch sur mobile */
    .tagline.glitch-active::before,
    .tagline.glitch-active::after {
        display: none;
    }

    .tagline.glitch-active {
        animation: none;
    }

    .crt-logo {
        font-size: 0.35em;
    }

    .modem-bar {
        width: 85%;
    }

    .login-btn {
        font-size: 0.75em;
        padding: 0.6em 1.4em;
    }
}
