:root {
    --bg-page: #f8fafc;
    --card-bg: #ffffff;
    --primary: #D9251D;
    --primary-dark: #b91c15;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --input-bg: #ffffff;
    --focus-ring: rgba(217, 37, 29, 0.15);
}

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

body {
    font-family: 'Inter', sans-serif;
    height: 100vh;

    /* --- BACKGROUND IMAGE --- */
    background-image: url('/uploads/images/bg-login2.png');

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* ------------------------ */

    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
}

/* --- 1. LOADING OVERLAY --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

#loading-logo {
    width: 80px;
    height: auto;
    animation: pulseLogo 1.5s infinite ease-in-out;
}

@keyframes pulseLogo {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(0.9);
        opacity: 0.8;
    }
}

/* --- 2. WRAPPER (MENGATUR LEBAR) --- */
.login-wrapper {
    width: 100%;
    max-width: 550px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- HEADER DI LUAR --- */
.login-header-outside {
    margin-bottom: 2.5rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-logo {
    height: 55px;
    width: auto;
    display: block;
    margin: 0;
}

.brand-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.5px;
    line-height: 1;
}

/* --- 3. KARTU LOGIN (MENGATUR JARAK DALAM) --- */
.login-card {
    background-color: var(--card-bg);
    width: 100%;

    padding: 40px 50px;

    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05),
        0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border: 1px solid var(--border);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake-animation {
    animation: shake 0.5s;
    border-color: var(--primary);
}

.form-header {
    margin-bottom: 2.5rem;
    text-align: left;
}

.form-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.form-header p {
    font-size: 1rem;
    color: var(--text-muted);
}

/* --- FORM INPUT --- */
.form-group {
    margin-bottom: 1.8rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.input-box {
    position: relative;
}

.prefix-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    pointer-events: none;
    transition: color 0.2s;
    z-index: 5;
}

.input-box input {
    width: 100%;
    /* Padding kanan kembali ke default 1.2rem */
    padding: 1rem 1.2rem 1rem 3.2rem;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    transition: all 0.2s ease;
}

/* Hapus padding-right khusus untuk input[type="password"] karena toggle dihapus */
.input-box input[type="password"] {
    padding-right: 1.2rem;
}


.input-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.input-box input:focus+.prefix-icon {
    color: var(--primary);
}

.input-box input::placeholder {
    color: #cbd5e1;
}

/* DIHAPUS: STYLE UNTUK ICON TOGGLE PASSWORD (.toggle-password) */


/* TOMBOL */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 1.5rem;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-footer {
    margin-top: 3rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* Responsive HP */
@media (max-width: 600px) {
    .login-wrapper {
        max-width: 100%;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }

    .brand-title {
        font-size: 1.5rem;
    }
}