/* =====================================================
   HEFNER BANKING — LOGIN PAGE
   ===================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* =====================================================
   LOADING SCREEN
   ===================================================== */
.loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
    overflow: hidden;
}

/* =====================================================
   MAIN LOGIN SCREEN
   ===================================================== */
.login-main-screen {
    display: none;
    width: 100vw;
    min-height: 100vh;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.login-main-screen[style*="opacity: 1"],
.login-main-screen[style*="opacity:1"] {
    pointer-events: auto;
}

/* =====================================================
   SPLIT LAYOUT
   ===================================================== */
.loading-split-layout,
.login-split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    min-height: 100vh;
}

.loading-split-layout {
    height: 100vh;
    overflow: hidden;
}

.login-split-layout {
    flex: 1;
}

/* =====================================================
   LEFT SIDE — Dark Navy (B: panel flip)
   ===================================================== */
.login-left-side {
    background: #1a1a2e;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    position: sticky;
    top: 0;
    height: 100%;
    overflow: hidden;
}

/* Decorative gold-tinted circles */
.login-left-side::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201,168,76,0.08) 0%, transparent 70%);
    top: -160px; left: -140px;
    pointer-events: none;
}

.login-left-side::after {
    content: '';
    position: absolute;
    width: 380px; height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201,168,76,0.06) 0%, transparent 70%);
    bottom: -100px; right: -80px;
    pointer-events: none;
}

/* Logo — gold-tinted glass card */
.login-logo-wrap {
    position: relative;
    z-index: 2;
    background: rgba(201, 168, 76, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(201, 168, 76, 0.28);
    border-radius: 1.25rem;
    padding: 1rem 2.5rem;
    text-align: center;
}

.login-logo-script {
    font-family: 'Great Vibes', cursive;
    font-size: 2.8rem;
    color: #c9a84c;
    line-height: 1.2;
}

/* Branding block */
.login-branding {
    position: relative;
    z-index: 2;
    text-align: center;
}

.login-welcome {
    font-size: 2.75rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.4rem;
    line-height: 1.15;
}

.login-brand-name {
    font-size: 1.35rem;
    font-weight: 500;
    color: rgba(255,255,255,0.75);
    margin: 0 0 0.875rem;
}

.login-tagline {
    font-size: 0.975rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.75;
    max-width: 380px;
    margin: 0 auto;
}

/* Feature Cards 2×2 grid */
.login-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
}

.login-feature-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    padding: 0.9rem 1.1rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.login-feature-card:hover {
    background: rgba(201,168,76,0.08);
    border-color: rgba(201,168,76,0.2);
    transform: translateY(-2px);
}

.login-feature-icon {
    width: 40px; height: 40px;
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #c9a84c;
    flex-shrink: 0;
}

.login-feature-text h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.1rem;
    line-height: 1.3;
}

.login-feature-text p {
    font-size: 0.775rem;
    color: rgba(255,255,255,0.45);
    margin: 0;
}

/* =====================================================
   RIGHT SIDE
   ===================================================== */
.login-right-side {
    background: #f4f5f7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    position: relative;
    min-height: 100vh;
}

/* Theme toggle */
.theme-toggle-login {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 1rem;
    z-index: 10;
    transition: background 0.2s, color 0.2s;
}

.theme-toggle-login:hover {
    background: #c9a84c;
    color: #fff;
}

/* =====================================================
   WHITE CARD
   ===================================================== */
.login-form-container {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 8px 40px rgba(26,26,46,0.1), 0 1px 0 rgba(0,0,0,0.03);
    padding: 2.25rem 2rem 1.75rem;
    border: 1px solid rgba(26,26,46,0.06);
}

.login-form-header { margin-bottom: 1.75rem; }

.login-form-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 0.3rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.login-form-subtitle {
    font-size: 0.9rem;
    color: #999;
    margin: 0;
}

/* =====================================================
   FORM FIELDS
   ===================================================== */
.login-form { margin: 0; }

.form-group { margin-bottom: 1.2rem; }

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.45rem;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
}
.form-label-row .form-label { margin-bottom: 0; }

.forgot-link {
    font-size: 0.825rem;
    color: #c9a84c;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}
.forgot-link:hover { color: #b8962a; }

/* Input — E: gold icon */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: rgba(201, 168, 76, 0.55);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s;
}

.input-wrapper:focus-within .input-icon {
    color: #c9a84c;
}

.form-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    border: 1.5px solid #e8e8e8;
    border-radius: 0.875rem;
    background: #fafafa;
    color: #1a1a2e;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
}

.form-input::placeholder { color: #c0c0c0; }

.form-input:focus {
    outline: none;
    border-color: #c9a84c;
    box-shadow: 0 0 0 3px rgba(201,168,76,0.14);
    background: #fff;
}

.form-input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

/* Eye toggle */
.toggle-password {
    position: absolute;
    right: 0.875rem;
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    padding: 0.35rem;
    font-size: 0.9rem;
    line-height: 1;
    transition: color 0.2s;
}
.toggle-password:hover { color: #c9a84c; }

/* =====================================================
   CHECKBOX
   ===================================================== */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] { display: none; }

.checkbox-custom {
    width: 20px; height: 20px;
    border: 2px solid #d8d8d8;
    border-radius: 0.3rem;
    position: relative;
    flex-shrink: 0;
    background: #fff;
    transition: background 0.18s, border-color 0.18s;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: #c9a84c;
    border-color: #c9a84c;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 0.65rem;
}

.checkbox-text {
    font-size: 0.9rem;
    color: #444;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-login-submit {
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: #c9a84c;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    border: none;
    border-radius: 99px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    letter-spacing: 0.01em;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(201,168,76,0.3);
}

.btn-login-submit:hover {
    background: #b8962a;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(201,168,76,0.4);
}

.btn-login-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* New to Hefner? */
.form-footer { text-align: center; }

.signup-text {
    font-size: 0.875rem;
    color: #999;
    margin: 0 0 0.75rem;
}

/* Create Account — navy ghost */
.btn-create-account {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1rem;
    background: transparent;
    color: #1a1a2e;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: 1.5px solid rgba(26,26,46,0.15);
    border-radius: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    box-sizing: border-box;
}

.btn-create-account:hover {
    background: rgba(26,26,46,0.05);
    border-color: rgba(26,26,46,0.25);
    color: #1a1a2e;
}

/* =====================================================
   FOOTER LINKS + TERMS
   ===================================================== */
.login-footer-links {
    display: flex;
    justify-content: center;
    gap: 1.75rem;
    padding: 1.1rem 0 0.9rem;
    border-top: 1px solid #f0f0f0;
    margin-top: 1.25rem;
}

.login-footer-links a {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}
.login-footer-links a:hover { color: #c9a84c; }

.login-terms-text {
    font-size: 0.75rem;
    color: #bbb;
    text-align: center;
    line-height: 1.65;
    margin: 0;
}
.login-terms-text a { color: #aaa; text-decoration: none; }
.login-terms-text a:hover { color: #c9a84c; text-decoration: underline; }

/* =====================================================
   LOADING ANIMATION — C: refined clean version
   ===================================================== */
.loading-animation {
    text-align: center;
    animation: ldr-fade-in 0.6s ease both;
}

@keyframes ldr-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.loading-circle {
    position: relative;
    width: 100px; height: 100px;
    margin: 0 auto 2rem;
}

.loading-rings {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

/* Single refined ring */
.ring {
    position: absolute;
    top: 50%; left: 50%;
    border-radius: 50%;
    border: 2px solid transparent;
}

.ring-1 {
    width: 88px; height: 88px;
    margin: -44px 0 0 -44px;
    border-top-color: #c9a84c;
    border-right-color: rgba(201,168,76,0.2);
    animation: spin 1.4s cubic-bezier(0.4,0,0.6,1) infinite;
}

.ring-2 {
    width: 64px; height: 64px;
    margin: -32px 0 0 -32px;
    border-bottom-color: rgba(201,168,76,0.35);
    animation: spin 2s linear infinite reverse;
}

.ring-3 { display: none; }

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

.loading-dot {
    position: absolute;
    top: 50%; left: 50%;
    width: 16px; height: 16px;
    background: #c9a84c;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: dotPulse 1.6s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(201,168,76,0.4);
}

@keyframes dotPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0 rgba(201,168,76,0.4);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        box-shadow: 0 0 0 8px rgba(201,168,76,0);
    }
}

/* C: Great Vibes brand name in loader */
.loading-brand {
    font-family: 'Great Vibes', cursive;
    font-size: 2.6rem;
    font-weight: 400;
    color: #c9a84c;
    margin: 0 0 0.5rem;
    letter-spacing: 0.02em;
    animation: ldr-fade-in 0.8s ease 0.2s both;
}

.loading-subtitle {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #bbb;
    margin: 0;
    animation: ldr-fade-in 0.8s ease 0.35s both;
}

/* =====================================================
   DARK MODE — A: fixed selector
   ===================================================== */
[data-theme="dark"] .login-right-side { background: #12121e; }

[data-theme="dark"] .login-form-container {
    background: #1e1e38;
    border-color: rgba(255,255,255,0.06);
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

[data-theme="dark"] .login-form-title { color: #f0f0f0; }
[data-theme="dark"] .login-form-subtitle { color: #777; }
[data-theme="dark"] .form-label { color: #ccc; }
[data-theme="dark"] .checkbox-text { color: #bbb; }
[data-theme="dark"] .signup-text { color: #666; }

[data-theme="dark"] .form-input {
    background: #161630;
    border-color: #2e2e52;
    color: #eee;
}
[data-theme="dark"] .form-input:focus {
    border-color: #c9a84c;
    background: #1e1e3a;
}
[data-theme="dark"] .form-input::placeholder { color: #4a4a6a; }

[data-theme="dark"] .checkbox-custom { background: #161630; border-color: #2e2e52; }

[data-theme="dark"] .btn-create-account {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.75);
}
[data-theme="dark"] .btn-create-account:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.18);
    color: #fff;
}

[data-theme="dark"] .theme-toggle-login { background: #1e1e38; color: #aaa; }
[data-theme="dark"] .login-footer-links { border-color: #252545; }
[data-theme="dark"] .login-footer-links a { color: #555; }
[data-theme="dark"] .login-terms-text { color: #444; }
[data-theme="dark"] .login-terms-text a { color: #555; }

[data-theme="dark"] .loading-subtitle { color: #555; }
[data-theme="dark"] .loading-right-side { background: #12121e; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
    .loading-split-layout,
    .login-split-layout { grid-template-columns: 1fr; }
    .login-left-side { display: none; }
    .login-right-side { padding: 2rem 1.25rem; min-height: 100vh; }
}

@media (max-width: 480px) {
    .login-form-container { padding: 1.75rem 1.25rem 1.5rem; border-radius: 1rem; }
    .login-form-title { font-size: 1.5rem; }
}
