/* ============================================================
   APOTEK MANAGEMENT SYSTEM - MODERN LOGIN PAGE STYLING
   Concept: Split-Screen MedTech Enterprise (Option 1)
   ============================================================ */
:root {
    --brand-primary: #087f8c;
    --brand-primary-hover: #0a95a4;
    --brand-dark: #065b64;
    --brand-deep: #062b30;
    --brand-accent: #10b981;
    --brand-surface: #f8fafc;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #062b30;
    color: var(--ink);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================================
   SPLIT SCREEN LAYOUT
   ============================================================ */
.split-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sisi Kiri: Hero Showcase Farmasi Medis */
.split-hero {
    flex: 1.15;
    background: linear-gradient(145deg, #062b30 0%, #0d484f 55%, #086972 100%);
    position: relative;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #ffffff;
    overflow: hidden;
}

/* Ambient Glow Efek */
.split-hero::before {
    content: '';
    position: absolute;
    top: -15%;
    left: -15%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, rgba(8, 127, 140, 0) 70%);
    filter: blur(50px);
    pointer-events: none;
}

.split-hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(8, 127, 140, 0.35) 0%, rgba(6, 43, 48, 0) 75%);
    filter: blur(60px);
    pointer-events: none;
}

.medical-grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 20%, transparent 80%);
    pointer-events: none;
}

/* Sisi Kanan: Form Authentication Workspace */
.split-form-wrap {
    flex: 0.85;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    position: relative;
}

/* Card Form */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Backward compatibility untuk modal registrasi & panel lama */
.login-panel {
    width: min(440px, calc(100% - 28px));
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.16);
}

/* ============================================================
   FORM FIELDS & INPUT ICONS
   ============================================================ */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-left {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s ease;
}

.auth-input,
.input-field {
    width: 100%;
    padding: 12px 14px 12px 42px;
    font-size: 14px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: inherit;
}

.auth-input:focus,
.input-field:focus {
    background: #ffffff;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(8, 127, 140, 0.14);
}

.auth-input:focus ~ .input-icon-left,
.input-field:focus ~ .input-icon-left {
    color: var(--brand-primary);
}

.toggle-password,
.password-toggle-btn {
    position: absolute;
    right: 12px;
    padding: 6px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.toggle-password:hover,
.password-toggle-btn:hover {
    color: var(--brand-primary);
    background: rgba(8, 127, 140, 0.08);
}

/* Caps Lock Warning Badge */
.capslock-badge {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #b45309;
    font-size: 12px;
    font-weight: 600;
    animation: fadeIn 0.2s ease;
}

.capslock-badge.active {
    display: flex;
}

/* ============================================================
   BUTTONS & ANIMATION
   ============================================================ */
.btn-auth-submit,
.btn-primary {
    width: 100%;
    padding: 13px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand-primary) 0%, #066570 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px -3px rgba(8, 127, 140, 0.42);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-auth-submit:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-primary-hover) 0%, var(--brand-primary) 100%);
    box-shadow: 0 12px 26px -3px rgba(8, 127, 140, 0.55);
    transform: translateY(-1.5px);
}

.btn-auth-submit:active,
.btn-primary:active {
    transform: scale(0.985);
}

.btn-auth-submit:disabled,
.btn-primary:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none !important;
}

/* Spinner */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    display: inline-block;
}

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

/* Gentle Card Shake Saat Password Salah */
@keyframes cardShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.shake-animation {
    animation: cardShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Error Banner */
.auth-error-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   GLASSMORPHISM SWEETALERT2 NOTIFICATIONS
   ============================================================ */
.swal2-container.glass-modal-backdrop {
    background: rgba(15, 23, 42, 0.55) !important;
    backdrop-filter: blur(12px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
}
.swal2-popup.modern-card {
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(28px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    border-radius: 24px !important;
    box-shadow: 
        0 24px 60px -12px rgba(15, 23, 42, 0.22),
        0 0 45px -5px rgba(8, 127, 140, 0.28),
        inset 0 1px 2px rgba(255, 255, 255, 0.95),
        inset 0 -1px 2px rgba(8, 127, 140, 0.06) !important;
    padding: 28px 24px 22px !important;
    max-width: 440px !important;
    width: min(92vw, 440px) !important;
    overflow: hidden !important;
    font-family: inherit !important;
    position: relative !important;
}
.swal2-popup.modern-card::before {
    content: '';
    position: absolute;
    top: -55px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 110px;
    background: radial-gradient(circle, rgba(8, 127, 140, 0.26) 0%, rgba(8, 127, 140, 0) 70%);
    pointer-events: none;
    z-index: 0;
}
.glass-alert-icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.glass-alert-icon-wrap:hover { transform: scale(1.05); }
.glass-alert-svg { width: 32px; height: 32px; }
.glass-icon-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(13, 148, 136, 0.08) 100%);
    border: 1.5px solid rgba(16, 185, 129, 0.4);
    color: #0d9488;
    box-shadow: 0 12px 28px -4px rgba(16, 185, 129, 0.38), 0 0 25px rgba(13, 148, 136, 0.22), inset 0 1px 2px rgba(255, 255, 255, 0.95);
}
.glass-icon-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0%, rgba(225, 29, 72, 0.08) 100%);
    border: 1.5px solid rgba(239, 68, 68, 0.4);
    color: #e11d48;
    box-shadow: 0 12px 28px -4px rgba(239, 68, 68, 0.38), 0 0 25px rgba(225, 29, 72, 0.22), inset 0 1px 2px rgba(255, 255, 255, 0.95);
}
.glass-icon-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.08) 100%);
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    color: #d97706;
    box-shadow: 0 12px 28px -4px rgba(245, 158, 11, 0.38), 0 0 25px rgba(217, 119, 6, 0.22), inset 0 1px 2px rgba(255, 255, 255, 0.95);
}
.glass-icon-info {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.18) 0%, rgba(2, 132, 199, 0.08) 100%);
    border: 1.5px solid rgba(14, 165, 233, 0.4);
    color: #0284c7;
    box-shadow: 0 12px 28px -4px rgba(14, 165, 233, 0.38), 0 0 25px rgba(2, 132, 199, 0.22), inset 0 1px 2px rgba(255, 255, 255, 0.95);
}
.glass-alert-title {
    font-size: 19px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 0 6px !important;
    text-align: center !important;
    letter-spacing: -0.018em !important;
    position: relative;
    z-index: 1;
}
.glass-alert-message {
    font-size: 14px !important;
    color: #475569 !important;
    line-height: 1.55 !important;
    text-align: center !important;
    margin: 0 0 20px !important;
    font-weight: 450 !important;
    position: relative;
    z-index: 1;
}
.swal2-popup.modern-card .swal2-actions,
.glass-alert-actions {
    margin: 6px 0 4px !important;
    gap: 12px !important;
    z-index: 1;
    position: relative;
    display: flex !important;
    justify-content: center !important;
}
.swal2-popup.modern-card .swal2-confirm,
.glass-alert-btn-confirm {
    min-width: 110px !important;
    padding: 10px 24px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    background: linear-gradient(135deg, #0d9488 0%, #087f8c 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 6px 18px -2px rgba(8, 127, 140, 0.42), 0 2px 6px rgba(0, 0, 0, 0.06), inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
}
.swal2-popup.modern-card .swal2-confirm:hover,
.glass-alert-btn-confirm:hover {
    transform: translateY(-1.5px) !important;
    box-shadow: 0 10px 24px -2px rgba(8, 127, 140, 0.55), 0 0 20px rgba(13, 148, 136, 0.35) !important;
    filter: brightness(1.06) !important;
}

/* ============================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ============================================================ */
@media (min-width: 901px) {
    .mobile-brand-header {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .split-layout {
        background: #f8fafc;
        min-height: 100vh;
    }
    .split-hero {
        display: none !important;
    }
    .split-form-wrap {
        flex: 1;
        padding: 32px 20px;
        background: #f8fafc;
    }
    .auth-card {
        box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
        border: 1px solid #e2e8f0;
        padding: 32px 24px;
        background: #ffffff;
    }
}
