:root {
    --primary-blue: #1e3a8a;
    --dark-bg: #0f172a;
    --text-dark: #334155;
    --orange-accent: #f97316;
    --grad-red: linear-gradient(to right, #ef4444, #b91c1c);
    --grad-header: linear-gradient(to right, #1e3a8a, #3b82f6);
}

/* GLOBAL BOX SIZING */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background-color: var(--dark-bg);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* HEADER & HERO */
.main-header {
    background: white;
    padding: 15px 5%;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.brand-logo { height: 40px; width: auto; }

.hero-section {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 30px 5% 80px;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    text-align: center;
}
.hero-content { display: flex; justify-content: center; align-items: center; gap: 15px; }
.hero-icon-box i { font-size: 3rem; color: var(--primary-blue); }
.hero-text h4 { margin: 0; color: #64748b; font-size: 0.85rem; text-transform: uppercase; }
.hero-text h1 { margin: 0; color: var(--primary-blue); font-size: 1.8rem; line-height: 1.2; }
.highlight-text { color: var(--orange-accent); }

/* FORM CONTAINER (KOTAK PUTIH UTAMA) */
.floating-form-container {
    max-width: 600px;
    margin: -60px auto 30px;
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: relative;
    z-index: 5;
    /* Default Desktop Width */
    width: 90%; 
    margin-left: auto;
    margin-right: auto;
}
.calculator-form { display: flex; flex-direction: column; gap: 15px; }

.form-group label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 0.9rem; color: var(--text-dark); }
.helper-text { font-size: 0.75rem; color: #94a3b8; font-style: italic; margin-top: 5px; display: block;}

/* BUTTONS & INPUTS */
.search-box { display: flex; }
.search-box input { flex: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-search { padding: 0 20px; background: var(--primary-blue); color: white; border: none; border-radius: 10px; border-top-left-radius: 0; border-bottom-left-radius: 0; cursor: pointer; font-weight: 600; }

.custom-input { width: 100%; padding: 12px 15px; border: 2px solid #e2e8f0; border-radius: 10px; background-color: #f8fafc; font-size: 1rem; font-family: inherit; }
.custom-input:focus { border-color: var(--orange-accent); outline: none; background: white; }
.large-input { font-size: 1.3rem; font-weight: bold; color: var(--orange-accent); }

.btn-hitung {
    width: 100%; padding: 15px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white; border: none; border-radius: 10px;
    font-size: 1rem; font-weight: 700;
    cursor: pointer; box-shadow: 0 5px 15px rgba(249, 115, 22, 0.3);
    transition: 0.3s;
    margin-top: 5px;
}
.btn-hitung:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4); }

.btn-reset { width: 100%; padding: 12px; background: #cbd5e1; border: none; border-radius: 10px; color: #475569; font-weight: 600; cursor: pointer; }

/* INFO PELANGGAN */
.pelanggan-info-box { background: #ecfeff; border: 1px solid #cffafe; padding: 15px; border-radius: 10px; margin-top: -5px; }
.info-row { display: flex; margin-bottom: 5px; font-size: 0.9rem; }
.info-row .label { width: 110px; color: #64748b; font-weight: 500; }
.info-row .value { flex: 1; font-weight: 600; color: #0e7490; }
.info-row.highlight .value { color: var(--orange-accent); font-weight: 800; font-size: 1.1rem; }

/* MODAL GLOBAL */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 1000;
    display: flex; justify-content: center; align-items: center;
    padding: 20px;
    backdrop-filter: blur(3px);
}
.modal-content {
    background: white; width: 100%; max-width: 500px;
    border-radius: 15px; overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    animation: slideDown 0.3s ease-out;
}
@keyframes slideDown { from {transform: translateY(-20px); opacity: 0;} to {transform: translateY(0); opacity: 1;} }

.modal-header { background: #f1f5f9; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e2e8f0; }
.modal-header h3 { margin: 0; font-size: 1.1rem; color: var(--primary-blue); }
.close-icon { background: none; border: none; font-size: 1.8rem; cursor: pointer; color: #64748b; line-height: 1; }

.modal-body { padding: 20px; }
.text-center { text-align: center; }

/* SPESIFIK MODAL RESULT */
.header-result { background: var(--primary-blue); border-bottom: none; }
.header-result h3 { color: white; }
.text-white { color: white !important; }

.total-tagihan-card {
    background: #fff;
    border: 2px solid #fee2e2;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.05);
}
.card-body-center h5 { margin: 0; color: #94a3b8; font-size: 0.9rem; letter-spacing: 2px; }
.card-body-center h1 {
    margin: 15px 0; font-size: 3rem; font-weight: 800;
    background: var(--grad-red); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.terbilang-text { font-style: italic; color: #64748b; margin-bottom: 15px; font-size: 0.9rem; }
.detail-singkat { display: inline-block; background: #f1f5f9; padding: 5px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; color: #475569; }

/* TOMBOL TUTUP MERAH ANIMASI */
.btn-close-large {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: white;
    border: none; padding: 12px 30px; border-radius: 50px;
    font-weight: 600; cursor: pointer; font-size: 1rem;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-close-large:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.5);
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

/* LIST DI MODAL PILIH */
.list-group { display: flex; flex-direction: column; gap: 10px; }
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; border: 1px solid #e2e8f0; border-radius: 8px; transition: 0.2s; }
.list-item:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-pilih { background: var(--primary-blue); color: white; border: none; padding: 6px 15px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }

.footer { text-align: center; padding: 25px; background: #0f172a; color: #64748b; font-size: 0.8rem; border-top: 1px solid #1e293b; }

/* ==================================== */
/* RESPONSIVE KHUSUS MOBILE (HP)        */
/* ==================================== */
@media (max-width: 480px) {
    .card-body-center h1 { font-size: 2.2rem; }
    .hero-text h1 { font-size: 1.5rem; }
    
    /* 1. PERBAIKAN KOTAK UTAMA (FORM) AGAR LEBAR */
    .floating-form-container {
        width: 99% !important; /* Lebarkan hampir full layar */
        padding: 15px 12px;    /* Kurangi padding kiri-kanan */
        margin-top: -40px;     /* Naikkan sedikit biar rapi */
    }

    /* 2. PERBAIKAN POPUP TOTAL TAGIHAN AGAR KECIL/PAS */
    .modal-overlay { padding: 10px; }
    
    #modal-result .modal-content, 
    .modal-content {
        width: 90% !important; /* Popup tetap kecil */
        max-width: 330px;
        margin: 0 auto;
    }
}