/**
 * Disney — Player Login
 * Thème : Violet & Or — Nuit féerique
 */

:root {
    --login-bg1: #1a0a3e;
    --login-bg2: #0a0618;
    --login-accent: #c084fc;
    --login-accent2: #7b5ea7;
    --login-gold: #f0c27a;
    --login-glow: rgba(192, 132, 252, 0.3);
    --login-glow2: rgba(192, 132, 252, 0.12);
    --login-text: #f0e6ff;
    --login-muted: rgba(155, 143, 191, 0.6);
    --login-input-bg: rgba(255,255,255,0.06);
    --login-input-border: rgba(255,255,255,0.12);
    --login-btn-from: #7b5ea7;
    --login-btn-to: #c084fc;
    --login-btn-shadow: rgba(192, 132, 252, 0.3);
}

/* === PAGE === */
.page-login {
    background: radial-gradient(ellipse at 50% 0%, var(--login-bg1) 0%, var(--login-bg2) 70%);
    min-height: 100vh; min-height: 100dvh;
    overflow: hidden; position: relative;
}

/* === STARS === */
.stars-container { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.star {
    position: absolute; background: #fff; border-radius: 50%;
    animation: twinkle var(--dur) ease-in-out infinite; opacity: 0;
}
@keyframes twinkle {
    0%,100% { opacity: 0.1; transform: scale(0.8); }
    50% { opacity: var(--brightness, 0.7); transform: scale(1.2); }
}

/* === CONTAINER === */
.login-container {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 100vh; min-height: 100dvh;
    padding: 40px 24px; text-align: center;
}

/* === ICON BLOCK === */
.login-icon-wrap { position: relative; margin-bottom: 16px; }
.login-emoji {
    font-size: 72px; line-height: 1; position: relative; z-index: 2;
    animation: iconFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 28px var(--login-glow));
}
.login-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 140px; height: 140px;
    background: radial-gradient(circle, var(--login-glow2) 0%, transparent 70%);
    border-radius: 50%; animation: pulseGlow 3s ease-in-out infinite;
}
@keyframes iconFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes pulseGlow {
    0%,100%{transform:translate(-50%,-50%) scale(1);opacity:.5}
    50%{transform:translate(-50%,-50%) scale(1.2);opacity:1}
}

/* === SPARKLES === */
.sparkles { position: absolute; inset: 0; pointer-events: none; }
.sparkle {
    position: absolute; top: 50%; left: 50%;
    transform: translate(var(--x), var(--y));
    color: var(--login-gold); font-size: 12px;
    animation: sparkleFade 2s ease-in-out infinite;
    animation-delay: var(--d); opacity: 0;
}
@keyframes sparkleFade {
    0%,100%{opacity:0;transform:translate(var(--x),var(--y)) scale(.5)}
    50%{opacity:1;transform:translate(var(--x),var(--y)) scale(1.2)}
}

/* === TITLE === */
.login-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 2.8rem; font-weight: 700; letter-spacing: 4px;
    background: linear-gradient(135deg, #f0c27a 0%, #fff8e7 40%, #f0c27a 60%, #c68e3c 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    filter: drop-shadow(0 2px 10px rgba(240,194,122,0.3));
    margin-bottom: 4px; animation: fadeUp .8s ease-out .3s both;
}
.login-subtitle {
    font-family: 'Quicksand', sans-serif;
    font-size: .9rem; font-weight: 500;
    color: rgba(192,132,252,0.65); letter-spacing: 4px; text-transform: uppercase;
    margin-bottom: 48px; animation: fadeUp .8s ease-out .5s both;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }

/* === FORM STEP === */
.login-step {
    width: 100%; max-width: 320px;
    animation: fadeUp .6s ease-out .7s both;
}

/* === INPUT === */
.input-group { position: relative; margin-bottom: 16px; }
.input-group input {
    width: 100%; padding: 16px 20px 16px 48px;
    background: var(--login-input-bg);
    border: 1px solid var(--login-input-border); border-radius: 16px;
    color: var(--login-text);
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1rem; font-weight: 500; letter-spacing: 4px; text-align: center;
    transition: all .3s;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.input-group input::placeholder {
    color: var(--login-muted); letter-spacing: 1px; font-size: .95rem;
}
.input-group input:focus {
    outline: none; border-color: rgba(192,132,252,0.45);
    background: rgba(255,255,255,0.09);
    box-shadow: 0 0 0 3px rgba(192,132,252,0.1), 0 8px 32px rgba(0,0,0,0.2);
}
.input-icon {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    font-size: 1.2rem; pointer-events: none;
}

/* === BUTTON === */
.btn-login {
    width: 100%; padding: 16px 24px;
    background: linear-gradient(135deg, var(--login-btn-from), var(--login-btn-to));
    border: none; border-radius: 16px; color: #fff;
    font-family: 'Quicksand', sans-serif; font-size: 1.1rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all .3s;
    box-shadow: 0 4px 24px var(--login-btn-shadow);
    position: relative; overflow: hidden;
}
.btn-login::before {
    content: ''; position: absolute; inset: -50%; width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,.1) 50%, transparent 60%);
    transform: rotate(45deg); animation: btnShimmer 3s ease-in-out infinite;
}
@keyframes btnShimmer { 0%{transform:rotate(45deg) translateX(-100%)} 100%{transform:rotate(45deg) translateX(100%)} }
.btn-login:active { transform: scale(.97); }
.btn-login.loading { pointer-events: none; opacity: .7; }
.btn-icon { font-size: 1.2rem; }

/* === ERROR === */
.login-error {
    margin-top: 12px; padding: 10px 16px;
    background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.2);
    border-radius: 12px; color: #fca5a5;
    font-family: 'Quicksand', sans-serif; font-size: .85rem; font-weight: 500;
    animation: shake .4s ease-out;
}
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }

/* === PLAYER SELECT === */
.step-heading {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.15rem; font-weight: 600;
    color: rgba(240,230,255,0.9); margin-bottom: 24px; letter-spacing: 1px;
}
.player-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.player-card {
    background: rgba(255,255,255,0.04); border: 2px solid rgba(255,255,255,0.08);
    border-radius: 20px; padding: 24px 12px; cursor: pointer;
    transition: all .3s; text-align: center;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    animation: cardIn .4s ease-out both;
}
.player-card:nth-child(1){animation-delay:.05s} .player-card:nth-child(2){animation-delay:.12s}
.player-card:nth-child(3){animation-delay:.19s} .player-card:nth-child(4){animation-delay:.26s}
.player-card:hover, .player-card:active {
    border-color: var(--c, rgba(192,132,252,0.5));
    background: rgba(255,255,255,0.07); transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.player-avatar {
    width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    border: 2px solid var(--c, rgba(255,255,255,0.15));
}
.player-avatar img { width:100%; height:100%; border-radius:50%; object-fit:cover; }
.player-name {
    font-family: 'Quicksand', sans-serif;
    font-size: .95rem; font-weight: 700; color: #f0e6ff;
}
@keyframes cardIn { from{opacity:0;transform:scale(.9) translateY(10px)} to{opacity:1;transform:scale(1) translateY(0)} }

/* === TRANSITIONS === */
.login-step.step-exit { animation: stepOut .3s ease-in forwards; }
@keyframes stepOut { to { opacity:0; transform:translateY(-15px); } }
.login-step.step-enter { animation: fadeUp .4s ease-out .15s both; }
