/* Login Page Styles - Modern Fintech Split-Screen Design */

/* ===== LOGIN COLOR VARIABLES ===== */
:root {
    --login-dark: #0a1628;
    --login-dark-mid: #0f2744;
    --login-accent: #1e4080;
    --login-highlight: #3b82f6;
    --login-glow: rgba(59, 130, 246, 0.15);
    --login-gradient: linear-gradient(135deg, #0a1628 0%, #0f2744 50%, #162d50 100%);
}

/* ===== SPLIT-SCREEN LOGIN SECTION ===== */
.login-section {
    min-height: 100vh;
    display: flex;
    background: var(--background-light);
    position: relative;
}


/* ===== BRAND PANEL (Left Side) ===== */
.login-brand-panel {
    flex: 0 0 50%;
    max-width: 50%;
    background: var(--login-gradient);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

/* 3D Grid Background (Vertical) */
.login-grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image: url('assets/images/abstract-3d-architecture-grid-lines-vector-design.png');
    background-size: 180%;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.12;
    transform: rotate(90deg) translateY(25%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,1) 15%, rgba(0,0,0,1) 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,1) 15%, rgba(0,0,0,1) 85%, transparent 100%);
}

/* Decorative Orbs */
.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.login-orb-1 {
    width: 300px;
    height: 300px;
    background: rgba(59, 130, 246, 0.15);
    top: 10%;
    left: -10%;
}

.login-orb-2 {
    width: 200px;
    height: 200px;
    background: rgba(30, 64, 128, 0.2);
    bottom: 20%;
    right: -5%;
}

.login-orb-3 {
    width: 150px;
    height: 150px;
    background: rgba(59, 130, 246, 0.1);
    top: 50%;
    left: 30%;
}

/* Brand Content */
.login-brand-content {
    position: relative;
    z-index: 1;
    max-width: 400px;
    padding-top: 4rem;
}

/* Desktop logo inside brand content */
.login-desktop-logo {
    margin-bottom: 2rem;
}

.login-desktop-logo a {
    display: inline-block;
}

.login-desktop-logo img {
    height: 40px;
    width: auto;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.login-desktop-logo a:hover img {
    opacity: 0.85;
    transform: translateY(-2px);
}

/* Brand Logo in top left */
.login-brand-logo {
    margin-bottom: 2rem;
}

.login-brand-logo img {
    height: 40px;
    width: auto;
}

.login-brand-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.login-brand-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* Feature List on Brand Panel */
.login-features {
    list-style: none;
    padding: 0;
    margin: 0 0 3rem 1.5rem;
}

.login-feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease;
}

.login-feature-item:last-child {
    border-bottom: none;
}

.login-feature-item:hover {
    transform: translateX(4px);
}

.login-feature-icon {
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-feature-icon i {
    font-size: 1rem;
    color: var(--login-highlight);
}

.login-feature-text {
    display: flex;
    flex-direction: column;
}

.login-feature-text strong {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.login-feature-text span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

/* Security Badge on Brand Panel */
.login-security-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-security-badge i {
    font-size: 1.25rem;
    color: var(--login-highlight);
}

.login-security-badge span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ===== FORM PANEL (Right Side) ===== */
.login-form-panel {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--white);
    min-height: 100vh;
    position: relative;
}

.login-form-container {
    width: 100%;
    max-width: 420px;
}

/* ===== LOGIN CARD (inside form panel) ===== */
.login-card {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

.login-header {
    text-align: left;
    margin-bottom: 2rem;
    padding-top: 4rem;
}

.login-icon {
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
    color: var(--white);
    width: 56px;
    height: 56px;
    background: var(--login-dark);
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
}

.login-content {
    margin-top: 0;
}

/* ===== LOGIN TABS ===== */
.login-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.75rem;
    gap: 0;
}

.login-tabs .tab-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.25s ease;
    position: relative;
}

.login-tabs .tab-btn:hover {
    color: var(--text-dark);
    background: var(--background-light);
}

.login-tabs .tab-btn.active {
    color: var(--login-dark);
}

.login-tabs .tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--login-dark);
}

.login-tabs .tab-btn i {
    margin-right: 0.5rem;
}

/* Tab Panels */
.tab-panels-container {
    min-height: 280px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ===== FORM ELEMENTS ===== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.login-form label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-form input {
    padding: 1rem 1.125rem;
    background: var(--background-light);
    border: 2px solid transparent;
    border-radius: 0;
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.25s ease;
}

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

.login-form input:focus {
    outline: none;
    background: var(--white);
    border-color: var(--login-dark);
    box-shadow: 0 0 0 4px var(--login-glow);
}

/* Input validation error state */
.login-form input.input-error {
    border-color: var(--status-danger);
    box-shadow: 0 0 0 4px rgba(139, 58, 58, 0.1);
}

.login-form input.input-error:focus {
    border-color: var(--status-danger);
    box-shadow: 0 0 0 4px rgba(139, 58, 58, 0.15);
}

/* Validation error message */
.field-error {
    color: var(--status-danger);
    font-size: 0.85rem;
    margin-top: 0.35rem;
    display: none;
}

.field-error.show {
    display: block;
}

/* Form Options (Remember me & Forgot password) */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--login-dark);
}

.forgot-password {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.forgot-password::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--login-highlight);
    border-radius: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.forgot-password:hover {
    color: var(--login-dark);
}

.forgot-password:hover::before {
    opacity: 1;
}

/* Primary Button */
.login-form .btn-primary {
    margin-top: 0.75rem;
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    background: var(--login-dark);
    border: none;
    border-radius: 0;
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    position: relative;
    overflow: hidden;
}

.login-form .btn-primary:hover {
    background: var(--login-dark-mid);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(10, 22, 40, 0.25);
}

.login-form .btn-primary:active {
    transform: translateY(0);
}

/* ===== MITID BUTTON ===== */
.mitid-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.125rem 1.25rem;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 1.5rem;
}

.mitid-button:hover {
    border-color: var(--login-dark);
    box-shadow: 0 4px 12px rgba(10, 22, 40, 0.1);
    transform: translateY(-1px);
}

.mitid-logo {
    flex-shrink: 0;
}

.mitid-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.mitid-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.mitid-description {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ===== DEMO NOTICE ===== */
.demo-notice {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    padding: 1rem 1.125rem;
    background: var(--status-warning-bg);
    border: 1px solid #fcd34d;
    border-left: 3px solid var(--status-warning);
    margin-bottom: 1.25rem;
}

.demo-notice i {
    color: var(--status-warning);
    font-size: 1rem;
    margin-top: 2px;
}

.demo-notice p {
    color: #92400e;
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 0;
}

.demo-notice strong {
    color: #92400e;
}

/* ===== ERROR/SUCCESS MESSAGES ===== */
.login-error {
    display: none;
    padding: 1rem 1.125rem;
    background: var(--status-danger-bg);
    border: 1px solid #fecaca;
    border-left: 3px solid var(--status-danger);
    margin-bottom: 1rem;
    color: var(--status-danger);
    font-size: 0.875rem;
}

.login-error.show {
    display: block;
}

.login-success {
    display: none;
    padding: 1rem 1.125rem;
    background: var(--status-success-bg);
    border: 1px solid #bbf7d0;
    border-left: 3px solid var(--status-success);
    margin-bottom: 1rem;
    color: var(--status-success);
    font-size: 0.875rem;
}

.login-success.show {
    display: block;
}

/* ===== BACK TO HOME LINK ===== */
.login-back-link {
    position: absolute;
    top: 2.5rem;
    right: 1.5rem;
    z-index: 10;
}

.login-back-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: all 0.2s ease;
}

.login-back-link a::before {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--login-highlight);
    border-radius: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.login-back-link a:hover {
    color: var(--login-dark);
}

.login-back-link a:hover::before {
    opacity: 1;
}

.login-back-link a i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.login-back-link a:hover i {
    transform: translateX(-3px);
}

/* ===== LOGIN HELP ===== */
.login-help {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.login-help p {
    color: var(--text-light);
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.login-help a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.login-help a::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--login-highlight);
    border-radius: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.login-help a:hover {
    color: var(--login-dark);
}

.login-help a:hover::before {
    opacity: 1;
}

/* ===== DIVIDER ===== */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.divider span {
    padding: 0 1rem;
}

/* ===== TEST LOGIN BUTTON ===== */
.test-login-button {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--background-light);
    border: 2px dashed var(--border-color);
    border-radius: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.test-login-button:hover {
    border-color: var(--login-accent);
    background: var(--white);
    color: var(--text-dark);
}

.test-login-button i {
    margin-right: 0.5rem;
}

/* ===== SECURITY NOTICE (inside form panel) ===== */
.login-form-panel .security-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem 1.125rem;
    background: var(--status-info-bg);
    border: 1px solid #bae6fd;
    border-left: 3px solid var(--login-accent);
}

.security-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    color: var(--login-accent);
}

.login-form-panel .security-notice p {
    color: #0369a1;
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 0;
}

/* ===== LEGACY INFO CARD (hidden in new design) ===== */
.info-card {
    display: none;
}

/* ===== GSAP ANIMATION INITIAL STATES ===== */
.login-split-logo {
    opacity: 0;
}

.login-brand-panel,
.login-form-panel {
    opacity: 0;
}

.login-brand-content > *,
.login-form-container > * {
    opacity: 0;
}

/* When animations are disabled or loaded */
.gsap-loaded .login-split-logo,
.gsap-loaded .login-brand-panel,
.gsap-loaded .login-form-panel,
.gsap-loaded .login-brand-content > *,
.gsap-loaded .login-form-container > * {
    opacity: 1;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .login-brand-panel {
        padding: 3rem 2rem;
    }

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

    .login-brand-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 900px) {
    .login-section {
        flex-direction: column;
    }

    .login-brand-panel {
        flex: none;
        max-width: 100%;
        min-height: auto;
        padding: 1.5rem 1.5rem 2rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 5;
    }

    /* Make logo fixed so it stays above form panel when pinned */
    .login-brand-logo {
        position: fixed;
        top: 1.5rem;
        left: 1.5rem;
        z-index: 15;
        margin-bottom: 0;
        width: auto;
        max-width: fit-content;
    }

    /* Dark brand logo that reveals on scroll using clip-path */
    .login-brand-logo-dark {
        position: fixed;
        top: 1.5rem;
        left: 1.5rem;
        z-index: 16;
        margin-bottom: 0;
        clip-path: inset(100% 0 0 0);
        width: auto;
        max-width: fit-content;
    }

    .login-form-panel {
        flex: none;
        max-width: 100%;
        margin-top: var(--brand-panel-height, 350px);
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--white);
        height: var(--form-min-height, 100vh);
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 2rem;
    }

    /* Ensure login-card stays below fixed brand logo */
    .login-card {
        position: relative;
        z-index: 1;
    }

    /* Dark back-link - reveals on scroll using clip-path */
    .login-form-back-link {
        position: fixed !important;
        top: 1.5rem !important;
        left: auto !important;
        right: 1rem !important;
        z-index: 21 !important;
        display: flex;
        align-items: center;
        height: 40px;
        clip-path: inset(100% 0 0 0);
        width: auto;
        max-width: fit-content;
    }

    .login-form-back-link a {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        color: var(--login-dark);
        font-size: 0.9rem;
        font-weight: 500;
        text-decoration: none;
        transition: color 0.2s ease;
        pointer-events: auto;
        position: relative;
        z-index: 1;
    }

    .login-form-back-link a:hover {
        color: var(--primary);
    }

    /* White back-link at top right - always visible */
    .login-back-link {
        position: fixed !important;
        top: 1.5rem !important;
        left: auto !important;
        right: 1rem !important;
        z-index: 20 !important;
        display: flex;
        align-items: center;
        height: 40px;
        width: auto;
        max-width: fit-content;
    }

    .login-back-link a {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        color: rgba(255, 255, 255, 1);
        font-size: 0.9rem;
        font-weight: 500;
        text-decoration: none;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        transition: color 0.2s ease;
        pointer-events: auto;
        position: relative;
        z-index: 1;
    }

    .login-back-link a:hover {
        color: var(--white);
    }

    .login-brand-content {
        max-width: 100%;
        padding-top: 4rem;
    }

    /* Hide desktop logo on mobile (fixed logo is used instead) */
    .login-desktop-logo {
        display: none;
    }

    .login-brand-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .login-brand-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .login-features {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .login-feature-item {
        padding: 0.625rem 0;
        border-bottom: none;
    }

    .login-feature-text span {
        display: none;
    }

    .login-security-badge {
        display: none;
    }

    .login-form-panel {
        min-height: auto;
        padding: 2rem 1.5rem 3rem;
    }

    .login-form-container {
        max-width: 100%;
    }

    /* Hide orbs on mobile */
    .login-orb {
        display: none;
    }
}

@media (max-width: 640px) {
    .login-brand-panel {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .login-brand-logo {
        top: 1.25rem;
        left: 1.25rem;
    }

    .login-brand-logo img {
        height: 32px;
    }

    .login-brand-logo-dark {
        top: 1.25rem;
        left: 1.25rem;
    }

    .login-brand-logo-dark img {
        height: 32px;
    }

    .login-brand-title {
        font-size: 1.25rem;
    }

    .login-brand-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .login-features {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .login-feature-item {
        padding: 0.5rem 0;
    }

    .login-feature-icon {
        width: 32px;
        height: 32px;
    }

    .login-feature-icon i {
        font-size: 0.875rem;
    }

    .login-feature-text strong {
        font-size: 0.875rem;
    }

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

    .login-header h1 {
        font-size: 1.5rem;
    }

    .login-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .login-form input {
        padding: 0.875rem 1rem;
    }

    .login-form .btn-primary {
        padding: 0.875rem 1rem;
    }

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

/* ===== NO-JS FALLBACK ===== */
.no-js .login-brand-panel,
.no-js .login-form-panel,
.no-js .login-brand-content > *,
.no-js .login-form-container > * {
    opacity: 1;
}
