:root {
    /* TEMA DARK (Default) */
    --primary: #60a5fa;
    --accent: #ec4899;
    --bg-color: #020617;
    --glass-card: rgba(15, 23, 42, 0.9);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text: #f8fafc;
    --input-bg: rgba(0, 0, 0, 0.3);
    --pill-bg: rgba(0, 0, 0, 0.6);
    --option-bg: #0f172a;
    --option-text: #ffffff;
}

.light-theme {
    /* TEMA LIGHT */
    --bg-color: #f8fafc;
    --glass-card: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.05);
    --text: #1e293b;
    --input-bg: rgba(255, 255, 255, 0.9);
    --pill-bg: rgba(255, 255, 255, 0.8);
    --option-bg: #ffffff;
    --option-text: #000000;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }

body {
    background: var(--bg-color);
    color: var(--text);
    height: 100vh;
    overflow: hidden; 
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.5s ease, color 0.5s ease;
}

/* --- KONTROL ATAS --- */
.top-bar {
    position: fixed; top: 20px; right: 20px; z-index: 100;
    opacity: 0; transition: opacity 1s 1s;
}
.top-bar.show { opacity: 1; }

.control-pill {
    background: var(--pill-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 50px;
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.icon-btn { 
    background: none; border: none; cursor: pointer; 
    font-size: 16px; transition: transform 0.2s; color: var(--text);
    display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { transform: scale(1.2); color: var(--primary); }

/* Pemisah vertikal kecil */
.divider { width: 1px; height: 16px; background: var(--glass-border); }

/* --- CARD UTAMA --- */
#main-interface {
    opacity: 0; visibility: hidden; transform: scale(0.95);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%; display: flex; justify-content: center;
    position: relative; z-index: 10;
}
.reveal-content { opacity: 1 !important; visibility: visible !important; transform: scale(1) !important; }

.glass-card {
    background: var(--glass-card);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px 25px;
    width: 90%;
    max-width: 480px; 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    display: flex; flex-direction: column;
    max-height: 85vh; 
}

/* --- FORM STYLING --- */
.form-scroll { 
    overflow-y: auto; 
    padding-right: 5px; 
    padding-bottom: 20px;
    flex-grow: 1; 
}
.form-scroll::-webkit-scrollbar { width: 0px; background: transparent; }

.form-section {
    margin-bottom: 35px; 
    border-bottom: 1px dashed var(--glass-border);
    padding-bottom: 20px;
}
.form-section:last-child { border-bottom: none; margin-bottom: 0; }

.label-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}

.label-title {
    font-size: 12px; font-weight: 800; color: var(--primary);
    text-transform: uppercase; letter-spacing: 1.5px;
}

/* BADGE UMUR */
.age-badge {
    font-size: 10px; font-weight: 700; color: var(--accent);
    background: rgba(236, 72, 153, 0.1);
    padding: 2px 8px; border-radius: 8px;
    border: 1px solid rgba(236, 72, 153, 0.2);
    display: none; /* Sembunyi kalau belum isi tanggal */
}
.age-badge.show { display: inline-block; animation: popIn 0.3s; }
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

.label-desc {
    font-size: 11px; opacity: 0.7; margin-bottom: 15px; display: block; line-height: 1.4;
}

input, select, textarea {
    width: 100%;
    background: var(--input-bg) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text) !important;
    padding: 16px 18px; 
    border-radius: 16px; 
    font-size: 15px; 
    outline: none;
    margin-bottom: 12px; 
    transition: 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary) !important;
    background: rgba(96, 165, 250, 0.15) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.2);
}

select option { background-color: var(--option-bg); color: var(--option-text); }

/* LOADING SCREEN */
#loading-layer {
    position: fixed; inset: 0; background: var(--bg-color); z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 0.8s ease-out, visibility 0.8s;
}
.spinner {
    width: 50px; height: 50px;
    border: 4px solid rgba(255,255,255,0.1); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 1s infinite linear; margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ANIMASI LAIN */
.hidden { display: none; opacity: 0; }
.fade-in { animation: fadeIn 0.6s forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.canvas-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }