/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0f0f23;
    color: #e0e0e0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* === Page layout === */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* === Auth header stack === */
.auth-stack {
    text-align: center;
    margin-bottom: 20px;
}

.auth-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    margin-bottom: 12px;
}

.auth-title {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

/* === Card === */
.card {
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 380px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.4),
        0 1px 3px rgba(0, 0, 0, 0.3);
}

.card-hint {
    font-size: 14px;
    color: #a0a0b0;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.5;
}

.card-hint strong {
    color: #e0e0e0;
}

/* === Form elements === */
input[type="email"],
input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    background: #0f0f23;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type="email"]:focus,
input[type="text"]:focus {
    border-color: #6366f1;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input::placeholder {
    color: #555;
}

.code-input {
    text-align: center;
    font-size: 28px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    letter-spacing: 10px;
    padding: 14px 16px;
}

button[type="submit"] {
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    background: #ffffff;
    color: #0f0f23;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

button[type="submit"]:hover {
    background: #e8e8f0;
}

button[type="submit"]:active {
    transform: scale(0.98);
}

/* === Link button === */
.btn-link {
    background: none;
    border: none;
    color: #818cf8;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.btn-link:hover {
    color: #a5b4fc;
}

.resend-form {
    text-align: center;
    margin-top: 16px;
}

/* === Flash messages === */
.flash-container {
    width: 100%;
    max-width: 380px;
    margin-bottom: 16px;
}

.flash {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 8px;
}

.flash-success {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

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

/* === Dashboard === */
.dashboard {
    width: 100%;
    max-width: 800px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-email {
    font-size: 14px;
    color: #a0a0b0;
}

.btn-logout {
    color: #f87171;
    font-size: 14px;
    text-decoration: none;
}

.btn-logout:hover {
    color: #fca5a5;
}

.dashboard-body {
    padding: 40px;
    background: #1a1a2e;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.dashboard-placeholder {
    color: #a0a0b0;
    font-size: 16px;
}

/* === Mobile === */
@media (max-width: 480px) {
    .page {
        padding: 16px;
    }

    .auth-title {
        font-size: 18px;
    }

    .card {
        padding: 24px;
        border-radius: 12px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .dashboard-body {
        padding: 24px;
    }
}
