/* =====================================================================
   SILA DATANG - Sistem Desain Publik (app.css)
   Tampilan modern: glassmorphism, gradient lembut, sudut membulat.
   ===================================================================== */

:root {
    --brand-1: #4f46e5;   /* indigo */
    --brand-2: #7c3aed;   /* violet */
    --brand-3: #ec4899;   /* pink   */
    --ink: #0f172a;
    --ink-soft: #475569;
    --muted: #94a3b8;
    --bg: #eef2ff;
    --card: #ffffff;
    --ring: rgba(79, 70, 229, 0.18);
    --radius: 20px;
    --radius-sm: 12px;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow: 0 18px 45px rgba(79, 70, 229, 0.18);
    --shadow-lg: 0 30px 60px rgba(15, 23, 42, 0.18);
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #2563eb;
}

* { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
    line-height: 1.65;
    background: radial-gradient(1200px 600px at 10% -10%, rgba(124, 58, 237, 0.25), transparent 60%),
                radial-gradient(1000px 500px at 110% 10%, rgba(236, 72, 153, 0.20), transparent 55%),
                linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #db2777 100%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Animasi latar bergerak ---------- */
.bg-animation {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
.bg-animation span {
    position: absolute;
    bottom: -160px;
    display: block;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(2px);
    animation: floatUp linear infinite;
}
.bg-animation span:nth-child(1)  { left: 6%;  width: 90px;  height: 90px;  animation-duration: 22s; animation-delay: 0s;   }
.bg-animation span:nth-child(2)  { left: 16%; width: 40px;  height: 40px;  animation-duration: 16s; animation-delay: 2s;   }
.bg-animation span:nth-child(3)  { left: 26%; width: 130px; height: 130px; animation-duration: 28s; animation-delay: 4s;   }
.bg-animation span:nth-child(4)  { left: 38%; width: 60px;  height: 60px;  animation-duration: 19s; animation-delay: 0s;   }
.bg-animation span:nth-child(5)  { left: 48%; width: 110px; height: 110px; animation-duration: 25s; animation-delay: 6s;   }
.bg-animation span:nth-child(6)  { left: 58%; width: 45px;  height: 45px;  animation-duration: 17s; animation-delay: 1s;   }
.bg-animation span:nth-child(7)  { left: 66%; width: 150px; height: 150px; animation-duration: 30s; animation-delay: 3s;   }
.bg-animation span:nth-child(8)  { left: 74%; width: 55px;  height: 55px;  animation-duration: 18s; animation-delay: 5s;   }
.bg-animation span:nth-child(9)  { left: 82%; width: 100px; height: 100px; animation-duration: 24s; animation-delay: 0s;   }
.bg-animation span:nth-child(10) { left: 90%; width: 38px;  height: 38px;  animation-duration: 15s; animation-delay: 2s;   }
.bg-animation span:nth-child(11) { left: 30%; width: 70px;  height: 70px;  animation-duration: 21s; animation-delay: 7s;   }
.bg-animation span:nth-child(12) { left: 52%; width: 50px;  height: 50px;  animation-duration: 20s; animation-delay: 4s;   }

@keyframes floatUp {
    0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-115vh) rotate(360deg) scale(1.15); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .bg-animation span { animation: none; display: none; }
}

/* Pastikan konten berada di atas animasi latar */
.app-header, .container, .app-footer, .center-screen { position: relative; z-index: 1; }

/* ---------- Header ---------- */
.app-header {
    color: #fff;
    text-align: center;
    padding: 48px 16px 40px;
}
.app-header .brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .3px;
    margin-bottom: 16px;
}
.app-header h1 {
    font-weight: 800;
    letter-spacing: -0.5px;
    font-size: clamp(1.7rem, 4vw, 2.7rem);
    margin: 0 0 10px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}
.app-header p { opacity: .92; max-width: 620px; margin: 0 auto; }
.app-header .logo { display: block; height: 84px; margin: 0 auto 16px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.25)); }

/* ---------- Kartu statistik ---------- */
.stat-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.stat-card .icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff; flex-shrink: 0;
}
.icon-grad-1 { background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); }
.icon-grad-2 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.icon-grad-3 { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.stat-card .info h6 { margin: 0; font-size: .82rem; color: var(--ink-soft); font-weight: 600; }
.stat-card .info p { margin: 0; font-weight: 800; font-size: 1.5rem; color: var(--ink); }

/* ---------- Kartu form ---------- */
.glass-card {
    background: var(--card);
    border-radius: 26px;
    padding: 28px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.6);
}
@media (min-width: 768px) { .glass-card { padding: 40px 46px; } }
.card-pull-up { margin-top: 8px; position: relative; z-index: 5; }

.section-title { font-weight: 800; letter-spacing: -.3px; }
.field-hint { font-size: .82rem; color: var(--muted); }

/* ---------- Form controls ---------- */
.form-label { font-weight: 600; color: var(--ink); font-size: .92rem; margin-bottom: .35rem; }
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid #e2e8f0;
    padding: .7rem .9rem;
    font-size: .95rem;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-1);
    box-shadow: 0 0 0 .22rem var(--ring);
}
.form-step {
    border: 1.5px dashed #e2e8f0;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 18px;
    background: #fbfcff;
}
.form-step-title {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; color: var(--brand-1); margin-bottom: 16px;
}
.form-step-title .num {
    width: 28px; height: 28px; border-radius: 9px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-size: .85rem; font-weight: 700;
}

/* radio pills */
.pill-group { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-group .form-check { margin: 0; padding: 0; }
.pill-group .form-check-input { display: none; }
.pill-group .form-check-label {
    border: 1.5px solid #e2e8f0; border-radius: 999px;
    padding: .5rem 1rem; cursor: pointer; font-size: .9rem;
    transition: all .18s ease; background: #fff;
}
.pill-group .form-check-input:checked + .form-check-label {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff; border-color: transparent;
    box-shadow: 0 8px 18px var(--ring);
}

/* ---------- Buttons ---------- */
.btn { border-radius: 12px; font-weight: 600; }
.btn-brand {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    border: none; color: #fff; padding: .8rem 1.4rem;
    box-shadow: 0 12px 26px var(--ring);
    transition: transform .2s, box-shadow .2s, filter .2s;
}
.btn-brand:hover { transform: translateY(-2px); filter: brightness(1.05); color: #fff; }
.btn-lg { padding: 1rem 1.6rem; font-size: 1.05rem; }

/* ---------- Footer ---------- */
.app-footer { text-align: center; padding: 28px 16px; }
.app-footer p { color: rgba(255, 255, 255, 0.8); font-size: .85rem; margin: 0; }

/* ---------- Success / ticket ---------- */
.center-screen {
    min-height: 100vh; display: flex; align-items: center;
    justify-content: center; padding: 20px;
}
.ticket {
    background: var(--card); border-radius: 28px; padding: 36px;
    max-width: 560px; width: 100%; box-shadow: var(--shadow-lg);
    text-align: center; border: 1px solid rgba(255,255,255,.6);
}
.ticket .ticket-number {
    font-size: clamp(3rem, 12vw, 5rem); font-weight: 900; line-height: 1;
    letter-spacing: -2px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 8px 0;
}
.ticket .ticket-caption { color: var(--muted); text-transform: uppercase; letter-spacing: 2px; font-size: .78rem; font-weight: 700; }
.ticket .icon-success { font-size: 3.4rem; color: var(--success); margin-bottom: 8px; }
.ticket .queue-meta {
    display: flex; justify-content: center; gap: 28px; flex-wrap: wrap;
    margin: 20px 0; padding: 16px; background: #f8fafc; border-radius: 16px;
}
.ticket .queue-meta .m-num { font-weight: 800; font-size: 1.3rem; color: var(--ink); }
.ticket .queue-meta .m-lbl { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Rating emoji ---------- */
.rating { display: flex; flex-direction: row-reverse; justify-content: center; gap: 6px; font-size: 2.6rem; margin: 18px 0; }
.rating input { display: none; }
.rating label {
    cursor: pointer; color: #d1d5db; padding: 6px; border-radius: 50%;
    border: 2px solid transparent; transition: transform .2s, color .2s, border-color .2s;
    display: inline-block; filter: grayscale(60%);
}
.rating input:checked ~ label, .rating label:hover, .rating label:hover ~ label { color: #f59e0b; filter: grayscale(0%); }
.rating label:hover, .rating input:checked + label { transform: scale(1.18); border-color: #fcd34d; }

/* ---------- Kiosk mode ---------- */
body.kiosk-mode .app-header { padding-top: 36px; }
.kiosk-banner {
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3);
    color: #fff; border-radius: 14px; padding: 10px 16px; text-align: center;
    font-weight: 600; margin: 0 auto 4px; max-width: 720px; backdrop-filter: blur(8px);
}

/* spinner accent */
.spinner-border.text-brand { color: var(--brand-1); }

/* ---------- Laporan SKM ---------- */
.skm-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.skm-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.skm-item {
    display: flex; align-items: center; gap: 12px; text-decoration: none;
    padding: 14px 16px; border-radius: 16px; background: #f8fafc;
    border: 1px solid #e8edf3; color: var(--ink);
    transition: transform .18s, box-shadow .18s, border-color .18s, background .18s;
}
.skm-item:hover {
    transform: translateY(-2px); background: #fff;
    border-color: rgba(99,102,241,.4); box-shadow: 0 10px 24px rgba(31,41,55,.10);
}
.skm-item .skm-ico {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1.15rem; color: #fff;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
}
.skm-item .skm-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.skm-item .skm-title { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.skm-item .skm-sub { font-weight: 700; }
.skm-item .skm-arrow { margin-left: auto; color: #cbd5e1; font-size: .85rem; transition: color .18s, transform .18s; }
.skm-item:hover .skm-arrow { color: var(--brand-1); transform: translateX(2px); }

/* ---------- Blok QR pantau antrian (kiosk) ---------- */
.qr-block {
    background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 18px;
    padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.qr-box {
    background: #fff; padding: 12px; border-radius: 14px; line-height: 0;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.qr-box img, .qr-box canvas { display: block; }
.qr-caption { font-size: .9rem; color: var(--muted); line-height: 1.45; }
.qr-caption strong { color: var(--ink); }

/* ---------- Ajakan isi via HP (kiosk) ---------- */
.phone-invite {
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(168,85,247,.08));
    border: 1px solid rgba(99,102,241,.18);
}
.phone-invite .phone-invite-text { flex: 1 1 260px; }
.phone-invite .qr-box { flex: 0 0 auto; }
@media (max-width: 520px) {
    .phone-invite { flex-direction: column; text-align: center; }
}
