/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* Global Style Variables */
:root {
    --login-primary: #0f766e;       /* Teal/Emerald */
    --login-primary-light: #0d9488; /* Turquoise Emerald */
    --login-secondary: #f59e0b;     /* Gold Accent */
    --login-dark: #0f172a;          /* Slate Dark */
    --login-light: #f8fafc;
    --login-gray: #64748b;
    --login-border: #e2e8f0;
    --login-radius: 14px;
    --login-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Page Reset & Setup */
body.auth-page, 
#loginPrototype.login-wrapper {
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    background-color: var(--login-light);
    margin: 0;
    padding: 0;
}

#loginPrototype.login-wrapper {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    width: 100vw;
}

/* Main Split Screen Container */
.login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ==========================================================================
   LEFT PANEL: Branding & Visuals
   ========================================================================== */
.login-visual-panel {
    flex: 1.25;
    background: linear-gradient(135deg, #075985 0%, #0f766e 40%, #064e3b 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4rem;
    overflow: hidden;
    color: #ffffff;
}

/* Slow Motion Glowing Orbs background */
.visual-gradient-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.visual-gradient-overlay::before,
.visual-gradient-overlay::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.18) 0%, rgba(20, 184, 166, 0) 70%);
    filter: blur(60px);
    z-index: 1;
    animation: float-glow 25s infinite alternate ease-in-out;
}

.visual-gradient-overlay::before {
    top: -15%;
    left: -10%;
}

.visual-gradient-overlay::after {
    bottom: -15%;
    right: -10%;
    animation-delay: -12s;
}

@keyframes float-glow {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, -40px) scale(1.1); }
    100% { transform: translate(-30px, 50px) scale(1.2); }
}

/* Subtle repeating Modern Islamic tile pattern background */
.visual-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M40 0l40 40-40 40L0 40z' fill='none' stroke='%23ffffff' stroke-width='1.5'/%3E%3Ccircle cx='40' cy='40' r='12' fill='none' stroke='%23ffffff' stroke-width='1.5'/%3E%3Cpath d='M0 0h80v80H0z' fill='none' stroke='%23ffffff' stroke-width='1.5'/%3E%3C/svg%3E");
    background-size: 50px 50px;
    z-index: 2;
}

.visual-content {
    position: relative;
    z-index: 3;
    max-width: 580px;
    margin: auto 0;
}

/* Glowing Logo Container */
.visual-logo .logo-box {
    width: 68px;
    height: 68px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: logo-float 5s infinite ease-in-out;
}

@keyframes logo-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

.visual-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.025em;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.visual-tagline {
    font-size: 1.1rem;
    color: rgba(241, 245, 249, 0.85);
    line-height: 1.6;
    font-weight: 400;
}

/* Glassmorphism Decorative Stats Cards */
.visual-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 440px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--login-radius);
    padding: 1.15rem 1.35rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--login-transition);
    cursor: default;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.stat-icon-wrapper.text-teal { color: #2dd4bf; }
.stat-icon-wrapper.text-amber { color: #f59e0b; }
.stat-icon-wrapper.text-info { color: #38bdf8; }

.stat-text {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.825rem;
    color: rgba(241, 245, 249, 0.65);
    margin-top: 2px;
}

.visual-footer {
    position: relative;
    z-index: 3;
    font-size: 0.85rem;
    color: rgba(241, 245, 249, 0.55);
}

/* ==========================================================================
   RIGHT PANEL: Login Form
   ========================================================================= */
.login-form-panel {
    flex: 0.95;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4rem;
    position: relative;
}

.form-scroll-container {
    margin: auto 0;
    width: 100%;
    max-width: 440px;
    align-self: center;
}

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

.form-subtitle {
    font-size: 0.95rem;
    color: var(--login-gray);
    line-height: 1.5;
    margin-bottom: 2.25rem;
}

/* Form Controls & Styling */
.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--login-dark);
    margin-bottom: 0.5rem;
}

.form-label.required::after {
    content: " *";
    color: #ef4444;
}

/* Input Groups */
.input-group {
    border-radius: var(--login-radius);
    border: 1.5px solid var(--login-border);
    background-color: var(--login-light);
    transition: var(--login-transition);
    overflow: hidden;
}

.input-group:focus-within {
    border-color: var(--login-primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
    background-color: #ffffff;
}

.input-group-text {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding-left: 1.15rem;
    font-size: 1.2rem;
}

.form-control, .form-select {
    border: none !important;
    background: transparent !important;
    padding: 0.85rem 1.15rem 0.85rem 0.5rem;
    font-size: 0.95rem;
    color: var(--login-dark);
    box-shadow: none !important;
    outline: none !important;
}

.form-control::placeholder {
    color: #94a3b8;
}

/* Password Toggle button */
#btnToggleLoginPagePassword {
    border: none;
    background: transparent;
    color: var(--login-gray);
    padding-right: 1.15rem;
    transition: var(--login-transition);
}

#btnToggleLoginPagePassword:hover {
    color: var(--login-primary);
}

/* Caps Lock Notice */
.login-caps-alert {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
    border-radius: var(--login-radius);
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
}

/* Remember me & Forgot password link */
.form-check-input {
    border-color: #cbd5e1;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--login-primary);
    border-color: var(--login-primary);
}

.form-check-label {
    font-size: 0.9rem;
    color: var(--login-gray);
    cursor: pointer;
    user-select: none;
}

.login-help-link {
    font-size: 0.9rem;
    color: var(--login-gray);
    font-weight: 600;
    transition: var(--login-transition);
}

.login-help-link:hover {
    color: var(--login-primary);
}

/* Submit Button */
.btn-submit {
    background: linear-gradient(135deg, var(--login-primary) 0%, var(--login-primary-light) 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--login-radius);
    padding: 0.95rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.25);
    transition: var(--login-transition);
}

.btn-submit:hover {
    background: linear-gradient(135deg, var(--login-primary-light) 0%, var(--login-primary) 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(15, 118, 110, 0.4);
}

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

/* Demo Notice Box */
.demo-notice-box {
    background-color: #f0fdfa;
    border: 1px dashed #99f6e4;
    padding: 1.25rem;
    border-radius: var(--login-radius);
}

.btn-outline-teal {
    color: var(--login-primary);
    border: 1.5px solid var(--login-primary);
    font-weight: 600;
    transition: var(--login-transition);
}

.btn-outline-teal:hover {
    background-color: var(--login-primary);
    color: #ffffff;
    border-color: var(--login-primary);
    transform: translateY(-1px);
}

.form-footer {
    color: var(--login-gray);
    font-size: 0.85rem;
}

/* Mobile Brand Logo Header */
.mobile-logo {
    width: 60px;
    height: 60px;
    background-color: #f0fdfa;
    color: var(--login-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.1);
}

/* ==========================================================================
   MODAL & OFFCANVAS DRAWER: Accounts Demo & Forgot Password
   ========================================================================== */
/* Offcanvas Drawer for Demo Accounts */
.demo-accounts-drawer {
    border-left: none !important;
    box-shadow: -10px 0 40px rgba(15, 23, 42, 0.08) !important;
    width: 440px !important;
}

.demo-accounts-drawer .offcanvas-header {
    background-color: var(--login-light);
    padding: 1.5rem;
}

.demo-accounts-drawer .offcanvas-title {
    color: var(--login-primary);
}

.demo-accounts-drawer .offcanvas-body {
    padding: 1.5rem;
}

/* Custom Table in Drawer */
#loginAccountsTable {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

#loginAccountsTable th {
    font-weight: 700;
    color: #475569;
    background-color: #f1f5f9;
    border-bottom: 2px solid var(--login-border);
    padding: 0.75rem 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

#loginAccountsTable td {
    padding: 0.95rem 0.5rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--login-dark);
}

#loginAccountsTable tr:hover td {
    background-color: #f8fafc;
}

#loginAccountsTable .fw-semibold {
    color: var(--login-dark);
}

/* Custom badges for statuses */
.badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 6px;
    font-weight: 700;
}

.badge.text-bg-success {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
}

.badge.text-bg-secondary {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

.badge.text-bg-warning {
    background-color: #fef3c7 !important;
    color: #92400e !important;
}

/* Table Aksi Button */
.demo-accounts-drawer .btn-outline-primary {
    color: var(--login-primary);
    border-color: var(--login-primary);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    transition: var(--login-transition);
}

.demo-accounts-drawer .btn-outline-primary:hover {
    background-color: var(--login-primary);
    color: #ffffff;
    border-color: var(--login-primary);
}

.demo-accounts-drawer .btn-outline-secondary {
    color: var(--login-gray);
    border-color: #cbd5e1;
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
}

.demo-accounts-drawer .btn-outline-secondary:hover {
    background-color: #f1f5f9;
    color: var(--login-dark);
    border-color: #cbd5e1;
}

/* Empty State */
.empty-icon {
    font-size: 2.5rem;
    color: #cbd5e1;
}

/* Drawer Footer Buttons */
.drawer-footer {
    background-color: #ffffff;
}

/* Forgot Password Modal */
.modal-content {
    border-radius: 18px;
    overflow: hidden;
}

.bg-teal {
    background-color: var(--login-primary) !important;
}

.btn-teal {
    background-color: var(--login-primary);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: var(--login-transition);
}

.btn-teal:hover {
    background-color: var(--login-primary-light);
    color: #ffffff;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Media Queries)
   ========================================================================== */
@media (max-width: 1199.98px) {
    .login-visual-panel {
        padding: 3rem;
    }
    .login-form-panel {
        padding: 3rem;
    }
    .visual-title {
        font-size: 2.15rem;
    }
}

@media (max-width: 991.98px) {
    .login-container {
        flex-direction: column;
    }
    .login-visual-panel {
        display: none; /* Hide visual panel on mobile/tablet */
    }
    .login-form-panel {
        flex: 1;
        padding: 3rem 2rem;
        justify-content: center;
        min-height: 100vh;
    }
    .form-scroll-container {
        margin: auto 0;
    }
}

@media (max-width: 575.98px) {
    .login-form-panel {
        padding: 2rem 1.25rem;
    }
    .form-title {
        font-size: 1.75rem;
    }
    .demo-accounts-drawer {
        width: 100% !important; /* Drawer takes full width on mobile */
    }
}
