/* ===================================================
   login.css — Light theme styling halaman login
   =================================================== */

/* === CSS VARIABLES (Light Theme) === */
:root {
    --bg-body: #f0f2f5;
    --bg-white: #ffffff;
    --bg-input: #f7f8fa;
    --bg-input-focus: #ffffff;
    --bg-hover: #f0fdf4;

    --border: #e2e5ea;
    --border-focus: #10b981;
    --border-error: #ef4444;

    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-placeholder: #c0c5ce;

    --accent: #10b981;
    --accent-dark: #059669;
    --accent-light: #d1fae5;
    --accent-glow: rgba(16, 185, 129, 0.2);
    --accent-soft: rgba(16, 185, 129, 0.06);

    --danger: #ef4444;
    --danger-light: #fef2f2;
    --danger-border: #fecaca;

    --info: #06b6d4;
    --info-light: #ecfeff;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
    --shadow-xl: 0 25px 60px rgba(0,0,0,0.1);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}


/* ===================================================
   BACKGROUND DEKORATIF
   =================================================== */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
}

.bg-shape-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.18), transparent 70%);
    top: -200px; right: -100px;
    animation: bgFloat1 20s ease-in-out infinite;
}

.bg-shape-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.12), transparent 70%);
    bottom: -150px; left: -100px;
    animation: bgFloat2 25s ease-in-out infinite;
}

.bg-shape-3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1), transparent 70%);
    top: 40%; left: 30%;
    animation: bgFloat3 15s ease-in-out infinite;
}

.bg-shape-4 {
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08), transparent 70%);
    top: 20%; right: 30%;
    animation: bgFloat1 18s ease-in-out infinite reverse;
}

@keyframes bgFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-30px, 20px) scale(1.05); }
    66% { transform: translate(15px, -15px) scale(0.97); }
}

@keyframes bgFloat2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, -30px); }
}

@keyframes bgFloat3 {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Pola titik-titik halus */
.bg-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(16, 185, 129, 0.06) 1px, transparent 1px);
    background-size: 32px 32px;
}


/* ===================================================
   LAYOUT UTAMA — Split Panel
   =================================================== */
.login-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

/* --- Panel Kiri: Branding --- */
.brand-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, #064e3b 0%, #065f46 40%, #047857 100%);
    z-index: 0;
}

/* Garis dekoratif di brand panel */
.brand-panel::after {
    content: '';
    position: absolute;
    top: -50%; right: -30%;
    width: 600px; height: 600px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.06);
    z-index: 0;
}

.brand-content {
    position: relative;
    z-index: 1;
    max-width: 460px;
    animation: brandFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

@keyframes brandFadeIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.brand-logo-icon {
    width: 44px; height: 44px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.brand-logo-icon.small {
    width: 36px; height: 36px;
    font-size: 16px;
    border-radius: var(--radius-sm);
}

.brand-logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.brand-headline {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.25;
    color: #f0fdf4;
    letter-spacing: -0.8px;
    margin-bottom: 20px;
}

.text-gradient {
    background: linear-gradient(135deg, #34d399, #6ee7b7, #a7f3d0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-desc {
    font-size: 15px;
    color: rgba(167, 243, 208, 0.7);
    line-height: 1.7;
    margin-bottom: 40px;
}

/* Fitur-fitur di brand panel */
.brand-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 60px;
}

.brand-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    opacity: 0;
    animation: featureSlide 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.brand-feature:nth-child(1) { animation-delay: 0.3s; }
.brand-feature:nth-child(2) { animation-delay: 0.45s; }
.brand-feature:nth-child(3) { animation-delay: 0.6s; }

@keyframes featureSlide {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: translateX(0); }
}

.brand-feature-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #6ee7b7;
    flex-shrink: 0;
}

.brand-feature strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #ecfdf5;
    margin-bottom: 2px;
}

.brand-feature span {
    font-size: 12px;
    color: rgba(167, 243, 208, 0.55);
}

.brand-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: rgba(167, 243, 208, 0.35);
}

.brand-dot {
    width: 3px; height: 3px;
    border-radius: 50%;
    background: rgba(167, 243, 208, 0.3);
}


/* --- Panel Kanan: Form --- */
.form-panel {
    width: 520px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--bg-white);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.04);
}

.form-content {
    width: 100%;
    max-width: 380px;
    animation: formFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.15s forwards;
    opacity: 0;
}

@keyframes formFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile logo */
.mobile-logo {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.form-header {
    margin-bottom: 32px;
}

.form-header h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.form-header p {
    font-size: 14px;
    color: var(--text-secondary);
}


/* ===================================================
   ALERT / ERROR DARI SERVER
   =================================================== */
.form-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
    animation: alertShake 0.5s ease;
}

.form-alert-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.form-alert-error i {
    font-size: 16px;
    flex-shrink: 0;
}

@keyframes alertShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-6px); }
    30% { transform: translateX(6px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
}


/* ===================================================
   FORM FIELDS
   =================================================== */
.field-group {
    margin-bottom: 20px;
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.field-link {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

.field-link:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

.field-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 14px;
    font-size: 14px;
    color: var(--text-muted);
    transition: color 0.2s;
    pointer-events: none;
    z-index: 1;
}

.field-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: all 0.25s ease;
}

.field-input::placeholder {
    color: var(--text-placeholder);
    font-weight: 400;
}

.field-input:hover {
    border-color: #d1d5db;
}

.field-input:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.field-input:focus ~ .field-icon,
.field-input:focus + .field-icon {
    color: var(--accent);
}

/* Saat input wrap difocus, icon berubah warna */
.field-input-wrap:focus-within .field-icon {
    color: var(--accent);
}

/* Error state */
.field-input.has-error {
    border-color: var(--border-error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-input-wrap.has-error .field-icon {
    color: var(--danger);
}

.field-error {
    display: block;
    font-size: 12px;
    color: var(--danger);
    margin-top: 6px;
    min-height: 0;
    overflow: hidden;
    transition: all 0.2s;
}

.field-error:empty {
    margin-top: 0;
}

/* Toggle password */
.field-toggle {
    position: absolute;
    right: 6px;
    width: 34px; height: 34px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    z-index: 1;
}

.field-toggle:hover {
    background: var(--accent-soft);
    color: var(--accent);
}


/* ===================================================
   CUSTOM CHECKBOX
   =================================================== */
.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrap input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-box {
    width: 18px; height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 5px;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-box i {
    font-size: 10px;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.checkbox-wrap input:checked + .checkbox-box {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.checkbox-wrap input:checked + .checkbox-box i {
    opacity: 1;
    transform: scale(1);
}

.checkbox-wrap:hover .checkbox-box {
    border-color: var(--accent);
}

.checkbox-text {
    font-size: 13px;
    color: var(--text-secondary);
}


/* ===================================================
   BUTTON LOGIN
   =================================================== */
.btn-login {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.3);
}

.btn-login:hover::before { opacity: 1; }

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-login-arrow {
    transition: transform 0.3s ease;
}

.btn-login:hover .btn-login-arrow {
    transform: translateX(4px);
}

/* Loader state */
.btn-login.loading .btn-login-text,
.btn-login.loading .btn-login-arrow {
    display: none;
}

.btn-login.loading .btn-login-loader {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-login-loader {
    display: none;
}

.spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ===================================================
   DIVIDER
   =================================================== */
.form-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.form-divider span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ===================================================
   BUTTON SSO
   =================================================== */
.btn-sso {
    width: 100%;
    padding: 12px 24px;
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s ease;
}

.btn-sso:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-sso:active {
    transform: translateY(0);
}

.btn-sso i {
    font-size: 16px;
}


/* ===================================================
   FOOTER TEXT
   =================================================== */
.form-footer-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 28px;
}

.form-footer-text a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.form-footer-text a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}


/* ===================================================
   TOAST NOTIFICATIONS
   =================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    min-width: 280px;
}

.toast.removing {
    animation: toastOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(40px) scale(0.95); }
}

.toast-icon {
    width: 28px; height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.toast-success .toast-icon { background: var(--accent-light); color: var(--accent); }
.toast-error .toast-icon { background: var(--danger-light); color: var(--danger); }
.toast-info .toast-icon { background: var(--info-light); color: var(--info); }


/* ===================================================
   SCROLLBAR
   =================================================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }


/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 1024px) {
    .brand-panel {
        display: none;
    }

    .form-panel {
        width: 100%;
        box-shadow: none;
    }

    .mobile-logo {
        display: flex;
    }
}

@media (max-width: 480px) {
    .form-panel {
        padding: 24px 20px;
    }

    .form-content {
        max-width: 100%;
    }

    .form-header h2 {
        font-size: 22px;
    }

    .brand-headline {
        font-size: 28px;
    }
}


/* ===================================================
   REDUCED MOTION
   =================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}