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

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:     #0c1a25;
    --bg2:    #0f2233;
    --accent: #e8304a;
    --text:   #f0f0f0;
    --muted:  #8aa5bb;
    --border: rgba(255,255,255,0.1);
    --radius: 20px;
}

html, body {
    height: 100%;
    font-family: 'Barlow', sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
}

/* subtle grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.login-screen {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    gap: 24px;
}

/* -- Logo ------------------------------------------------------ */
.login-logo-wrap { display: flex; justify-content: center; }
.login-logo { height: 80px; object-fit: contain; filter: drop-shadow(0 4px 24px rgba(232,48,74,0.3)); }

/* -- Panel ----------------------------------------------------- */
.login-panel {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.login-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
}

.login-sub {
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    line-height: 1.55;
}

.login-hint {
    font-size: 12px;
    color: rgba(255,255,255,0.2);
    text-align: center;
    margin-top: -4px;
}

/* -- Input ----------------------------------------------------- */
.login-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: 'Barlow', sans-serif;
    font-size: 18px;
    font-weight: 600;
    padding: 14px 18px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
    letter-spacing: 0.02em;
    -webkit-appearance: none;
}
.login-input::placeholder { color: rgba(255,255,255,0.2); font-weight: 400; }
.login-input:focus { border-color: var(--accent); background: rgba(232,48,74,0.06); }
.login-input.input-error { border-color: var(--accent); animation: shake 0.3s ease; }

@keyframes shake {
    0%,100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

/* -- Buttons --------------------------------------------------- */
.login-btn {
    width: 100%;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: 'Barlow', sans-serif;
    font-size: 17px;
    font-weight: 700;
    padding: 15px;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    letter-spacing: 0.03em;
    min-height: 52px;
}
.login-btn:active { transform: scale(0.97); }

.login-btn-ghost {
    background: transparent;
    border: none;
    color: var(--muted);
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px;
    margin-top: -4px;
}

/* -- Error ----------------------------------------------------- */
.login-error {
    width: 100%;
    background: rgba(232,48,74,0.1);
    border: 1px solid rgba(232,48,74,0.3);
    border-radius: 10px;
    color: #ff8a96;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 14px;
    text-align: center;
}

/* -- Waiting --------------------------------------------------- */
.waiting-icon { font-size: 48px; }

.waiting-name {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 6px 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.waiting-dots {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    height: 20px;
}
.waiting-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: bounce 1.2s infinite ease-in-out;
}
.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%,80%,100% { transform: scale(0.6); opacity: 0.4; }
    40%          { transform: scale(1);   opacity: 1; }
}

/* -- Labels & Register Link ------------------------------------ */
.login-label {
    width: 100%;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: -8px;
    text-align: left;
}

.login-register-link {
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    margin-top: -4px;
    transition: color 0.15s;
}
.login-register-link:hover { color: var(--text); }

.success-icon { font-size: 48px; }