/* ================= DESIGN TOKENS ================= */
:root {
    --bg-color: #f8fafc; --surface-color: #ffffff;
    --text-main: #0f172a; --text-muted: #64748b;
    --primary: #2563eb; --primary-hover: #1d4ed8;
    --success: #10b981; --danger: #ef4444; --warning: #f59e0b; --info: #0ea5e9;
    --border: #e2e8f0; --card-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --nav-bg: rgba(255, 255, 255, 0.95); --input-bg: #f8fafc;
}

[data-theme="dark"] {
    --bg-color: #0f172a; --surface-color: #1e293b;
    --text-main: #f8fafc; --text-muted: #94a3b8;
    --primary: #3b82f6; --primary-hover: #60a5fa;
    --border: #334155; --card-shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
    --nav-bg: rgba(30, 41, 59, 0.95); --input-bg: #0f172a;
}

/* ================= RESET & LAYOUT ================= */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background: var(--bg-color); color: var(--text-main); transition: 0.3s ease; }
h1, h2, h3, h4 { font-weight: 600; margin-bottom: 12px; }
p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }

/* ================= HEADER ATAS (LOGO KIRI, LOGIN KANAN) ================= */
.top-header {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 70px;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
}
.brand { font-size: 1.3rem; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 8px;}
.brand svg { width: 24px; height: 24px; fill: currentColor; }

.top-right-auth { display: flex; align-items: center; }
.navbar-login-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.navbar-login-form input {
    width: 130px;
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text-main);
}
.navbar-login-form button {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* ================= NAVBAR BAWAH ================= */
.bottom-nav { 
    background: var(--nav-bg); 
    backdrop-filter: blur(12px); 
    border-top: 1px solid var(--border); 
    position: fixed; 
    bottom: 0; left: 0;
    width: 100%; 
    height: 65px;
    z-index: 1000; 
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    padding: 0 10px; 
}
.nav-btn { 
    background: transparent; 
    border: none; 
    color: var(--text-muted); 
    font-weight: 600; 
    font-size: 0.75rem; 
    padding: 8px; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.2s; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 4px; 
}
.nav-btn:hover { color: var(--primary); }
.nav-btn.active { color: var(--primary); }
.nav-btn svg { width: 20px; height: 20px; }
.theme-toggle-btn { background: var(--surface-color); border: 1px solid var(--border); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; margin-left: 10px; cursor: pointer;}

/* ================= SNAP SCROLL CONFIGURATION ================= */
html { scroll-snap-type: y mandatory; scroll-behavior: smooth; }
.app-container.snap-wrapper { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }

.snap-section {
    height: 100vh; height: 100dvh;
    scroll-snap-align: start; scroll-snap-stop: always;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 90px 40px 80px 40px; 
    box-sizing: border-box; overflow-y: auto; position: relative; width: 100vw;
}

/* Dashboard internal terlepas dari snap scroll */
.post-login-page {
    display: none; scroll-snap-align: none; height: auto;
    padding: 100px 20px 100px 20px; max-width: 1100px; margin: 0 auto;
}
.post-login-page.active { display: block; animation: fadeIn 0.4s ease; }

/* ================= COMPONENTS ================= */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.card { background: var(--surface-color); border-radius: 16px; padding: 24px; margin-bottom: 20px; border: 1px solid var(--border); box-shadow: var(--card-shadow); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; width: 100%; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card { padding: 20px; border-radius: 16px; color: white; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; box-shadow: var(--card-shadow);}
.stat-card::after { content:''; position:absolute; right:-20px; bottom:-20px; width:100px; height:100px; background:rgba(255,255,255,0.15); border-radius:50%; }
.stat-title { font-size: 0.85rem; opacity: 0.9; margin-bottom: 5px; font-weight: 500;}
.stat-value { font-size: 1.8rem; font-weight: 700; z-index: 1;}

.form-group { margin-bottom: 16px; text-align: left; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; color: var(--text-muted); }
input, select, textarea { width: 100%; padding: 12px 14px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px; color: var(--text-main); outline: none; transition: 0.2s; font-size: 0.95rem; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); background: var(--surface-color);}

.btn { padding: 10px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; border: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: 0.2s; font-size: 0.9rem;}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: white; } .btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: rgba(16, 185, 129, 0.1); color: var(--success); } .btn-success:hover { background: var(--success); color: white;}
.btn-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); } .btn-danger:hover { background: var(--danger); color: white;}
.btn-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); } .btn-warning:hover { background: var(--warning); color: white;}

.search-bar { display: flex; align-items: center; background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px; padding: 5px 15px; margin-bottom: 15px;}
.search-bar input { border: none; background: transparent; padding: 8px 0; box-shadow: none !important; }

.tab-container { display: flex; gap: 10px; margin-bottom: 24px; background: var(--surface-color); padding: 8px; border-radius: 12px; border: 1px solid var(--border); overflow-x: auto;}
.tab-btn { flex: 1; padding: 12px; background: transparent; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--text-muted); transition: 0.2s; white-space: nowrap;}
.tab-btn.active { background: var(--primary); color: white; }
.sub-content { display: none; } .sub-content.active { display: block; animation: fadeIn 0.3s ease;}

/* Tables & Badges */
.table-responsive { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; text-align: left; background: var(--surface-color); white-space: nowrap; }
th { background: rgba(0,0,0,0.02); padding: 14px 16px; font-size: 0.85rem; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; font-size: 0.9rem; border-bottom: 1px solid var(--border); vertical-align: middle;}
[data-theme="dark"] th { background: rgba(255,255,255,0.02); }
.badge { padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-lunas { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-dp { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

/* Riwayat Pembayaran & Pagination */
.riwayat-item { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px 14px; border:1px solid var(--border); border-radius:10px; margin-bottom:8px; background:var(--input-bg); }
.riwayat-item p { font-size: 0.8rem; margin: 0; }
.pagination-bar { display:flex; justify-content:space-between; align-items:center; padding:15px 20px; flex-wrap:wrap; gap:10px; }

/* Modals & Toasts */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 2000; display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s;}
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content { background: var(--surface-color); padding: 24px; border-radius: 16px; width: 90%; max-width: 500px; max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); transform: scale(0.9); transition: transform 0.3s;}
.modal-content.modal-wide { max-width: 680px; }
.modal-overlay.active .modal-content { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 15px;}
.close-modal { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }

#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none;}
.toast { background: var(--surface-color); color: var(--text-main); padding: 14px 20px; border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-left: 4px solid var(--primary); display: flex; align-items: center; gap: 10px; animation: slideIn 0.3s forwards; font-weight: 500;}
.toast.error { border-left-color: var(--danger); } .toast.success { border-left-color: var(--success); } .toast.fade-out { animation: fadeOut 0.3s forwards; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { transform: translateX(100%); opacity: 0; } }
.icon-sm { width: 18px; height: 18px; }

/* ================= HERO BACKGROUND ================= */
.hero-section { background: url('https://images.unsplash.com/photo-1591604129939-f1efa4d9f7fa?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat; }
.hero-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.6); z-index: 0; }
.hero-container-flex { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 100%; max-width: 1100px; }
.hero-content { flex: 1; color: white; }

.scroll-indicator { position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%); color: white; cursor: pointer; z-index: 2; animation: bounce 2s infinite; }
.scroll-indicator svg { width: 32px; height: 32px; }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); } 40% { transform: translateY(-15px) translateX(-50%); } 60% { transform: translateY(-7px) translateX(-50%); } }

/* ================= PREMIUM CARDS ================= */
.paket-card-premium { background: var(--surface-color); border-radius: 16px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--card-shadow); transition: transform 0.2s; display: flex; flex-direction: column; }
.paket-card-premium:hover { transform: translateY(-5px); }
.paket-img-placeholder { height: 160px; background: linear-gradient(135deg, #1e293b, #0f172a); display: flex; align-items: center; justify-content: center; font-size: 3.5rem; position: relative; }
.paket-badge-premium { position: absolute; top: 15px; right: 15px; background: var(--primary); color: white; padding: 6px 12px; border-radius: 20px; font-weight: 700; font-size: 0.8rem; }
.paket-content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.paket-price { font-size: 1.4rem; font-weight: 800; color: var(--primary); margin: 10px 0; }
.paket-facilities { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.btn-paket-detail { margin-top: 20px; background: var(--input-bg); border: 1px solid var(--border); color: var(--text-main); padding: 10px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; width: 100%; }
.btn-paket-detail:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ================= TESTIMONIALS ================= */
.testimonial-section { background: var(--bg-color); }
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 40px; text-align: left; width: 100%; }
.testimonial-card { background: var(--surface-color); padding: 24px; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--card-shadow); }
.stars { color: var(--warning); margin-bottom: 12px; }
.testi-text { font-style: italic; margin-bottom: 20px; font-size: 0.95rem; }
.testi-user { display: flex; align-items: center; gap: 12px; }
.testi-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.testi-info h4 { margin: 0; font-size: 0.95rem; }
.testi-info p { margin: 0; font-size: 0.8rem; }

/* ================= TENTANG & FOOTER ================= */
.tentang-section { background: var(--bg-color); }
.tentang-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 35px; text-align: center; }
.tentang-item { background: var(--surface-color); padding: 24px 20px; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--card-shadow); }
.tentang-icon { width: 52px; height: 52px; margin: 0 auto 12px auto; border-radius: 14px; background: rgba(37, 99, 235, 0.1); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.tentang-item h4 { font-size: 1rem; margin-bottom: 6px; }
.tentang-item p { font-size: 0.85rem; margin: 0; }

.app-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); text-align: center; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 1.1rem; font-weight: 800; color: var(--primary); margin-bottom: 10px; }
.footer-brand svg { width: 20px; height: 20px; fill: currentColor; }
.footer-copyright { font-size: 0.8rem; margin-bottom: 4px; }
.footer-credit { font-size: 0.8rem; opacity: 0.8; }
.footer-credit strong { color: var(--text-main); }

/* ================= MOBILE OPTIMIZATION ================= */
@media (max-width: 768px) {
    .top-header { padding: 0 15px; }
    .brand { font-size: 1.1rem; }
    .brand svg { width: 20px; height: 20px; }
    .navbar-login-form { flex-wrap: wrap; row-gap: 4px; justify-content: flex-end; }
    .navbar-login-form input { width: 70px; padding: 6px; font-size: 0.75rem; }
    .navbar-login-form button.btn { padding: 6px 10px; font-size: 0.75rem; }
    .navbar-login-form .theme-toggle-btn { width: 28px; height: 28px; margin-left: 0; font-size: 0.75rem; }
    .snap-section { padding: 90px 20px 80px 20px; }
    .hero-content h1 { font-size: 1.8rem !important; margin-bottom: 12px !important;}
    .hero-content p { font-size: 0.95rem !important; }
    .grid-cards { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
    .paket-card-premium .paket-img-placeholder { height: 100px; font-size: 2rem; }
    .paket-badge-premium { font-size: 0.6rem !important; padding: 4px 8px !important; top: 10px; right: 10px; }
    .paket-content { padding: 10px; }
    .paket-card-premium h3 { font-size: 0.9rem !important; }
    .paket-price { font-size: 1rem !important; }
    .paket-facilities { display: none; }
    .btn-paket-detail { padding: 8px !important; font-size: 0.75rem !important; margin-top: 8px !important; }
}

/* ================= PREMIUM JAMAAH DASHBOARD (APPLE / LINEAR STYLE) ================= */
.jamaah-dashboard-wrapper { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 20px; }

/* Background Glow Effect */
.jamaah-bg-glow {
    position: fixed; top: -10%; left: -20%; width: 70vw; height: 70vw;
    background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, transparent 60%);
    border-radius: 50%; z-index: 0; pointer-events: none;
    animation: floatGlow 12s infinite alternate ease-in-out;
}
[data-theme="dark"] .jamaah-bg-glow { background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 60%); }
@keyframes floatGlow { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(10%, 10%) scale(1.1); } }

/* Glassmorphism Panels */
.glass-panel {
    background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255,255,255,0.5);
    border-radius: 20px; padding: 24px; position: relative; overflow: hidden;
}
[data-theme="dark"] .glass-panel {
    background: rgba(30, 41, 59, 0.4); border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Typography Enhancements */
.text-gradient { background: linear-gradient(135deg, var(--primary), #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800; }
.greeting-text { font-size: 1rem; color: var(--text-muted); margin-bottom: -5px; font-weight: 500;}
.user-name-title { font-size: 2.2rem; margin-bottom: 20px; letter-spacing: -0.5px;}

/* Countdown Hero Section */
.countdown-hero { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px 20px;}
.pulse-badge {
    background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success); padding: 6px 14px; border-radius: 30px; font-size: 0.8rem; font-weight: 600;
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 15px;
}
.pulse-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }

.countdown-grid { display: flex; gap: 15px; justify-content: center; margin-top: 20px; width: 100%; max-width: 400px;}
.cd-box {
    flex: 1; background: var(--surface-color); border: 1px solid var(--border);
    border-radius: 16px; padding: 15px 10px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.cd-num { font-size: 2rem; font-weight: 700; color: var(--text-main); font-variant-numeric: tabular-nums; line-height: 1.1;}
.cd-lbl { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-top: 5px;}

/* Info Grid (Logistics) */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; }
.info-card { display: flex; align-items: flex-start; gap: 15px; padding: 20px; border-radius: 16px;}
.info-icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(37, 99, 235, 0.1); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0;}
.info-card h4 { margin: 0 0 5px 0; font-size: 1rem; }
.info-card p { margin: 0; font-size: 0.85rem; line-height: 1.4;}

/* Segmented Control */
.segmented-control { display: flex; background: rgba(0,0,0,0.05); padding: 4px; border-radius: 14px; margin-top: 10px; position: relative; }
[data-theme="dark"] .segmented-control { background: rgba(255,255,255,0.05); }
.seg-btn {
    flex: 1; padding: 10px; border: none; background: transparent; border-radius: 10px;
    font-size: 0.85rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative; z-index: 2;
}
.seg-btn.active { color: var(--text-main); }
.seg-active-bg {
    position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(33.33% - 5px);
    background: var(--surface-color); border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1); z-index: 1;
}

/* Tab Contents & Checklists */
.jam-tab-content { display: none; margin-top: 10px; }
.jam-tab-content.active { display: block; animation: fadeInScale 0.4s forwards; }
.checklist-item {
    display: flex; align-items: center; padding: 16px; background: var(--surface-color);
    border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px;
    cursor: pointer; transition: 0.2s;
}
.checklist-item:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.checklist-item.checked { opacity: 0.6; }
.checklist-item.checked .check-box { background: var(--primary); border-color: var(--primary); color: white; }
.check-box {
    width: 24px; height: 24px; border: 2px solid var(--text-muted); border-radius: 6px;
    margin-right: 15px; display: flex; align-items: center; justify-content: center;
    transition: 0.2s; color: transparent;
}
.check-box svg { width: 14px; height: 14px; fill: currentColor; }

/* Progress & Animations */
.progress-track { height: 8px; background: rgba(0,0,0,0.05); border-radius: 4px; margin-top: 10px; overflow: hidden; }
[data-theme="dark"] .progress-track { background: rgba(255,255,255,0.05); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #8b5cf6); border-radius: 4px; transition: width 1s ease-out; }
.anim-slide-up { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; }
.anim-delay-1 { animation-delay: 0.1s; } .anim-delay-2 { animation-delay: 0.2s; } .anim-delay-3 { animation-delay: 0.3s; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInScale { from { opacity: 0; transform: scale(0.98) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }