/* ==========================================================================
   SMART KILLER — page de connexion « dossier classifié »
   Feuille autonome (ne dépend pas de css/style.css)
   Thème : espionnage / mission impossible / laboratoire
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Share+Tech+Mono&display=swap');

:root {
    --sk-red: #e74c3c;
    --sk-red-deep: #8e1509;
    --sk-green: #7dffa7;
    --sk-panel: rgba(8, 11, 13, 0.88);
    --sk-line: #2b3a3d;
    --sk-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body.login-page {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 4vw, 40px);
    font-family: 'Oswald', sans-serif;
    color: #e0e0e0;
    background:
        radial-gradient(circle at 50% 30%, #223032 0%, #10181a 45%, #05090a 100%);
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Fond animé : grille de laboratoire + radar + scanlines
   -------------------------------------------------------------------------- */

.spy-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.spy-bg .grid {
    position: absolute;
    inset: -60px;
    background-image:
        linear-gradient(rgba(125, 255, 167, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 255, 167, 0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    animation: grid-pan 30s linear infinite;
}

@keyframes grid-pan {
    from { transform: translate(0, 0); }
    to   { transform: translate(48px, 48px); }
}

.spy-bg .radar {
    position: absolute;
    right: -18vmin;
    bottom: -18vmin;
    width: 70vmin;
    height: 70vmin;
    border-radius: 50%;
    border: 1px solid rgba(125, 255, 167, 0.15);
    box-shadow: inset 0 0 0 1px rgba(125, 255, 167, 0.05);
    background:
        repeating-radial-gradient(circle at center,
            transparent 0 23%,
            rgba(125, 255, 167, 0.07) 23% 23.5%,
            transparent 23.5% 48%,
            rgba(125, 255, 167, 0.07) 48% 48.5%,
            transparent 48.5% 73%,
            rgba(125, 255, 167, 0.07) 73% 73.5%,
            transparent 73.5%);
    opacity: 0.7;
}

.spy-bg .radar::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
        rgba(125, 255, 167, 0.35) 0deg,
        rgba(125, 255, 167, 0.08) 40deg,
        transparent 70deg,
        transparent 360deg);
    animation: radar-sweep 5s linear infinite;
}

@keyframes radar-sweep {
    to { transform: rotate(360deg); }
}

.spy-bg .scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0 2px,
        rgba(0, 0, 0, 0.22) 3px,
        transparent 4px);
    opacity: 0.4;
    animation: scan-roll 10s linear infinite;
}

@keyframes scan-roll {
    to { background-position: 0 120px; }
}

/* Pulsation d'alerte rouge très discrète sur les bords */
.spy-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center,
        transparent 60%,
        rgba(142, 21, 9, 0.25) 100%);
    animation: alert-pulse 6s ease-in-out infinite;
}

@keyframes alert-pulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Carte « dossier » centrale
   -------------------------------------------------------------------------- */

.login-card {
    position: relative;
    z-index: 1;
    width: min(94vw, 480px);
    padding: clamp(18px, 5vw, 36px);
    background: var(--sk-panel);
    border: 1px solid var(--sk-line);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    clip-path: polygon(
        18px 0, calc(100% - 18px) 0, 100% 18px,
        100% calc(100% - 18px), calc(100% - 18px) 100%,
        18px 100%, 0 calc(100% - 18px), 0 18px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
    text-align: center;
    animation: card-in 0.9s var(--sk-ease) both;
    overflow: hidden;
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(36px) scale(0.97);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

/* Laser qui balaie la carte périodiquement */
.login-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -4px;
    height: 3px;
    background: linear-gradient(90deg,
        transparent, rgba(231, 76, 60, 0.9), #fff, rgba(231, 76, 60, 0.9), transparent);
    box-shadow: 0 0 14px rgba(231, 76, 60, 0.8);
    animation: laser-scan 7s var(--sk-ease) infinite;
    pointer-events: none;
}

@keyframes laser-scan {
    0%, 55%  { top: -4px; opacity: 0; }
    60%      { opacity: 1; }
    85%      { top: 100%; opacity: 1; }
    86%, 100% { top: 100%; opacity: 0; }
}

/* Coins « viseur » animés */
.corner {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 2px solid var(--sk-green);
    opacity: 0.75;
    animation: corner-pulse 2.4s ease-in-out infinite;
    pointer-events: none;
}

.c-tl { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.c-tr { top: 8px; right: 8px; border-left: none; border-bottom: none; }
.c-bl { bottom: 8px; left: 8px; border-right: none; border-top: none; }
.c-br { bottom: 8px; right: 8px; border-left: none; border-top: none; }

@keyframes corner-pulse {
    0%, 100% { opacity: 0.35; }
    50%      { opacity: 0.95; }
}

/* Tampon TOP SECRET */
.stamp {
    position: absolute;
    top: 16px;
    right: -6px;
    padding: 4px 12px;
    border: 3px double var(--sk-red);
    border-radius: 4px;
    color: var(--sk-red);
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: clamp(12px, 3.2vw, 16px);
    letter-spacing: 3px;
    text-transform: uppercase;
    transform: rotate(9deg);
    opacity: 0.9;
    animation: stamp-in 0.45s 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    pointer-events: none;
}

@keyframes stamp-in {
    from { transform: rotate(25deg) scale(3); opacity: 0; }
    to   { transform: rotate(9deg) scale(1); opacity: 0.9; }
}

/* Logo : apparition en « flicker » de néon */
.logo-login {
    width: min(62%, 240px);
    margin: 10px auto 4px;
    display: block;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.8));
    animation: logo-flicker 1.6s steps(1) 0.2s both;
}

@keyframes logo-flicker {
    0%   { opacity: 0; }
    8%   { opacity: 1; }
    12%  { opacity: 0.2; }
    18%  { opacity: 1; }
    26%  { opacity: 0.4; }
    34%, 100% { opacity: 1; }
}

/* Ligne « machine à écrire » de terminal */
.type-line {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    color: var(--sk-green);
    font-size: clamp(11px, 3vw, 15px);
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    /* 38 caractères + 1px de letter-spacing chacun */
    width: calc(38ch + 38px);
    max-width: 100%;
    margin: 10px auto 16px;
    border-right: 2px solid var(--sk-green);
    animation:
        typing 2.6s steps(38) 0.9s both,
        caret-blink 0.8s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to   { width: calc(38ch + 38px); }
}

@keyframes caret-blink {
    0%, 100% { border-color: var(--sk-green); }
    50%      { border-color: transparent; }
}

/* Briefing de mission */
.infotexte {
    position: relative;
    margin: 14px 0 18px;
    padding: 26px 16px 12px;
    text-align: left;
    background: rgba(0, 0, 0, 0.55);
    border-left: 3px solid var(--sk-red);
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: clamp(12px, 3.4vw, 14px);
    line-height: 1.55;
    color: #c9d4cd;
    animation: fade-up 0.8s 1.4s var(--sk-ease) both;
}

.infotexte::before {
    content: "◉ BRIEFING DE MISSION";
    position: absolute;
    top: 6px;
    left: 16px;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--sk-red);
}

.login-help {
    font-size: clamp(13px, 3.6vw, 16px);
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #9fb4a6;
    margin: 6px 0 12px;
    animation: fade-up 0.8s 1.6s var(--sk-ease) both;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Formulaire terminal
   -------------------------------------------------------------------------- */

.form-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fade-up 0.8s 1.8s var(--sk-ease) both;
}

.form-login input {
    width: 100%;
    padding: 13px 16px;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: clamp(14px, 4vw, 16px);
    text-align: center;
    color: var(--sk-green);
    caret-color: var(--sk-green);
    background: #05080a;
    border: 1px solid var(--sk-line);
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s var(--sk-ease);
}

.form-login input::placeholder {
    color: #4e6157;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-login input:focus {
    border-color: var(--sk-green);
    box-shadow:
        0 0 0 1px rgba(125, 255, 167, 0.4),
        0 0 18px rgba(125, 255, 167, 0.25),
        inset 0 0 12px rgba(125, 255, 167, 0.08);
    transform: scale(1.015);
}

/* Boutons */
button {
    cursor: pointer;
    border: none;
    border-radius: 4px;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.form-login button[type="submit"] {
    position: relative;
    overflow: hidden;
    padding: 14px 18px;
    font-size: clamp(15px, 4.2vw, 18px);
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #c0392b, var(--sk-red-deep));
    border: 1px solid rgba(231, 76, 60, 0.6);
    transition: transform 0.3s var(--sk-ease), box-shadow 0.3s var(--sk-ease), filter 0.3s;
    animation: btn-pulse 3s ease-in-out infinite;
}

@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(231, 76, 60, 0); }
    50%      { box-shadow: 0 0 20px rgba(231, 76, 60, 0.5); }
}

.form-login button[type="submit"]::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,
        transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
    transform: translateX(-130%);
    animation: btn-shine 4s var(--sk-ease) infinite;
}

@keyframes btn-shine {
    0%, 55%   { transform: translateX(-130%); }
    75%, 100% { transform: translateX(130%); }
}

.form-login button[type="submit"]:hover,
.form-login button[type="submit"]:focus-visible {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.15);
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.6),
        0 0 26px rgba(231, 76, 60, 0.8);
}

.form-login button[type="submit"]:active {
    transform: scale(0.98);
}

#register-button {
    width: 100%;
    margin: 4px 0 10px;
    padding: 11px 14px;
    font-size: clamp(12px, 3.4vw, 14px);
    font-weight: 500;
    color: var(--sk-green);
    background: transparent;
    border: 1px dashed rgba(125, 255, 167, 0.5);
    transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--sk-ease);
    animation: fade-up 0.8s 1.7s var(--sk-ease) both;
}

#register-button:hover,
#register-button:focus-visible {
    background: rgba(125, 255, 167, 0.1);
    border-color: var(--sk-green);
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Accessibilité + grands écrans
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .type-line { width: 38ch; }
}

@media (min-width: 900px) {
    .login-card {
        width: 500px;
    }
}
