:root {
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: #334155;
    --danger: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    /* use dynamic viewport measurement to prevent header loss on mobile */
    height: calc(var(--vh, 1vh) * 100);
    margin: 0;
}

.auth-container {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
}

h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

label {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

input {
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: white;
    font-size: 1rem;
    transition: border-color 0.15s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent);
}

button {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    background-color: var(--accent);
    transition: background-color 0.15s ease, transform 0.1s ease;
    margin-top: 0.5rem;
}

button:hover {
    background-color: var(--accent-hover);
}

button:active {
    transform: scale(0.98);
}

.error {
    background: var(--error-bg);
    color: var(--danger);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid var(--danger);
}

.link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

/* Mobile adjustments */
@media (max-width: 440px) {
    body {
        align-items: flex-start;
        padding-top: 4vh;
    }

    .auth-container {
        padding: 1.25rem;
        border-radius: 8px;
        box-shadow: none;
        width: 92vw;
        max-width: 420px;
        margin: 0 4vw;
    }

    h2 { font-size: 1.1rem; }
    input { font-size: 0.95rem; padding: 0.65rem; }
    button { padding: 0.65rem; font-size: 0.95rem; }
}
