/* --- VARIABLES & RESET --- */
:root {
    --primary: #002d5a;
    --primary-dark: #001f3f;
    --secondary: #ffc107;
    --danger: #dc3545;
    --success: #28a745;
    --white-grad: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 15px 40px rgba(0,0,0,0.1);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: 'Poppins', sans-serif; 
    background: #fff; 
    line-height: 1.6; 
    color: #333; 
    overflow-x: hidden;
}

/* --- NAVBAR --- */
.navbar.fixed-top {
    position: fixed; 
    top: 0; 
    width: 100%; 
    height: 80px; 
    z-index: 1000;
    background: var(--white-grad); 
    border-bottom: 3px solid var(--primary);
    display: flex; 
    align-items: center; 
    box-shadow: var(--shadow);
}

.container { 
    width: 90%; 
    max-width: 1200px; 
    margin: auto; 
}

.nav-flex { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.logo-wrapper { 
    display: flex; 
    gap: 8px; 
}

.rounded-logo { 
    width: 45px; 
    height: 45px; 
    border-radius: 50%; 
    border: 1px solid #ddd; 
    object-fit: cover; 
}

.nav-links { 
    display: flex; 
    list-style: none; 
    gap: 20px; 
    align-items: center; 
}

.nav-links a { 
    text-decoration: none; 
    color: var(--primary); 
    font-weight: 700; 
    transition: 0.3s; 
}

.nav-links a:hover { 
    color: var(--secondary); 
}

.btn-login-nav { 
    background: var(--primary); 
    color: #fff; 
    border: none; 
    padding: 8px 18px; 
    border-radius: 5px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: 0.3s; 
}

.btn-login-nav:hover { 
    background: var(--primary-dark); 
}

/* --- MENU TOGGLE (MOBILE) --- */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 80px; 
        left: 0; 
        width: 100%;
        flex-direction: column;
        background: #fff;
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        gap: 15px;
        z-index: 999;
    }
    .nav-links.active { display: flex; }
    .nav-links li { width: 100%; text-align: center; }
    .btn-login-nav { width: 80%; margin: 5px auto; }
}

.content-wrapper { 
    margin-top: 80px; 
    min-height: 80vh; 
}

.hide { 
    display: none !important; 
}

/* --- CAROUSEL WITH DYNAMIC BLUR BG --- */
.hero-carousel { 
    height: 60vh; 
    position: relative; 
    overflow: hidden; 
    background: #000; 
}

.carousel-bg-blur { 
    position: absolute; 
    inset: -10%; 
    background-size: cover; 
    background-position: center;
    filter: blur(30px) brightness(0.6); 
    z-index: 1; 
    transition: background-image 0.8s ease-in-out; 
    transform: scale(1.1); 
}

.carousel-inner { 
    position: relative; 
    z-index: 2; 
    height: 100%; 
    width: 100%;
}

.slide { 
    display: none; 
    width: 100%; 
    height: 100%; 
    align-items: center; 
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slide.active { 
    display: flex; 
    opacity: 1;
}

.slide img { 
    height: 85%; 
    width: auto; 
    max-width: 85%; 
    object-fit: contain; 
    border-radius: 10px;
    cursor: zoom-in;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
    transition: transform 0.3s ease;
}

.slide img:hover { 
    transform: scale(1.02); 
}

.carousel-nav button {
    position: absolute; 
    top: 50%; 
    z-index: 10; 
    background: rgba(255,255,255,0.2); 
    color: #fff;
    border: none; 
    padding: 15px 18px; 
    cursor: pointer; 
    border-radius: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    transition: 0.3s;
    backdrop-filter: blur(5px); 
}

.carousel-nav button:hover { 
    background: rgba(255,255,255,0.4); 
    color: var(--primary); 
}

.carousel-nav button:first-child { left: 25px; }
.carousel-nav button:last-child { right: 25px; }

/* --- SECTIONS --- */
.section { padding: 80px 0; }
.bg-light { background-color: #f9f9f9; }
.title-center { 
    text-align: center; 
    font-size: 2.2rem; 
    color: var(--primary); 
    margin-bottom: 50px; 
    font-family: 'Montserrat', sans-serif; 
    font-weight: 800; 
}

/* --- ARTICLE CARDS --- */
.article-card { display: flex; align-items: center; gap: 50px; margin-bottom: 60px; }
.article-card.reverse { flex-direction: row-reverse; }
.article-img { flex: 1; border-radius: 15px; overflow: hidden; height: 350px; box-shadow: var(--shadow); }
.article-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.article-card:hover .article-img img { transform: scale(1.05); }
.article-text { flex: 1; }
.article-text h2 { color: var(--primary); font-size: 2rem; margin-bottom: 15px; font-family: 'Montserrat', sans-serif; }
.article-text p { color: #555; font-size: 1.1rem; }
.badge { 
    background: var(--secondary); 
    color: var(--primary); 
    padding: 5px 15px; 
    border-radius: 20px; 
    font-weight: 800; 
    font-size: 0.8rem; 
    display: inline-block; 
    margin-bottom: 15px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

/* --- SCROLL REVEAL --- */
.reveal { opacity: 0; transform: translateY(40px); transition: all 1s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* --- GALLERY --- */
.gallery-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
    gap: 15px; 
}
.gallery-item { 
    height: 200px; 
    border-radius: 10px; 
    overflow: hidden; 
    background: #eee; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); 
    transition: 0.3s; 
}
.gallery-item:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.1); 
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* --- FORM & REGISTRATION CARD --- */
.registration-card { 
    background: #fff; 
    padding: 50px; 
    border-radius: 20px; 
    box-shadow: var(--shadow-lg); 
    max-width: 900px; 
    margin: auto; 
}

.form-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 20px; 
    margin-bottom: 20px; 
}

.input-box { margin-bottom: 15px; }
.input-box label { 
    display: block; 
    font-weight: 600; 
    color: var(--primary); 
    margin-bottom: 8px; 
}

.styled-form input, 
.styled-form select, 
.styled-form textarea { 
    width: 100%; 
    padding: 12px 15px; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    font-family: 'Poppins', sans-serif; 
    transition: 0.3s; 
}

.styled-form input:focus, 
.styled-form select:focus, 
.styled-form textarea:focus { 
    border-color: var(--primary); 
    outline: none; 
    box-shadow: 0 0 0 3px rgba(0,45,90,0.1); 
}

.form-divider { text-align: center; margin: 30px 0; position: relative; }
.form-divider::before { 
    content:''; position: absolute; left: 0; top: 50%; width: 100%; height: 1px; background: #eee; z-index: 1; 
}
.form-divider span { 
    background: #fff; 
    padding: 0 20px; 
    position: relative; 
    z-index: 2; 
    font-weight: 700; 
    color: var(--primary); 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

.form-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 30px; }
.btn-main { 
    background: var(--primary); 
    color: #fff; 
    border: none; 
    padding: 15px; 
    border-radius: 8px; 
    font-weight: 700; 
    cursor: pointer; 
    font-size: 1rem; 
    transition: 0.3s; 
}
.btn-main:hover { background: var(--primary-dark); }
.btn-outline { 
    background: transparent; 
    border: 2px solid #ddd; 
    color: #777; 
    padding: 15px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: 0.3s; 
}
.btn-outline:hover { border-color: #bbb; color: #333; background: #f5f5f5; }

/* --- TOAST NOTIFICATION --- */
.toast-notification {
    position: fixed;
    top: 100px; /* Di bawah navbar */
    right: 20px;
    padding: 15px 25px;
    background: var(--success);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: none;
    z-index: 3000;
    min-width: 250px;
    font-weight: 600;
}

.toast-notification.error { background: var(--danger); }

/* --- MODALS (UPDATED) --- */
.modal-overlay { 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.7); 
    z-index: 2000; 
    display: none; 
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(5px);
    padding: 2px; /* Batas ke tepi layar < 5px */
}

/* Pastikan Modal Box memiliki struktur Flex */
.modal-box { 
    background: #fff; 
    width: 98%; 
    max-width: 1000px; 
    height: calc(100vh - 4px); /* Menjaga batas atas bawah tetap tipis */
    border-radius: 10px; 
    position: relative; 
    display: flex;
    flex-direction: column; /* Menyusun header, body, footer secara vertikal */
    overflow: hidden; /* Mencegah modal utama yang scroll */
    animation: modalIn 0.3s ease; 
}

/* Container khusus untuk isi data yang bisa di-scroll */
.preview-container {
    flex: 1;
    overflow-y: auto; /* Mengaktifkan scroll vertikal */
    padding: 30px;
}

/* Bagian Header (Konfirmasi Data) */
.modal-box h3.title-center {
    margin: 0;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #fff;
    flex-shrink: 0; /* Header tidak boleh mengecil */
}

/* Bagian Footer (Tombol Ya Simpan / Batal) */
.form-btns-modal {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 15px;
    justify-content: center;
    background: #fff;
    flex-shrink: 0; /* Footer tidak boleh mengecil */
}

.close-btn { 
    position: absolute; 
    right: 20px; 
    top: 15px; 
    cursor: pointer; 
    font-size: 1.8rem; 
    color: #aaa; 
    transition: 0.3s; 
    z-index: 10;
}
.close-btn:hover { color: #333; }

/* Modal Zoom Image Tetap Sama */
.modal-overlay-zoom { 
    position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 2000; 
    display: none; align-items: center; justify-content: center; cursor: zoom-out; backdrop-filter: blur(5px); 
}
.close-zoom { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 3rem; cursor: pointer; }
.zoom-content { 
    max-width: 90%; max-height: 85%; object-fit: contain; border: 4px solid #fff; 
    border-radius: 5px; animation: zoomAnim 0.3s ease-out; box-shadow: 0 0 30px rgba(0,0,0,0.5); 
}

/* --- FOOTER --- */
.footer-main { background: var(--primary); color: rgba(255,255,255,0.8); padding: 60px 0 30px; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-logos { display: flex; gap: 10px; margin-bottom: 15px; }
.footer-info h4, .footer-social h4 { color: #fff; margin-bottom: 20px; font-family: 'Montserrat', sans-serif; }
.footer-info p { margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.social-icons { display: flex; gap: 15px; }
.social-icons a { 
    background: rgba(255,255,255,0.1); color: #fff; width: 40px; height: 40px; 
    display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: 0.3s; text-decoration: none; 
}
.social-icons a:hover { background: var(--secondary); color: var(--primary); transform: translateY(-3px); }

/* --- DETAIL DATA --- */
.preview-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.preview-row {
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid #f1f1f1; /* Garis tipis pemisah antar data */
    padding-bottom: 8px;
}

.preview-label {
    width: 220px; /* Lebar label agar teks 'Nama Lengkap Anak' sejajar */
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
}

.preview-separator {
    width: 20px;
    color: #888;
    flex-shrink: 0;
}

.preview-value {
    flex: 1;
    color: var(--primary);
    font-weight: 700;
    word-break: break-word;
}

/* Mempercantik tampilan foto kotak di modal */
#imgPreview {
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    margin-top: 10px;
    transition: transform 0.3s;
    /* Pastikan border-radius di sini juga kotak */
    border-radius: 8px; /* Kotak dengan sudut halus */
}

#imgPreview:hover {
    transform: scale(1.05);
}

/* Pastikan ini ada di file CSS Anda */
.modal-overlay-zoom { 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.9); 
    z-index: 9999; /* Pastikan paling atas */
    display: none; 
    align-items: center; 
    justify-content: center; 
    cursor: zoom-out; 
    backdrop-filter: blur(8px); 
}

.zoom-content { 
    max-width: 90%; 
    max-height: 90%; 
    object-fit: contain; 
    border: 5px solid #fff; 
    border-radius: 10px; 
    animation: zoomAnim 0.3s ease-out; 
}

@keyframes zoomAnim { 
    from { transform: scale(0.7); opacity: 0; } 
    to { transform: scale(1); opacity: 1; } 
}

/* Responsif untuk HP agar tidak terlalu sempit */
@media (max-width: 600px) {
    .preview-label {
        width: 150px; /* Ukuran lebih kecil untuk layar HP */
        font-size: 0.85rem;
    }
}
/* Tambahan: Pastikan tombol memiliki lebar yang proporsional di mobile */
@media (max-width: 480px) {
    .form-btns-modal {
        flex-direction: column; /* Tombol tumpuk ke bawah di HP agar rapi */
        align-items: center;
    }
    .form-btns-modal button {
        width: 100%; /* Tombol memenuhi lebar layar HP */
        max-width: 300px;
    }
}

/* Perbaikan area scroll modal yang sebelumnya diminta */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2px; /* Batas atas/bawah < 5px */
    z-index: 3000;
}

/* --- MODAL BOX FIX --- */
.modal-box { 
    background: #fff; 
    width: 98%; 
    max-width: 900px; 
    height: calc(100vh - 4px); /* Tetap tipis batas atas bawah */
    border-radius: 10px; 
    position: relative; 
    display: flex;
    flex-direction: column; /* Header, Body, Footer disusun vertikal */
    overflow: hidden; /* Mencegah modal utama scroll, yang scroll adalah isinya */
    animation: modalIn 0.3s ease; 
}

/* BAGIAN INI YANG MEMUNCULKAN SCROLL */
.preview-container {
    flex: 1; /* Mengambil sisa ruang yang tersedia */
    overflow-y: auto; /* Memunculkan scrollbar vertikal jika konten panjang */
    padding: 30px 40px; /* Padding agar teks tidak mepet ke tepi */
    background: #fdfdfd;
}

/* --- ANIMATIONS --- */
@keyframes modalIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes zoomAnim { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Toast Animations */
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-show { animation: slideIn 0.4s ease forwards; }