/* ============================================================
   login.css  --  Login / Register page styles
   ============================================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    padding: 2rem;
}

/* --- Card --- */
.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    animation: fadeIn 0.4s ease;
}

/* --- Brand header --- */
.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand .logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent) 0%, #ff4500 100%);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.login-brand h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.login-brand h1 span {
    color: var(--accent);
}

.login-brand .slogan {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* --- Form panel visibility --- */
.form-panel {
    display: none;
}

.form-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* --- Form title --- */
.form-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-primary);
}

/* --- Select (dropdown) --- */
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a0b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* --- Submit button (full width) --- */
.btn-submit {
    width: 100%;
    padding: 0.85rem;
    margin-top: 0.5rem;
    font-size: 1rem;
}

/* --- Toggle link --- */
.toggle-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.toggle-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

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

/* --- Alert messages --- */
.login-alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}

.login-alert.show {
    display: flex;
}

.login-alert.error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.login-alert.success {
    background: rgba(0, 214, 143, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

/* --- Loading spinner on button --- */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-submit .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-submit.loading .spinner {
    display: inline-block;
}

.btn-submit.loading .btn-label {
    display: none;
}

/* --- Row layout for two fields side by side --- */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* --- Responsive --- */
@media (max-width: 500px) {
    .login-card {
        padding: 1.75rem 1.5rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}
