/* ============================================================
   Login Page - Satu Usaha POS
   Glassmorphism + Ambient Mesh Design
   ============================================================ */

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

:root {
    --brand-primary: #4f46e5;
    --brand-primary-hover: #4338ca;
    --brand-cyan: #06b6d4;
    --brand-purple: #8b5cf6;
    --brand-dark: #0f172a;
    --brand-slate: #475569;
    --brand-light-bg: #f8fafc;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0.75rem;
    position: relative;
    overflow-x: hidden;

    /* Ambient Mesh Background with Dot Matrix Texture */
    background-color: #f1f5fd;
    background-image:
        radial-gradient(rgba(99, 102, 241, 0.12) 1.2px, transparent 1.2px),
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.25) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.22) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.18) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(99, 102, 241, 0.22) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(238, 242, 255, 0.6) 0px, transparent 100%);
    background-size: 24px 24px, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
    background-attachment: fixed;
}

/* --- Ambient Blobs --- */
.ambient-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.75;
}
.blob-1 {
    top: -10%; left: -10%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.45) 0%, rgba(56, 189, 248, 0) 70%);
    animation: floatBlob 14s infinite alternate ease-in-out;
}
.blob-2 {
    bottom: -10%; right: -10%;
    width: 550px; height: 550px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.38) 0%, rgba(168, 85, 247, 0) 70%);
    animation: floatBlob 18s infinite alternate-reverse ease-in-out;
}
.blob-3 {
    top: 35%; left: 45%;
    width: 450px; height: 450px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.35) 0%, rgba(6, 182, 212, 0) 70%);
    animation: floatBlob 20s infinite alternate ease-in-out;
}
@keyframes floatBlob {
    0%   { transform: translate(0px, 0px) scale(1); }
    50%  { transform: translate(35px, -35px) scale(1.08); }
    100% { transform: translate(-25px, 25px) scale(0.95); }
}

/* --- Glass Card --- */
.glass-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 28px;
    box-shadow:
        0 20px 40px -15px rgba(79, 70, 229, 0.12),
        0 0 0 1px rgba(226, 232, 240, 0.8);
    overflow: hidden;
    position: relative;
    z-index: 10;
}

/* --- Login Card Classic Model (Gradient Top Accent) --- */
.login-card-classic {
    background: #ffffff;
    border-radius: 28px;
    box-shadow:
        0 20px 45px -15px rgba(99, 102, 241, 0.12),
        0 0 0 1px rgba(226, 232, 240, 0.85);
    position: relative;
    overflow: hidden;
    z-index: 10;
}
.login-card-classic::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4f46e5 0%, #a855f7 50%, #ec4899 100%);
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
}

/* --- Header Icon Box --- */
.login-header-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #6366f1;
}

/* --- Left Panel --- */
.left-illustration-panel {
    background: linear-gradient(145deg, #eef2ff 0%, #f3f0ff 50%, #e0f2fe 100%);
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(226, 232, 240, 0.8);
}

/* --- Badges --- */
.badge-brand {
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.25);
    font-size: 0.725rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-brand-pos {
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.22);
    font-size: 0.775rem;
    padding: 3px 12px;
    border-radius: 9999px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.badge-brand-pos .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #6366f1;
    display: inline-block;
}

/* --- Custom Input Group --- */
.login-input-group {
    position: relative;
}
.login-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
    z-index: 5;
    pointer-events: none;
}
.login-input-group:focus-within .login-input-icon {
    color: var(--brand-primary);
}
.login-form-control {
    padding-left: 48px !important;
    padding-right: 48px !important;
    padding-top: 13px !important;
    padding-bottom: 13px !important;
    border-radius: 14px !important;
    border: 1.5px solid #e2e8f0 !important;
    background-color: #f8fafc !important;
    font-size: 0.925rem !important;
    color: #1e293b !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}
.login-form-control:focus {
    background-color: #ffffff !important;
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12) !important;
}
.login-btn-toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #94a3b8;
    padding: 4px;
    border-radius: 8px;
    z-index: 5;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}
.login-btn-toggle-pw:hover {
    color: #475569;
}

/* --- Submit Button --- */
.btn-brand-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 60%, #7c3aed 100%);
    background-size: 200% auto;
    border: none;
    color: #ffffff !important;
    font-weight: 600;
    padding: 13px 24px;
    border-radius: 14px;
    box-shadow: 0 10px 22px -5px rgba(79, 70, 229, 0.4);
    transition: all 0.3s ease;
    font-size: 0.95rem;
}
.btn-brand-primary:hover {
    background-position: right center;
    box-shadow: 0 14px 24px -5px rgba(79, 70, 229, 0.45);
    transform: translateY(-1px);
}
.btn-brand-primary:active {
    transform: translateY(1px);
}
.btn-brand-primary:disabled {
    opacity: 0.75;
    transform: none;
}

/* --- Checkbox --- */
.login-checkbox {
    width: 1.15em;
    height: 1.15em;
    border-radius: 6px !important;
    border: 2px solid #cbd5e1 !important;
    cursor: pointer;
}
.login-checkbox:checked {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}
.login-checkbox:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2) !important;
}

/* --- Alert Override --- */
.alert {
    border-radius: 12px !important;
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .left-illustration-panel {
        border-right: none;
        border-bottom: 1px solid rgba(226, 232, 240, 0.8);
        padding-bottom: 1.5rem !important;
    }
    .glass-card {
        border-radius: 20px;
    }
    body {
        align-items: flex-start;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}
@media (max-width: 575.98px) {
    .glass-card,
    .login-card-classic {
        border-radius: 20px;
    }
}

/* ============================================================
   Custom Background Backdrop & Canvas Particles Layer
   ============================================================ */
body.has-custom-bg {
    background-color: #0b0f19;
    background-image: none !important;
}

body.login-theme-dark:not(.has-custom-bg) {
    background-color: #0b0f19;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.08) 1.2px, transparent 1.2px),
        radial-gradient(at 0% 0%, rgba(30, 58, 138, 0.4) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(88, 28, 135, 0.35) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(15, 23, 42, 0.9) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(67, 56, 202, 0.4) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(15, 23, 42, 0.85) 0px, transparent 100%);
}

.login-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: -20;
    pointer-events: none;
}

.login-backdrop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.login-particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    pointer-events: none;
}

.login-grid-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -8;
    background-image: radial-gradient(rgba(99, 102, 241, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.login-theme-dark .login-grid-overlay {
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
}

/* --- Brand Logo Container (Supports Wide / Landscape Logos up to 340px) --- */
.login-brand-logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    transition: transform 0.25s ease;
}

.login-brand-logo-img {
    max-height: 75px;
    max-width: 330px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
}

.login-theme-dark .login-brand-logo-img {
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.45));
}

/* ============================================================
   Dark Mode Theme Styling (.login-theme-dark)
   ============================================================ */
body.login-theme-dark {
    color: #f1f5f9;
}

.login-theme-dark .text-brand-title {
    color: #ffffff !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.login-theme-dark .text-brand-subtitle {
    color: #cbd5e1 !important;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.login-theme-dark .badge-brand-pos {
    background: rgba(99, 102, 241, 0.22);
    color: #a5b4fc;
    border: 1px solid rgba(165, 180, 252, 0.3);
}

.login-theme-dark .badge-brand-pos .badge-dot {
    background-color: #818cf8;
}

.login-theme-dark .login-card-classic {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 25px 60px -15px rgba(0, 0, 0, 0.75),
        0 0 1px 1px rgba(255, 255, 255, 0.08) inset;
}

.login-theme-dark .login-card-classic::before {
    background: linear-gradient(90deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
}

.login-theme-dark .text-card-title {
    color: #ffffff !important;
}

.login-theme-dark .text-card-subtitle {
    color: #94a3b8 !important;
}

.login-theme-dark .login-header-icon-box {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #818cf8;
}

.login-theme-dark .login-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.login-theme-dark .form-label-custom {
    color: #cbd5e1 !important;
}

.login-theme-dark .login-form-control {
    background-color: rgba(30, 41, 59, 0.65) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
}

.login-theme-dark .login-form-control::placeholder {
    color: #64748b !important;
}

.login-theme-dark .login-form-control:focus {
    background-color: rgba(15, 23, 42, 0.95) !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.28) !important;
    color: #ffffff !important;
}

.login-theme-dark .login-input-icon {
    color: #64748b;
}

.login-theme-dark .login-input-group:focus-within .login-input-icon {
    color: #818cf8;
}

.login-theme-dark .login-btn-toggle-pw {
    color: #64748b;
}

.login-theme-dark .login-btn-toggle-pw:hover {
    color: #e2e8f0;
}

.login-theme-dark .login-checkbox {
    background-color: rgba(30, 41, 59, 0.85) !important;
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
}

.login-theme-dark .login-checkbox:checked {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}

.login-theme-dark .login-checkbox-label {
    color: #e2e8f0 !important;
}

.login-theme-dark .login-footer-text {
    color: #94a3b8 !important;
}

.login-theme-dark .login-footer-link {
    color: #818cf8 !important;
}

.login-theme-dark .login-footer-link:hover {
    color: #a5b4fc !important;
}

.login-theme-dark .login-register-prompt {
    color: #94a3b8 !important;
}

/* ============================================================
   Light Mode Theme Styling (.login-theme-light)
   ============================================================ */
body.login-theme-light {
    color: #1e293b;
}

.login-theme-light .text-brand-title {
    color: #0f172a !important;
}

.login-theme-light .text-brand-subtitle {
    color: #64748b !important;
}

.login-theme-light .text-card-title {
    color: #0f172a !important;
}

.login-theme-light .text-card-subtitle {
    color: #94a3b8 !important;
}

.login-theme-light .form-label-custom {
    color: #64748b !important;
}

.login-theme-light .login-checkbox-label {
    color: #334155 !important;
}

.login-theme-light .login-footer-text {
    color: #475569 !important;
}

.login-theme-light .login-footer-link {
    color: #4f46e5 !important;
}

.login-theme-light .login-register-prompt {
    color: #64748b !important;
}