/* ==========================================================================
   SFCSS Alumni — Login Page Design System
   Inspired by Facebook's emotional clarity + alumni community warmth
   Palette: Navy #0f3d56 · Gold #c38b4d · Warm #d4a574
   ========================================================================== */

/* ── 1. PAGE SHELL ── */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
    overflow-x: hidden;
}

.login-main {
    flex: 1;
    display: flex;
    align-items: stretch;
}

/* ── 2. LEFT PANEL — EMOTIONAL BRANDING ── */
.login-brand {
    flex: 1;
    background:
        linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 45%, var(--primary-light) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 3.5rem;
    position: relative;
    overflow: hidden;
}

/* Subtle school crest watermark */
.login-brand::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -8%;
    width: 500px;
    height: 500px;
    background:
        radial-gradient(circle, rgba(195, 139, 77, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-brand::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: -5%;
    width: 380px;
    height: 380px;
    background:
        radial-gradient(circle, rgba(240, 195, 123, 0.06) 0%, transparent 65%);
    border-radius: 50%;
    pointer-events: none;
}

/* Cross pattern (Franciscan motif) */
.brand-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image:
        linear-gradient(45deg, #fff 25%, transparent 25%),
        linear-gradient(-45deg, #fff 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #fff 75%),
        linear-gradient(-45deg, transparent 75%, #fff 75%);
    background-size: 60px 60px;
    background-position: 0 0, 0 30px, 30px -30px, -30px 0;
    pointer-events: none;
}

.brand-content {
    position: relative;
    z-index: 2;
    max-width: 520px;
}

/* School badge */
.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

.brand-badge i {
    color: var(--accent);
    font-size: 0.75rem;
}

/* Headline */
.brand-headline {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

.brand-headline .highlight {
    color: var(--accent);
    position: relative;
}

.brand-headline .highlight::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 100%;
    height: 3px;
    background: var(--accent);
    opacity: 0.4;
    border-radius: 2px;
}

/* Subtext */
.brand-subtext {
    font-size: 1.1rem;
    line-height: 1.65;
    opacity: 0.85;
    margin-bottom: 2.5rem;
    max-width: 440px;
}

/* ── 3. STATS BAR ── */
.brand-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.stat-item {
    text-align: left;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.25rem;
    display: block;
}

.stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.7;
    font-weight: 500;
}

/* ── 4. ALUMNI FACES COLLAGE ── */
.alumni-faces {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 1.5rem;
}

.alumni-face {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    margin-left: -10px;
    transition: transform 0.3s ease, border-color 0.3s ease;
    position: relative;
    background: var(--primary-light);
}

.alumni-face:first-child {
    margin-left: 0;
}

.alumni-face:hover {
    transform: translateY(-3px) scale(1.1);
    border-color: var(--accent);
    z-index: 2;
}

.alumni-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.alumni-face-count {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    border: 3px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: -10px;
    color: rgba(255, 255, 255, 0.9);
}

.faces-label {
    font-size: 0.85rem;
    opacity: 0.75;
    margin-left: 0.75rem;
    line-height: 1.3;
}

/* ── 5. TRUST SIGNALS ── */
.trust-signals {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.7;
    font-weight: 500;
}

.trust-item i {
    color: var(--accent);
    font-size: 0.7rem;
    width: 16px;
    text-align: center;
}

/* ── 6. RIGHT PANEL — LOGIN FORM ── */
.login-form-panel {
    width: 480px;
    min-width: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 3.5rem;
    background: var(--bg-surface);
    position: relative;
}

/* Vertical accent line */
.login-form-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(
        to bottom,
        var(--primary) 0%,
        var(--secondary) 50%,
        var(--accent) 100%
    );
}

.form-header {
    margin-bottom: 2rem;
}

.form-greeting {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.form-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Form icon (for password reset, etc.) */
.form-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(15, 61, 86, 0.1), rgba(15, 61, 86, 0.05));
    border: 2px solid rgba(15, 61, 86, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.form-icon i {
    font-size: 1.6rem;
    color: var(--primary);
}

/* Success message */
.success-message {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.success-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.success-icon i {
    color: #fff;
    font-size: 1.1rem;
}

.success-content {
    flex: 1;
}

.success-content strong {
    display: block;
    color: #166534;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.success-content p {
    color: #15803d;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

/* Form switch link (alternative to main action) */
.form-switch-link {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.form-switch-link a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.form-switch-link a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ── 7. FORM ELEMENTS ── */
.login-form .field-group {
    margin-bottom: 1.25rem;
}

.login-form .field-label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
}

.login-form .field-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    background: var(--bg-inset);
    color: var(--text-primary);
    transition: all 0.25s ease;
    outline: none;
}

.login-form .field-input::placeholder {
    color: var(--text-faint);
}

.login-form .field-input:focus {
    border-color: var(--primary-light);
    background: var(--bg-surface);
    box-shadow: 0 0 0 4px rgba(15, 61, 86, 0.08);
}

.login-form .field-input.is-invalid {
    border-color: #dc3545;
    background: #fff5f5;
}

.login-form .field-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.08);
}

/* Password wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper .field-input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--bg-muted);
}

/* Error message */
.field-error {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fdf2f2;
    border: 1px solid #fde8e8;
    border-radius: 8px;
    color: #9b1c1c;
    font-size: 0.82rem;
    line-height: 1.4;
}

.field-error i {
    margin-top: 2px;
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* ── 8. REMEMBER + FORGOT ROW ── */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.remember-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.remember-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-strong);
    border-radius: 5px;
    cursor: pointer;
    accent-color: var(--primary);
    transition: all 0.2s ease;
}

.remember-check input[type="checkbox"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.remember-check span {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
    user-select: none;
}

.forgot-link {
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: var(--secondary-dark);
    text-decoration: underline;
}

/* ── 9. PRIMARY CTA ── */
.login-btn {
    width: 100%;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(15, 61, 86, 0.25);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 61, 86, 0.35);
}

.login-btn:hover::before {
    opacity: 1;
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(15, 61, 86, 0.2);
}

/* Loading state */
.login-btn.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.login-btn.is-loading .btn-text {
    visibility: hidden;
}

.login-btn.is-loading .btn-spinner {
    display: block;
}

.btn-spinner {
    display: none;
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ── 10. DIVIDER ── */
.form-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-faint);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ── 11. SECONDARY CTA — SUBMIT PROFILE ── */
.submit-profile-btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
    border: 2px solid var(--secondary);
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: transparent;
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.submit-profile-btn:hover {
    background: var(--secondary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(195, 139, 77, 0.25);
}

.submit-profile-btn:active {
    transform: translateY(0);
}

.submit-profile-hint {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    line-height: 1.4;
}

/* ── 12. FORM FOOTER ── */
.form-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-footer a {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.form-footer a:hover {
    color: var(--primary);
}

.form-footer .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-faint);
}

/* ── 13. MOBILE BOTTOM BAR (VISIBLE < 768px) ── */
.login-mobile-bar {
    display: none;
    padding: 1rem 1.5rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.login-mobile-bar p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── 14. TESTIMONIAL ── */
.brand-testimonial {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.testimonial-quote {
    font-size: 0.92rem;
    line-height: 1.6;
    font-style: italic;
    opacity: 0.9;
    margin-bottom: 0.75rem;
}

.testimonial-quote::before {
    content: '\201C';
    font-size: 2rem;
    font-style: normal;
    color: var(--accent);
    opacity: 0.5;
    line-height: 0;
    position: relative;
    top: 10px;
    margin-right: 4px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.testimonial-author .author-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.testimonial-author span {
    opacity: 0.7;
    font-weight: 400;
}

/* ── 15. ANIMATIONS ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.anim-up-1 { animation: fadeInUp 0.7s ease 0.1s backwards; }
.anim-up-2 { animation: fadeInUp 0.7s ease 0.2s backwards; }
.anim-up-3 { animation: fadeInUp 0.7s ease 0.3s backwards; }
.anim-up-4 { animation: fadeInUp 0.7s ease 0.4s backwards; }
.anim-up-5 { animation: fadeInUp 0.7s ease 0.5s backwards; }
.anim-up-6 { animation: fadeInUp 0.7s ease 0.6s backwards; }
.anim-up-7 { animation: fadeInUp 0.7s ease 0.7s backwards; }
.anim-up-8 { animation: fadeInUp 0.7s ease 0.8s backwards; }
.anim-fade  { animation: fadeIn  0.8s ease 0.3s backwards; }

/* ── 16. TOP BAR & THEME TOGGLE ── */
.form-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.login-home-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-inset);
    transition: all 0.2s ease;
}

.login-home-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--bg-surface-hover);
    text-decoration: none;
}

.login-theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-inset);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.login-theme-toggle:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* ── 17. DARK MODE ── */
[data-theme="dark"] .login-brand {
    background: linear-gradient(160deg, #050a12 0%, var(--primary-dark) 45%, var(--primary) 100%);
}

[data-theme="dark"] .login-form-panel {
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
}

[data-theme="dark"] .login-form-panel::before {
    opacity: 0.6;
}

[data-theme="dark"] .field-input {
    background: var(--bg-surface-hover);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .field-input:focus {
    background: var(--bg-surface);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(30, 94, 123, 0.15);
}

[data-theme="dark"] .field-input.is-invalid {
    background: rgba(220, 53, 69, 0.08);
    border-color: #dc3545;
}

[data-theme="dark"] .field-error {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
    color: #fca5a5;
}

[data-theme="dark"] .login-btn {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

[data-theme="dark"] .submit-profile-btn {
    border-color: var(--secondary);
    color: var(--accent);
}

[data-theme="dark"] .submit-profile-btn:hover {
    background: var(--secondary);
    color: #fff;
}

[data-theme="dark"] .form-divider::before,
[data-theme="dark"] .form-divider::after {
    background: var(--border-color);
}

[data-theme="dark"] .remember-check input[type="checkbox"] {
    border-color: var(--border-color);
    background: var(--bg-surface-hover);
}

[data-theme="dark"] .brand-badge {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ── 18. RESPONSIVE — TABLET (≤991px) ── */
@media (max-width: 991px) {
    .login-main {
        flex-direction: column;
    }

    .login-brand {
        padding: 3rem 2rem 2.5rem;
        min-height: auto;
    }

    .brand-content {
        max-width: 600px;
        margin: 0 auto;
    }

    .brand-headline {
        font-size: 1.9rem;
    }

    .brand-subtext {
        margin-bottom: 1.75rem;
    }

    .login-form-panel {
        width: 100%;
        min-width: auto;
        padding: 2.5rem 2rem;
    }

    .login-form-panel::before {
        width: 100%;
        height: 4px;
        left: 0;
        top: 0;
    }

    .brand-testimonial {
        display: none;
    }
}

/* ── 19. RESPONSIVE — MOBILE (≤576px) ── */
@media (max-width: 576px) {
    .login-brand {
        padding: 2.5rem 1.25rem 2rem;
    }

    .brand-badge {
        font-size: 0.7rem;
        padding: 0.4rem 0.85rem;
        margin-bottom: 1.25rem;
    }

    .brand-headline {
        font-size: 1.55rem;
    }

    .brand-subtext {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .brand-stats {
        gap: 1.25rem;
        margin-bottom: 1.75rem;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .alumni-face {
        width: 38px;
        height: 38px;
    }

    .alumni-face-count {
        width: 38px;
        height: 38px;
        font-size: 0.65rem;
    }

    .trust-signals {
        gap: 0.75rem;
    }

    .login-form-panel {
        padding: 2rem 1.25rem;
    }

    .form-title {
        font-size: 1.45rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .login-mobile-bar {
        display: block;
    }
}

/* ── 20. REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
    .anim-up-1, .anim-up-2, .anim-up-3, .anim-up-4,
    .anim-up-5, .anim-up-6, .anim-up-7, .anim-up-8,
    .anim-fade {
        animation: none !important;
    }

    .login-btn:hover,
    .submit-profile-btn:hover,
    .alumni-face:hover {
        transform: none !important;
    }
}
