@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

body, html {
    height: 100%;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: #1a1a2e; /* Fallback color */
    overflow: hidden; /* Mencegah scrollbar karena background-wrap */
}

.background-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../img-bg/login-bg.jpeg');
    background-size: cover;
    filter: blur(6px); /* Efek blur di luar login-box */
    z-index: 1;
}

.background-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* Sedikit overlay gelap untuk meningkatkan kontras */
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    position: relative;
    z-index: 10; /* Pastikan login-container berada di atas background */
}

.login-box {
    display: grid;
    grid-template-columns: 7fr 3fr;
    width: 85vw;
    height: 90vh;
    background-image: url('../img-bg/login-bg.jpeg'); /* Gambar yang sama, tapi jernih */
    background-size: cover; /* Harus sama dengan background-wrap */
    background-attachment: fixed; /* KUNCI UTAMA EFEK JENDELA */
    background-position: center;
    border-radius: 20px;
    box-shadow: 0 15px 25px rgba(0,0,0,0.5);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative; /* Untuk menempatkan konten di atas background */
}

.login-box::before{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 20px;
    z-index: 1;
}

/* Kolom Kiri - Welcome Section */
.welcome-section {
    position: relative; /* Wajib ada agar z-index berfungsi */
    z-index: 2;  
    color: #fff;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.welcome-section .logo {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
}

.welcome-section .logo i {
    margin-right: 10px;
}

.welcome-section h1 {
    font-size: 48px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.welcome-section h2 {
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 20px;
}

.welcome-section p {
    font-size: 14px;
    font-weight: 300;
}

/* Memberi outline tegas pada semua teks di dalam welcome section */
.welcome-section h1,
.welcome-section h2,
.welcome-section p,
.welcome-section .logo {
    color: white; /* Pastikan warna teks putih */
    text-shadow:
        -0.5px -0.5px 0 #000,  
        0.5px -0.5px 0 #000,
        -0.5px  0.5px 0 #000,
        0.5px  0.5px 0 #000;
}

.form-logo {
    text-align: center; /* Membuat gambar di dalamnya ke tengah */
    margin-bottom: 20px; /* Memberi jarak antara logo dan tulisan "Login" */
}

.form-logo img {
    width: 90px; /* Atur ukuran logo sesuai keinginan */
    height: auto;
}

/* Kolom Kanan - Form Section */
.form-section {
    position: relative; /* Wajib ada agar z-index berfungsi */
    z-index: 2;  
    padding: 50px;
    backdrop-filter: blur(10px);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-section h3 {
    font-weight: 600;
    font-size: 28px;
    margin-bottom: 30px;
    color: #fff;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
    color: #fff;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: #0f172a;
}

.form-control {
    background-color: rgba(255, 255, 255, 0.1); /* Latar belakang input sedikit transparan */
    border: none;
    border-bottom: 1px solid #555;
    border-radius: 5px 5px 0 0;
    color: #fff;
    padding: 12px 40px 12px 15px; /* Ruang untuk ikon dan padding kiri */
    height: auto;
    font-size: 16px;
}

.form-control:focus {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: none;
    border-bottom-color: #28a745; /* Warna hijau dari tombol */
}

.form-control::placeholder {
    color: #fff;
}

.form-row-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 13px;
}

.form-check-label, .forgot-password {
    color: #fff;
}

.forgot-password:hover {
    color: #fff;
    text-decoration: none;
}

.btn-login {
    background-color: #28a745;
    border: none;
    color: #fff;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.btn-login:hover {
    background-color: #218838;
    color: #fff;
}

/* Custom Checkbox */
.form-check-input {
    background-color: transparent;
    border: 1px solid #555;
    border-radius: 2px;
}
.form-check-input:checked {
    background-color: #28a745;
    border-color: #28a745;
}

/* Styling untuk pesan error dari Laravel */
.invalid-feedback {
    font-size: 12px;
}
.form-control.is-invalid {
    border-bottom-color: #dc3545; /* Warna merah untuk error */
}
/* Style dasar untuk body */
body {
    margin: 0;
    font-family: sans-serif;
}

/* Splash Screen Container */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #5f7d98; /* Warna solid sesuai permintaan */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 2000ms ease-out;
}

/* Logo di dalam Splash Screen */
#splash-logo {
    width: 150px; /* Sesuaikan ukuran logo Anda */
    height: auto;
    opacity: 0; /* Awalnya tidak terlihat */
    /* Menerapkan animasi logo */
    animation: logo-animation 700ms ease-out forwards;
}

/* Loader di bawah logo */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    margin-top: 20px;
    opacity: 0; /* Awalnya tidak terlihat */
    /* Menerapkan animasi putaran & fade-in */
    animation: spin 1s linear infinite, fade-in 300ms ease-out 400ms forwards;
}

/* Keyframes untuk animasi logo (Grow -> Shrink -> Stay) */
@keyframes logo-animation {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    70% {
        transform: scale(1.1); /* Tumbuh lebih besar dari ukuran akhir */
        opacity: 1;
    }
    100% {
        transform: scale(1); /* Mengecil ke ukuran normal */
        opacity: 1;
    }
}

/* Keyframes untuk loader berputar */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Keyframes untuk loader muncul (fade-in) */
@keyframes fade-in {
    to {
        opacity: 1;
    }
}

/* Animasi untuk menyembunyikan splash screen (Wipe Up) */
#splash-screen.hiding {
    animation: wipe-up 500ms ease-in forwards;
    animation-delay: 1500ms; /* Mulai setelah 700ms */
}

@keyframes wipe-up {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-100%); /* Geser ke atas hingga hilang */
    }
}

/* Contoh styling untuk halaman login agar terlihat */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* Responsive */
@media (max-width: 992px) {
    .login-box {
        grid-template-columns: 1fr;
        width: 90%;
        max-width: 450px;
        height: auto;
    }
    .welcome-section {
        display: none; /* Sembunyikan kolom kiri pada layar kecil */
    }
    .form-section {
        border-radius: 20px;
        background: rgba(15, 23, 42, 0.8);
    }
}