:root {
    --primary: #3b82f6;
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    background-image: url('login_background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

#email {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    outline: none;
    transition: border-color 0.2s;
}

#email:focus {
    border-color: var(--primary);
}

button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

button:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    display: none;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

/* ====================================================================
   QR-KOODI KIRJAUTUMISEN TYYLIT
   ==================================================================== */

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #94a3b8;
    font-size: 0.85rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider:not(:empty)::before {
    margin-right: .75em;
}

.divider:not(:empty)::after {
    margin-left: .75em;
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
}

.qr-container {
    display: none; /* Näytetään JS:llä */
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.3s ease-out forwards;
}

.qr-box {
    background: white;
    padding: 16px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    margin-bottom: 1.5rem;
}

.qr-box img {
    display: block;
    width: 180px;
    height: 180px;
}

.qr-desc {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.qr-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.qr-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.qr-code-text {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: white;
    margin-bottom: 1.5rem;
    font-family: 'Outfit', monospace;
    background: rgba(15, 23, 42, 0.4);
    padding: 8px 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    user-select: all; /* Helppo kopioida jos testaa käsin */
}

