/* ============================================================
   Auth Pages â€?Login / Register
   Two-column split layout: brand side (purple gradient) + form side
   ============================================================ */

.auth-page {
    background: var(--bg-light);
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: stretch;
    padding: 32px var(--gutter);
}

/* Two-column container â€?centered card with shadow */
.auth-container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 100%;
    min-height: 580px;
    border: 1px solid var(--gray-200);
}

/* ===== Left brand column ===== */
.auth-side {
    background: linear-gradient(135deg, var(--primary-800) 0%, var(--primary-600) 50%, var(--primary-700) 100%);
    color: var(--white);
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.auth-side::before {
    content: '';
    position: absolute;
    top: -100px; right: -100px;
    width: 300px; height: 300px;
    background: var(--primary-400);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    pointer-events: none;
}
.auth-side::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -80px;
    width: 240px; height: 240px;
    background: var(--primary-300);
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.25;
    pointer-events: none;
}
.auth-side > * { position: relative; z-index: 1; }

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-weight: 600;
    font-size: 1.125rem;
    text-decoration: none;
    margin-bottom: 32px;
    border-bottom: none;
}
.auth-logo:hover { color: var(--white); border-color: transparent; }
.auth-logo img {
    width: 40px; height: 40px;
    border-radius: var(--radius);
    object-fit: cover;
}

.auth-side-title {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.auth-side-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 360px;
}
.auth-side-list {
    list-style: none;
    padding: 0; margin: 0 0 24px;
    max-width: 360px;
}
.auth-side-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.92);
}
.auth-side-list .check-icon {
    width: 20px; height: 20px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 0.6875rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.auth-side-foot {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}
.auth-side-foot a {
    color: var(--white);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}
.auth-side-foot a:hover { color: var(--white); border-color: var(--white); }

/* ===== Right form column ===== */
.auth-form-wrap {
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-height: 100%;
    overflow-y: auto;
}
.auth-form-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.auth-form-sub {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 24px;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 20px;
    line-height: 1.5;
}
.auth-alert.is-error {
    background: var(--error-50);
    color: #991B1B;
    border-left: 3px solid var(--error-600);
}
.auth-alert.is-success {
    background: var(--success-50);
    color: #065F46;
    border-left: 3px solid var(--success-600);
}
.auth-alert .alert-icon {
    width: 20px; height: 20px;
    background: var(--error-600);
    color: var(--white);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.auth-alert.is-success .alert-icon { background: var(--success-600); }

/* Form inputs */
.auth-form .form-group { margin-bottom: 18px; }
.auth-form label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
    font-family: var(--font-sans);
    letter-spacing: 0;
}
.auth-form label .forgot-link {
    font-size: 0.75rem;
    color: var(--primary-700);
    border-bottom: none;
    font-weight: 500;
}
.auth-form label .forgot-link:hover { color: var(--primary-800); border-color: transparent; }
.auth-form .req { color: var(--error-600); margin-left: 2px; }

.input-wrap { position: relative; }
.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--gray-400);
    pointer-events: none;
}
.auth-form .form-control {
    padding-left: 42px;
    height: 46px;
    font-size: 0.9375rem;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.auth-form .form-control.has-error {
    border-color: var(--error-600);
    background: rgba(239, 68, 68, 0.04);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}
.auth-form .form-control.has-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.auth-form select.form-control {
    padding-left: 14px;
}

/* Inline field error message (injected by initAuthForms JS) */
.auth-field-error {
    display: none;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
    padding: 6px 10px;
    background: var(--error-50);
    color: #991B1B;
    border-left: 2px solid var(--error-600);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    line-height: 1.4;
    animation: auth-field-shake 0.3s ease;
}
.auth-field-error::before {
    content: '!';
    width: 16px; height: 16px;
    background: var(--error-600);
    color: var(--white);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6875rem;
    flex-shrink: 0;
}
@keyframes auth-field-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-3px); }
    75%      { transform: translateX(3px); }
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 20px;
    font-size: 0.8125rem;
    color: var(--gray-600);
    cursor: pointer;
}
.checkbox-wrap input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--primary-700);
    cursor: pointer;
}
.checkbox-wrap a { color: var(--primary-700); border-bottom: 1px solid var(--primary-200); }
.checkbox-wrap a:hover { color: var(--primary-800); border-color: var(--primary-500); }

.auth-submit {
    width: 100%;
    margin-top: 8px;
}

.auth-divider {
    text-align: center;
    margin: 20px 0 12px;
    position: relative;
    color: var(--gray-500);
    font-size: 0.8125rem;
}
.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px;
    background: var(--gray-200);
    z-index: 0;
}
.auth-divider span {
    position: relative;
    z-index: 1;
    background: var(--white);
    padding: 0 14px;
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}

.auth-secondary-link {
    display: block;
    text-align: center;
    padding: 10px;
    color: var(--primary-700);
    font-weight: 600;
    border: 1px solid var(--primary-200);
    border-radius: var(--radius);
    background: var(--bg-light);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--t-fast);
}
.auth-secondary-link:hover {
    background: var(--primary-50);
    border-color: var(--primary-500);
    color: var(--primary-800);
}

/* Responsive â€?stack on mobile */
@media (max-width: 900px) {
    .auth-card {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .auth-side {
        padding: 32px 28px;
        min-height: 280px;
    }
    .auth-side-title { font-size: 1.5rem; }
    .auth-side-text, .auth-side-list { display: none; }
    .auth-side-foot { margin-top: 0; }
    .auth-form-wrap { padding: 32px 24px; }
}
@media (max-width: 480px) {
    .auth-page { padding: 16px var(--gutter); }
    .auth-form .form-control { height: 44px; font-size: 0.875rem; }
    .auth-form-title { font-size: 1.25rem; }
}
