/* ==========================================================================
   QUI EST QUI ? — page de connexion festive
   Feuille autonome (ne dépend pas de css/style.css)
   Thème : jeu de soirée, chaleureux, points d'interrogation flottants
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&display=swap');

:root {
    --qeq-orange: #e44c24;
    --qeq-orange-soft: #f56f3a;
    --qeq-cream: #fff6ec;
    --qeq-brown: #5b2510;
    --qeq-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --qeq-bounce: cubic-bezier(0.34, 1.56, 0.64, 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: 'Comic Neue', 'Comic Sans MS', cursive, sans-serif;
    color: var(--qeq-brown);
    background: linear-gradient(160deg,
        #ba391d 0%, #ec774b 30%, #eaae79 55%, #e44c24 85%, #d20f38 100%);
    background-size: 100% 220%;
    animation: bg-shift 16s ease-in-out infinite alternate;
    overflow-x: hidden;
}

@keyframes bg-shift {
    from { background-position: 50% 0%; }
    to   { background-position: 50% 100%; }
}

/* Halo « spotlight » qui se balade doucement */
body.login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 246, 220, 0.35) 0%, transparent 40%);
    animation: spotlight 14s ease-in-out infinite alternate;
}

@keyframes spotlight {
    0%   { background-position: -20% -10%; }
    100% { background-position: 120% 110%; }
}

/* --------------------------------------------------------------------------
   Points d'interrogation flottants
   -------------------------------------------------------------------------- */

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

.qmarks span {
    position: absolute;
    bottom: -12vh;
    font-weight: 700;
    color: rgba(255, 250, 240, 0.35);
    text-shadow: 0 2px 8px rgba(120, 30, 0, 0.15);
    animation: qfloat linear infinite;
    will-change: transform;
}

.qmarks span:nth-child(1) { left: 6%;  font-size: 8vmin;  animation-duration: 14s; animation-delay: 0s; }
.qmarks span:nth-child(2) { left: 18%; font-size: 5vmin;  animation-duration: 18s; animation-delay: 3s; }
.qmarks span:nth-child(3) { left: 31%; font-size: 11vmin; animation-duration: 21s; animation-delay: 7s; }
.qmarks span:nth-child(4) { left: 47%; font-size: 6vmin;  animation-duration: 15s; animation-delay: 1.5s; }
.qmarks span:nth-child(5) { left: 60%; font-size: 9vmin;  animation-duration: 19s; animation-delay: 5s; }
.qmarks span:nth-child(6) { left: 72%; font-size: 4.5vmin; animation-duration: 13s; animation-delay: 9s; }
.qmarks span:nth-child(7) { left: 83%; font-size: 7vmin;  animation-duration: 17s; animation-delay: 2s; }
.qmarks span:nth-child(8) { left: 92%; font-size: 5.5vmin; animation-duration: 22s; animation-delay: 6s; }

@keyframes qfloat {
    0% {
        transform: translateY(0) rotate(-12deg);
        opacity: 0;
    }
    8% {
        opacity: 1;
    }
    85% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-118vh) rotate(14deg);
        opacity: 0;
    }
}

/* --------------------------------------------------------------------------
   Carte centrale
   -------------------------------------------------------------------------- */

.login-card {
    position: relative;
    z-index: 1;
    width: min(94vw, 440px);
    padding: clamp(18px, 5vw, 34px);
    border: 4px solid transparent;
    border-radius: 26px;
    /* fond crème + liseré dégradé animé (technique padding-box / border-box) */
    background:
        linear-gradient(var(--qeq-cream), var(--qeq-cream)) padding-box,
        linear-gradient(120deg, #ffd9a0, var(--qeq-orange-soft), #d20f38, #ffd9a0) border-box;
    background-size: auto, 300% 300%;
    box-shadow:
        0 24px 60px rgba(90, 20, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    text-align: center;
    animation:
        card-pop 0.7s var(--qeq-bounce) both,
        border-flow 6s linear infinite;
}

@keyframes card-pop {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.82);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes border-flow {
    0%   { background-position: 0 0, 0% 50%; }
    100% { background-position: 0 0, 300% 50%; }
}

/* Logo : arrive en rebond puis flotte doucement */
#logo {
    width: min(88%, 320px);
    display: block;
    margin: 0 auto 6px;
    filter: drop-shadow(0 10px 18px rgba(90, 20, 0, 0.35));
    animation:
        logo-drop 0.9s 0.2s var(--qeq-bounce) both,
        logo-float 5s 1.2s ease-in-out infinite alternate;
}

@keyframes logo-drop {
    from {
        opacity: 0;
        transform: translateY(-60px) rotate(-6deg) scale(0.7);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes logo-float {
    from { transform: translateY(0) rotate(-1deg); }
    to   { transform: translateY(-8px) rotate(1.5deg); }
}

.login-card > p {
    font-size: clamp(15px, 4.2vw, 18px);
    font-weight: 700;
    margin: 10px 0 16px;
    animation: fade-up 0.7s 0.5s var(--qeq-ease) both;
}

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

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

.form-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-login input {
    width: 100%;
    padding: 13px 20px;
    font-family: inherit;
    font-size: clamp(15px, 4.2vw, 17px);
    font-weight: 700;
    text-align: center;
    color: var(--qeq-brown);
    background: #fff;
    border: 2px solid #f0b08a;
    border-radius: 999px;
    outline: none;
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s var(--qeq-bounce);
    animation: fade-up 0.7s 0.6s var(--qeq-ease) both;
}

.form-login input:nth-of-type(2) {
    animation-delay: 0.7s;
}

.form-login input::placeholder {
    color: #c98d67;
    font-weight: 400;
}

.form-login input:focus {
    border-color: var(--qeq-orange);
    box-shadow: 0 0 0 4px rgba(228, 76, 36, 0.25), 0 6px 16px rgba(90, 20, 0, 0.2);
    transform: scale(1.03);
}

/* Boutons */
.form-login button,
#register-button {
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    border: none;
    border-radius: 999px;
}

.form-login button[type="submit"] {
    position: relative;
    overflow: hidden;
    padding: 14px 20px;
    font-size: clamp(16px, 4.6vw, 19px);
    letter-spacing: 1px;
    color: #fff;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--qeq-orange-soft), #d20f38);
    box-shadow: 0 8px 20px rgba(150, 20, 20, 0.4);
    transition: transform 0.3s var(--qeq-bounce), box-shadow 0.3s ease, filter 0.3s;
    animation:
        fade-up 0.7s 0.8s var(--qeq-ease) both,
        btn-wiggle 5s 2s ease-in-out infinite;
}

@keyframes btn-wiggle {
    0%, 90%, 100% { transform: none; }
    92% { transform: rotate(-1.5deg) scale(1.02); }
    94% { transform: rotate(1.5deg) scale(1.02); }
    96% { transform: rotate(-1deg); }
    98% { transform: rotate(1deg); }
}

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

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

.form-login button[type="submit"]:hover,
.form-login button[type="submit"]:focus-visible {
    transform: translateY(-3px) scale(1.04);
    filter: brightness(1.08);
    box-shadow: 0 14px 28px rgba(150, 20, 20, 0.5);
}

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

#register-button {
    padding: 11px 16px;
    font-size: clamp(13px, 3.8vw, 15px);
    color: var(--qeq-orange);
    background: transparent;
    border: 2px dashed rgba(228, 76, 36, 0.5);
    transition: background 0.3s, border-color 0.3s, transform 0.3s var(--qeq-bounce);
    animation: fade-up 0.7s 0.9s var(--qeq-ease) both;
}

#register-button:hover,
#register-button:focus-visible {
    background: rgba(228, 76, 36, 0.1);
    border-color: var(--qeq-orange);
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Accessibilité
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .qmarks { display: none; }
}

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