/* ========= LOGIN PAGE — Standalone CSS ========= */
/* No dependency on template CSS required */

/* ========= FULL RESET ========= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #111827;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

/* Kill browser autofill yellow background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: #111827 !important;
    transition: background-color 5000s ease-in-out 0s;
}

[data-style="dark"] input:-webkit-autofill,
[data-style="dark"] input:-webkit-autofill:hover,
[data-style="dark"] input:-webkit-autofill:focus,
[data-style="dark"] input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #0f172a inset !important;
    -webkit-text-fill-color: #f1f5f9 !important;
}

/* ========= LAYOUT ========= */
.login-page {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ========= TOP CONTROLS ========= */
.top-right-controls {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
}

.control-btn {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    height: 40px;
    padding: 0 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 150ms ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    text-decoration: none;
}

.control-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

.lang-pill {
    display: inline-flex;
    justify-content: center;
}

.lang-text {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.control-btn i {
    font-size: 16px;
}

.control-btn .fi {
    font-size: 14px;
    border-radius: 2px;
}

[data-style="dark"] .control-btn {
    background: rgba(30, 41, 59, 0.8);
    border-color: #334155;
    color: #94a3b8;
}

[data-style="dark"] .control-btn:hover {
    background: #334155;
    color: #e2e8f0;
}

/* ========= LEFT PANEL — BRANDING ========= */
.login-brand-panel {
    width: 480px;
    flex-shrink: 0;
    background: linear-gradient(160deg, #1e3a5f 0%, #0f2744 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    position: relative;
    overflow: hidden;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.08);
}

.login-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.06);
}

.brand-content {
    position: relative;
    z-index: 1;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.brand-logo-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.brand-logo-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: none;
    outline: none;
}

.brand-logo-titles {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-logo-main {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #ffffff;
}

.brand-logo-sub {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.5px;
}

.brand-headline {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
    color: #ffffff;
}

.brand-desc {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

.brand-feature i {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.brand-footer {
    position: relative;
    z-index: 1;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-footer .heart {
    font-style: normal;
}

.brand-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 600;
}

.brand-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* ========= RIGHT PANEL — FORM ========= */
.login-form-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px;
    background: linear-gradient(135deg, #f4f7fb 0%, #e2eaf4 100%);
}

.login-form-wrapper {
    width: 100%;
    max-width: 440px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(30, 58, 95, 0.08) !important;
    border-top: 4px solid #1e3a5f !important;
    border-radius: 20px;
    padding: 48px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.03);
}

.login-form-header {
    text-align: center;
    margin-bottom: 32px;
}

.form-top-icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px auto;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2744 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(15, 39, 68, 0.25);
}

.form-top-icon {
    font-size: 28px;
    color: #ffffff;
    margin: 0;
}

.login-form-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px 0;
    letter-spacing: -0.3px;
}

.login-form-header p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* ========= ALERT ========= */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #b91c1c;
}

.alert-error i {
    color: #ef4444;
    font-size: 16px;
    flex-shrink: 0;
}

/* ========= FORM ========= */
.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.field-input {
    position: relative;
}

.field-input>i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #9ca3af;
    pointer-events: none;
    transition: color 150ms ease;
    z-index: 1;
}

.field-input input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 44px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: #111827;
    background: #ffffff !important;
    border: 1.5px solid rgba(30, 58, 95, 0.15) !important;
    border-radius: 12px;
    outline: none;
    transition: all 150ms ease;
    -webkit-appearance: none;
    appearance: none;
}

.field-input input::placeholder {
    color: #9ca3af;
}

.field-input input:focus {
    background: #ffffff !important;
    border-color: #1e3a5f !important;
    box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.1);
}

.field-input:focus-within>i {
    color: #1e3a5f;
}

/* Password toggle button */
#togglePwd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

#togglePwd i {
    position: static !important;
    transform: none !important;
    pointer-events: auto !important;
    color: #94a3b8;
    font-size: 15px;
    transition: color 200ms;
}

#togglePwd:hover i {
    color: #64748b;
}

/* ========= CHECKBOX ========= */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: -10px;
}

.form-check-input {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid #d1d5db;
    cursor: pointer;
    accent-color: #1e3a5f;
    -webkit-appearance: auto;
    appearance: auto;
}

.form-check-label {
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
}

/* ========= BUTTON ========= */
.btn-submit {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2744 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 150ms ease;
    margin-top: 24px;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(15, 39, 68, 0.25);
}

.btn-submit:hover {
    background: linear-gradient(135deg, #264773 0%, #153358 100%);
    box-shadow: 0 6px 20px rgba(15, 39, 68, 0.35);
    transform: translateY(-2px);
}

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

/* ========= BOX FOOTER ========= */
.box-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.secure-badge i {
    color: #22c55e;
    font-size: 14px;
}

.secure-text {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    letter-spacing: 0.2px;
}

/* ========= DARK MODE ========= */
[data-style="dark"] .login-brand-panel {
    background: linear-gradient(175deg, #020617, #0f172a);
}

[data-style="dark"] .login-form-panel {
    background: #0b1120;
}

[data-style="dark"] .login-form-wrapper {
    background: linear-gradient(145deg, #141e30, #1a2540) !important;
    border: 1px solid rgba(59, 130, 246, 0.15) !important;
    border-top: 4px solid #1e3a5f !important;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.05), 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(59, 130, 246, 0.04);
}

[data-style="dark"] .login-form-header h1 {
    color: #f1f5f9;
}

[data-style="dark"] .login-form-header p {
    color: #94a3b8;
}

[data-style="dark"] .form-top-icon {
    color: #60a5fa;
}

[data-style="dark"] .form-field label {
    color: #cbd5e1;
}

[data-style="dark"] .field-input>i {
    color: #475569;
}

[data-style="dark"] .field-input input {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1.5px solid #334155 !important;
    color: #f1f5f9;
}

[data-style="dark"] .field-input input::placeholder {
    color: #64748b;
}

[data-style="dark"] .field-input input:focus {
    border-color: #3b82f6 !important;
    background: rgba(15, 23, 42, 0.9) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

[data-style="dark"] .field-input:focus-within>i {
    color: #60a5fa;
}

[data-style="dark"] .btn-submit {
    background: #3b82f6;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

[data-style="dark"] .btn-submit:hover {
    background: #2563eb;
    box-shadow: 0 6px 28px rgba(59, 130, 246, 0.45);
}

[data-style="dark"] .box-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
}

[data-style="dark"] .secure-badge i {
    color: #34d399;
}

[data-style="dark"] .secure-text {
    color: #94a3b8;
}

[data-style="dark"] .form-check-label {
    color: #94a3b8;
}

[data-style="dark"] .form-check-input {
    border-color: #475569;
}

/* ========= RESPONSIVE - MOBILE APP MODE ========= */
@media (max-width: 900px) {
    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        padding: 0;
        align-items: flex-end;
        background: linear-gradient(160deg, #1e3a5f 0%, #0f2744 100%) !important;
    }

    [data-style="dark"] .login-form-panel {
        background: linear-gradient(175deg, #020617, #0f172a) !important;
    }

    .top-right-controls {
        top: 20px;
        right: 20px;
    }

    .control-btn {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #ffffff;
    }

    .control-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        color: #ffffff;
    }

    [data-style="dark"] .control-btn {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .login-form-wrapper {
        width: 100%;
        max-width: 100%;
        min-height: 85vh;
        /* Bottom sheet style */
        border: none !important;
        border-radius: 36px 36px 0 0 !important;
        background: #ffffff !important;
        padding: 40px 24px 30px;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15) !important;
        display: flex;
        flex-direction: column;
        position: relative;
    }

    /* Pull indicator */
    .login-form-wrapper::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 48px;
        height: 5px;
        background: #cbd5e1;
        border-radius: 999px;
    }

    [data-style="dark"] .login-form-wrapper {
        background: #0b1524 !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4) !important;
    }

    [data-style="dark"] .login-form-wrapper::before {
        background: #334155;
    }

    .form-top-icon-wrap {
        width: 80px;
        height: 80px;
        border-radius: 24px;
        margin: -80px auto 24px auto;
        border: 6px solid #ffffff;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
        position: relative;
        z-index: 2;
    }

    [data-style="dark"] .form-top-icon-wrap {
        border-color: #0b1524;
    }

    .form-top-icon {
        font-size: 32px;
    }

    .login-form-header h1 {
        font-size: 26px;
        font-weight: 800;
        letter-spacing: -0.3px;
        margin-bottom: 6px;
    }

    .login-form-header p {
        font-size: 14px;
    }

    .form-field {
        margin-bottom: 20px;
    }

    .field-input input {
        height: 52px;
        border-radius: 14px;
        font-size: 15px;
    }

    .btn-submit {
        height: 52px;
        border-radius: 14px;
        font-size: 16px;
        margin-top: auto;
    }

    .box-footer {
        margin-top: 30px;
        padding-top: 0;
        border-top: none;
    }
}