/* Custom Fonts (Pastikan file font tersedia di path ini) */
@font-face {
    font-family: "Poppins-ExtraBold";
    src: url("assets/fonts/Poppins-ExtraBold.ttf") format("truetype");
    /* Sesuaikan path jika berbeda */
    font-weight: 800;
    font-style: normal;
}

@font-face {
    font-family: "Poppins-Regular";
    src: url("assets/fonts/Poppins-Regular.ttf") format("truetype");
    /* Sesuaikan path jika berbeda */
    font-weight: 400;
    font-style: normal;
}

/* Animasi Latar Belakang Gradien */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    font-family: "Poppins", sans-serif;
    background: #570000; /* Warna dasar jika animasi tidak berjalan */
    font-weight: 400;
    font-size: 0.8em;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Penting untuk mencegah scroll yang tidak diinginkan dari animasi */
    position: relative; /* Untuk positioning background */
}

.animated-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #570000, #8b0000, #3a0000, #570000); /* Gradien warna */
    background-size: 400% 400%; /* Ukuran background lebih besar dari viewport */
    animation: gradientAnimation 15s ease infinite; /* Animasi bergerak */
    z-index: -1; /* Posisikan di belakang konten */
}

.main-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    position: relative; /* Penting untuk z-index form-column */
    z-index: 1; /* Pastikan konten utama di atas background */
}

/* DIKEMBALIKAN DAN DITATA ULANG IMAGE COLUMN */
.image-column {
    flex: 1; /* Mengambil sisa ruang */
    background-color: transparent; /* Latar belakang transparan agar animated-background terlihat */
    overflow: hidden;
    display: flex; /* Untuk memusatkan gambar di dalamnya */
    justify-content: center;
    align-items: center;
    position: relative; /* Jika Anda ingin efek overlay pada gambar */
}

.bg-image {
    width: auto;
    height:100%;
    object-fit: fix; /* Memastikan gambar menutupi seluruh area tanpa distorsi */
    display: block;
    opacity: 0.8; /* Sedikit transparan agar background animation terlihat */
}

.form-column {
    width: 550px; /* Lebar tetap untuk kolom form di desktop */
    background-color: rgba(212, 13, 13, 0.9); /* Sedikit transparan agar background terlihat */
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.4); /* Bayangan lebih intens */
    border-radius: 15px; /* Lebih rounded */
    overflow: hidden; /* Penting untuk transisi form content */
    margin: 20px; /* Jarak dari tepi layar di desktop (Opsional) */
    /* Untuk menengahkan form-column secara horizontal jika main-wrapper tidak 100% width */
    /* Tetapi dengan main-wrapper 100vw, ini tidak diperlukan kecuali di mobile */
}

/* Header Form */
.header-form {
    background-color: rgba(87, 0, 0, 0.95); /* Lebih gelap, sedikit transparan */
    padding: 20px;
    height: 15%; /* Tinggi header 15% dari kolom form */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0; /* Penting agar header tidak menyusut */
}

.header-logo {
    width: 55px;
    height: 55px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

.header-title {
    color: #ffffff;
    font-size: 1.1em;
    font-family: "Poppins-ExtraBold", sans-serif;
    font-weight: 800;
    line-height: 1.3;
}

.header-subtitle {
    color: #f1e3e3;
    font-size: 1em;
    font-family: "Poppins-Regular", sans-serif;
    font-weight: 400;
}

/* Body Form (Content Area) - Perbaikan untuk Posisi Tengah */
.body-center {
    background-color: transparent;
    padding: 30px;
    flex-grow: 1; /* Mengisi sisa ruang vertikal antara header dan footer */
    display: flex;
    flex-direction: column; /* Untuk menata form-content di dalamnya */
    justify-content: center; /* MEMUSATKAN FORM SECARA VERTIKAL DI RUANG YANG TERSEDIA */
    align-items: center;   /* MEMUSATKAN FORM SECARA HORIZONTAL DI RUANG YANG TERSEDIA */
    position: relative; /* Penting untuk penempatan form-content absolute */
    overflow: hidden; /* Penting untuk transisi form content */
}

.form-content {
    width: 100%;
    max-width: 80%; /* Batasi lebar maksimal form */
    box-sizing: border-box; /* Pastikan padding tidak menambah lebar */
    background-color: rgba(255, 255, 255, 0.1); /* Latar belakang sedikit transparan untuk form */
    border-radius: 10px;
    padding: 30px !important; /* Overwrite p-5 from Bootstrap */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);

    /* Animasi Fade In/Out dan Slide */
    position: absolute; /* Tetap absolute agar transisi posisi bisa dilakukan */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9); /* Mulai sedikit mengecil */
    opacity: 0;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out; /* Durasi dan timing function */
}

.form-content.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1); /* Kembali ke ukuran normal */
    z-index: 1; /* Pastikan form aktif di atas yang lain jika ada tumpang tindih */
}

.form-content.inactive { /* Untuk form yang akan disembunyikan */
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9); /* Mengecil saat menghilang */
}


.welcome {
    color: #ecdbdb;
    font-size: 1.1em;
    font-weight: 500;
    font-family: "Poppins-Regular", sans-serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.app-title {
    color: #ffffff;
    font-size: 1.7em;
    font-weight: 700;
    font-family: "Poppins-ExtraBold", sans-serif;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
}

.form-label {
    color: #ffffff;
    padding-bottom: 5px;
    font-size: 0.9em;
    font-weight: 500;
}

.form-control, .form-select {
    font-size: 0.9em;
    font-weight: 400;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.form-control::placeholder, .form-select::placeholder {
    color: rgba(255, 255, 255, 0.7);
}
.form-control:focus, .form-select:focus {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: #ffffff;
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.4);
    color: #ffffff;
}
.form-select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23ffffff" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1rem 1rem;
    color: #ffffff;
}
.form-select option {
    background-color: #D40D0D;
    color: #ffffff;
}


/* Custom button styles */
.btn-clear, .btn-submit {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    flex-grow: 1;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.btn-clear {
    background-color: #103179;
    color: #FEFEFE;
    border: 1px solid #103179;
}

.btn-clear:hover {
    background-color: #0d2761;
    border-color: #0d2761;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-submit {
    background-color: #FEFEFE;
    color: #570000;
    border: 1px solid #FEFEFE;
}

.btn-submit:hover {
    background-color: #f0f0f0;
    border-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-submit i, .btn-clear i {
    margin-right: 8px;
}

/* Custom form check (checkbox) */
.form-check-label {
    color: #ffffff;
    font-size: 0.85em;
    font-family: "Poppins-Regular", sans-serif;
}

.form-check-input {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}
.form-check-input:checked {
    background-color: #103179;
    border-color: #103179;
    box-shadow: 0 0 0 0.25rem rgba(16, 49, 121, 0.5);
}

/* Links di bawah form */
.small-link {
    font-size: 0.85em;
    font-weight: 500;
    transition: color 0.3s ease;
}
.small-link:hover {
    color: #f1e3e3 !important;
}


/* Footer */
.footer {
    background-color: rgba(87, 0, 0, 0.95);
    color: #c6a0a0;
    padding: 20px;
    text-align: center;
    height: 15%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1em;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0; /* Penting agar footer tidak menyusut */
}

.footer i {
    margin-right: 8px;
    color: #c6a0a0;
}

/* Invalid feedback (for Bootstrap 5 validation) */
.form-control.is-invalid, .form-select.is-invalid {
    border-color: #ffc107;
}
.invalid-feedback {
    color: #ffc107;
    font-size: 0.8em;
}

/* Spinner for buttons */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    margin-right: 8px;
}


/* --- Responsive Adjustments --- */
@media (max-width: 767.98px) {
    .main-wrapper {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    .image-column {
        display: none;
    }
    .form-column {
        width: 100%;
        height: 100vh; /* Mengambil tinggi penuh viewport di mobile */
        box-shadow: none;
        border-radius: 0;
        margin: 0;
        background-color: rgba(212, 13, 13, 0.95);
    }
    .header-form {
        height: auto;
        padding: 15px;
        justify-content: center;
        text-align: center;
    }
    .header-title, .header-subtitle {
        text-align: center;
    }
    .header .m-3 {
        margin: 1rem !important;
    }
    .header-logo {
        width: 45px;
        height: 45px;
    }
    .header-title {
        font-size: 13px;
    }
    .header-subtitle {
        font-size: 9px;
    }
    .body-center {
        padding: 15px;
        height: auto; /* Izinkan tinggi menyesuaikan konten */
        flex-grow: 1;
        overflow-y: auto; /* Aktifkan scroll di body-center jika konten terlalu panjang */
    }
    .form-content {
        max-width: 100%;
        padding: 20px !important;
        box-shadow: none;
        background-color: transparent; /* Transparan agar warna form-column terlihat */
        position: relative; /* Di mobile, form bisa menjadi relative lagi untuk flow normal */
        top: auto;
        left: auto;
        transform: none; /* Nonaktifkan transform di mobile */
        opacity: 1; /* Selalu terlihat di mobile saat aktif */
        transition: none; /* Nonaktifkan transisi di mobile jika tidak diinginkan */
    }
    /* Pastikan form yang tidak aktif tetap tersembunyi di mobile */
    .form-content:not(.active) {
        display: none !important;
    }

    .app-title {
        font-size: 1.5em;
        margin-bottom: 20px;
    }
    .footer {
        height: auto;
        padding: 15px;
        font-size: 0.8em;
    }
    .footer div {
        margin-bottom: 5px;
    }
}