/* ─── RESET & BASE ─────────────────────────────────────────────────────────── */
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html{scroll-behavior:smooth;font-size:16px}
body{
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  background:#060d1a;
  color:#e2e8f0;
  min-height:100vh;
  overflow-x:hidden;
  background-image:
    radial-gradient(ellipse at 20% 0%,rgba(56,189,248,.08),transparent 50%),
    radial-gradient(ellipse at 80% 100%,rgba(129,140,248,.06),transparent 50%);
  background-attachment:fixed;
}
#app{width:100%;max-width:480px;margin:0 auto;padding-bottom:env(safe-area-inset-bottom,24px)}

/* ─── HEADER ───────────────────────────────────────────────────────────────── */
header{
  background:rgba(6,13,26,.85);
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  border-bottom:1px solid rgba(56,189,248,.15);
  padding:14px 16px 0;
  position:sticky;top:0;z-index:100;
}
.header-inner{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.logo-wrap img,.logo-wrap span{height:40px;display:block}
h1{font-size:16px;font-weight:800;color:#38bdf8;letter-spacing:-.3px;line-height:1.2}
header p{font-size:11px;color:#64748b;margin-top:2px}
.progress-bar{height:3px;background:rgba(255,255,255,.08);overflow:hidden}
.progress-fill{height:100%;background:linear-gradient(90deg,#38bdf8,#818cf8,#a78bfa);transition:width .5s cubic-bezier(.4,0,.2,1);width:0%}
.progress-label{font-size:10px;color:#475569;text-align:right;padding:3px 0 6px}

/* ─── MAIN ─────────────────────────────────────────────────────────────────── */
main{padding:12px 12px 0}

/* ─── CARDS ────────────────────────────────────────────────────────────────── */
.card{
  background:linear-gradient(145deg,rgba(30,41,59,.95),rgba(15,23,42,.98));
  border:1px solid rgba(51,65,85,.8);
  border-radius:20px;
  padding:18px 16px;
  margin-bottom:12px;
  box-shadow:0 4px 24px rgba(0,0,0,.3);
  position:relative;
  overflow:hidden;
}
.card::before{
  content:'';position:absolute;top:0;left:0;right:0;height:1px;
  background:linear-gradient(90deg,transparent,rgba(56,189,248,.3),transparent);
}
.card h2{
  font-size:14px;font-weight:700;color:#38bdf8;
  margin-bottom:5px;display:flex;align-items:center;gap:6px;
}
.q-desc{font-size:12.5px;color:#94a3b8;margin-bottom:12px;line-height:1.55}

/* ─── FIELDS ───────────────────────────────────────────────────────────────── */
.field{margin-bottom:12px}
.field label{
  display:block;font-size:11px;font-weight:700;color:#64748b;
  margin-bottom:5px;text-transform:uppercase;letter-spacing:.6px;
}
input[type=text],input[type=date],input[type=number],textarea,.input-select{
  width:100%;
  background:rgba(15,23,42,.8);
  border:1.5px solid rgba(51,65,85,.9);
  border-radius:12px;
  padding:11px 14px;
  color:#e2e8f0;
  font-size:14px;
  font-family:inherit;
  outline:none;
  transition:border-color .2s,box-shadow .2s;
  -webkit-appearance:none;
  appearance:none;
}
input:focus,textarea:focus,.input-select:focus{
  border-color:#38bdf8;
  box-shadow:0 0 0 3px rgba(56,189,248,.12);
}
textarea{resize:vertical;min-height:80px;line-height:1.5}
input[type=number]{-moz-appearance:textfield}
input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none}

/* ─── OPTIONS (radio) ──────────────────────────────────────────────────────── */
.options{display:flex;flex-direction:column;gap:7px}
.opt{
  display:flex;align-items:center;gap:10px;
  background:rgba(15,23,42,.7);
  border:1.5px solid rgba(51,65,85,.8);
  border-radius:14px;
  padding:11px 14px;
  cursor:pointer;
  transition:all .18s ease;
  -webkit-user-select:none;user-select:none;
  min-height:48px;
}
.opt:active{transform:scale(.98)}
.opt input[type=radio]{
  width:18px;height:18px;
  accent-color:#38bdf8;
  flex-shrink:0;cursor:pointer;
}
.opt span{flex:1;font-size:13px;color:#cbd5e1;line-height:1.4}
.opt:has(input:checked){
  border-color:#38bdf8;
  background:rgba(56,189,248,.1);
  box-shadow:0 0 0 1px rgba(56,189,248,.2);
}
.opt:has(input:checked) span{color:#e0f2fe;font-weight:600}

/* ─── GPS ──────────────────────────────────────────────────────────────────── */
.gps-box{
  background:rgba(15,23,42,.8);
  border:1.5px solid rgba(51,65,85,.8);
  border-radius:14px;
  padding:14px;
  text-align:center;
  margin-bottom:4px;
}
.gps-status{font-size:12px;color:#64748b;margin-bottom:6px}
.gps-coords{font-size:12px;color:#38bdf8;font-family:'SF Mono',monospace;margin-bottom:10px;min-height:14px;word-break:break-all}
.map-link{display:inline-block;margin-top:6px;font-size:12px;color:#818cf8;text-decoration:none;padding:4px 10px;border:1px solid rgba(129,140,248,.3);border-radius:8px}

/* ─── VIDEO ────────────────────────────────────────────────────────────────── */
.video-box{
  background:rgba(15,23,42,.8);
  border:1.5px solid rgba(51,65,85,.8);
  border-radius:14px;
  padding:14px;
  margin-bottom:12px;
}
.video-placeholder{
  height:110px;display:flex;align-items:center;justify-content:center;
  color:#475569;font-size:13px;
  border:2px dashed rgba(51,65,85,.8);
  border-radius:10px;margin-bottom:10px;
}
#videoPreview{width:100%;border-radius:10px;margin-bottom:10px;max-height:180px;object-fit:cover}
.video-controls{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:6px}
.video-status{font-size:11px;color:#94a3b8;min-height:14px}
.recorded-item{
  display:flex;align-items:center;gap:8px;
  background:rgba(30,41,59,.8);border-radius:8px;
  padding:7px 10px;margin-top:5px;font-size:12px;color:#94a3b8;
}

/* ─── TRACKING ─────────────────────────────────────────────────────────────── */
.tracking-box{
  background:rgba(15,23,42,.8);
  border:1.5px solid rgba(51,65,85,.8);
  border-radius:14px;
  padding:14px;
  margin-bottom:12px;
}
.tracking-status{font-size:12px;color:#64748b;margin-bottom:8px;text-align:center}
.tracking-stats{display:flex;gap:14px;justify-content:center;margin-bottom:10px;flex-wrap:wrap}
.tracking-stats span{font-size:12px;color:#94a3b8}
.tracking-stats b{color:#38bdf8}
.tracking-controls{display:flex;gap:7px;justify-content:center;margin-bottom:10px}
#trackCanvas{width:100%;border-radius:10px;border:1px solid rgba(51,65,85,.6);margin-top:6px}

/* ─── BUTTONS ──────────────────────────────────────────────────────────────── */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:5px;
  padding:10px 16px;border-radius:12px;
  font-size:13px;font-weight:600;font-family:inherit;
  border:none;cursor:pointer;
  transition:all .18s ease;
  min-height:44px;
  -webkit-user-select:none;user-select:none;
  white-space:nowrap;
}
.btn:active{transform:scale(.96)}
.btn-gps{
  background:linear-gradient(135deg,#0ea5e9,#6366f1);
  color:#fff;width:100%;
  box-shadow:0 4px 16px rgba(14,165,233,.3);
}
.btn-video{background:rgba(30,58,95,.9);color:#38bdf8;border:1.5px solid rgba(56,189,248,.4)}
.btn-record{background:#dc2626;color:#fff}
.btn-record.recording{background:#991b1b;animation:pulse 1s infinite}
.btn-stop{background:rgba(71,85,105,.8);color:#e2e8f0}
.btn-track-start{background:linear-gradient(135deg,#059669,#0d9488);color:#fff;box-shadow:0 4px 14px rgba(5,150,105,.3)}
.btn-track-stop{background:#dc2626;color:#fff}
.btn-submit{
  background:linear-gradient(135deg,#38bdf8,#818cf8);
  color:#fff;width:100%;
  font-size:15px;font-weight:700;
  padding:16px;border-radius:16px;
  box-shadow:0 6px 24px rgba(56,189,248,.35);
  letter-spacing:.3px;
}
.btn-submit:active{transform:scale(.98)}
.btn-print{background:rgba(30,58,95,.9);color:#38bdf8;border:1.5px solid rgba(56,189,248,.4);flex:1}
.btn-new{background:linear-gradient(135deg,#059669,#0d9488);color:#fff;flex:1}
.submit-area{padding:8px 12px 20px}

/* ─── SECTION DIVIDER ──────────────────────────────────────────────────────── */
.section-divider{
  background:linear-gradient(135deg,rgba(30,58,95,.9),rgba(15,39,68,.9));
  color:#38bdf8;font-size:12px;font-weight:800;
  letter-spacing:1.5px;text-align:center;
  padding:11px;border-radius:14px;
  margin:4px 12px 12px;
  border:1px solid rgba(56,189,248,.2);
  text-transform:uppercase;
}

/* ─── CALC RESULT ──────────────────────────────────────────────────────────── */
.calc-result{
  background:rgba(15,23,42,.8);
  border-radius:12px;padding:12px;
  margin-top:12px;
  border:1px solid rgba(51,65,85,.7);
}
.calc-row{
  display:flex;justify-content:space-between;align-items:center;
  padding:6px 0;border-bottom:1px solid rgba(30,41,59,.8);
  font-size:12.5px;
}
.calc-row:last-child{border-bottom:none}
.calc-row span{color:#94a3b8}
.calc-row b{color:#38bdf8;font-size:13px}
.calc-row.highlight b{color:#22c55e;font-size:14px}
.calc-row.total{border-top:1.5px solid rgba(51,65,85,.8);margin-top:4px;padding-top:9px}
.calc-row.total span{color:#e2e8f0;font-weight:700;font-size:13px}
.calc-row.total b{color:#f59e0b;font-size:15px}
.calc-row.total-sub span{color:#94a3b8}
.calc-row.total-sub b{color:#f59e0b}

/* ─── CHECKLIST ────────────────────────────────────────────────────────────── */
.checklist-group{
  background:rgba(15,23,42,.8);border-radius:12px;
  padding:12px;margin-top:10px;
  border:1px solid rgba(51,65,85,.7);
}
.checklist-title{font-size:11px;color:#64748b;text-transform:uppercase;letter-spacing:.6px;margin-bottom:8px;font-weight:700}
.check-item{
  display:flex;align-items:center;gap:10px;
  padding:9px 0;border-bottom:1px solid rgba(30,41,59,.8);
  cursor:pointer;font-size:13px;color:#94a3b8;
  min-height:44px;
}
.check-item:last-child{border-bottom:none}
.check-item input[type=checkbox]{width:18px;height:18px;accent-color:#38bdf8;flex-shrink:0;cursor:pointer}
.check-item:has(input:checked) span{color:#22c55e}

/* ─── BIAYA ────────────────────────────────────────────────────────────────── */
.biaya-group{
  background:rgba(15,23,42,.8);border-radius:12px;
  padding:12px;margin-bottom:12px;
  border:1px solid rgba(51,65,85,.7);
}
.biaya-row{
  display:flex;justify-content:space-between;align-items:center;
  gap:8px;padding:6px 0;
  border-bottom:1px solid rgba(30,41,59,.8);
}
.biaya-row:last-child{border-bottom:none}
.biaya-row label{font-size:12px;color:#94a3b8;flex:1;line-height:1.4}
.biaya-row input{
  width:110px;background:rgba(30,41,59,.9);
  border:1px solid rgba(51,65,85,.8);
  border-radius:8px;padding:6px 8px;
  color:#e2e8f0;font-size:12px;text-align:right;
  outline:none;
}
.biaya-row input:focus{border-color:#38bdf8}

/* ─── RESULT ───────────────────────────────────────────────────────────────── */
#resultSection{padding:12px}
.result-card{
  background:linear-gradient(145deg,rgba(30,41,59,.98),rgba(15,23,42,1));
  border:1px solid rgba(51,65,85,.8);
  border-radius:24px;padding:24px 16px;text-align:center;
  box-shadow:0 8px 40px rgba(0,0,0,.5);
}
.result-icon{font-size:56px;margin-bottom:10px;line-height:1}
.result-score{font-size:52px;font-weight:900;margin-bottom:2px;letter-spacing:-2px}
.result-label{font-size:17px;font-weight:800;margin-bottom:18px;letter-spacing:.5px}
.result-bar-wrap{margin-bottom:20px}
.result-bar{height:10px;background:rgba(15,23,42,.8);border-radius:99px;overflow:hidden}
.result-bar-fill{height:100%;border-radius:99px;transition:width 1.2s cubic-bezier(.4,0,.2,1)}
.result-breakdown,.result-teknis{
  text-align:left;background:rgba(15,23,42,.8);
  border-radius:14px;padding:14px;margin-bottom:12px;
  border:1px solid rgba(51,65,85,.6);
}
.result-breakdown h3,.result-teknis h3{
  font-size:11px;color:#64748b;text-transform:uppercase;
  letter-spacing:.6px;margin-bottom:10px;font-weight:700;
}
.breakdown-item{
  display:flex;justify-content:space-between;align-items:center;
  padding:6px 0;border-bottom:1px solid rgba(30,41,59,.8);font-size:12.5px;
}
.breakdown-item:last-child{border-bottom:none}
.breakdown-item .q-name{color:#94a3b8}
.result-info{
  background:rgba(15,23,42,.8);border-radius:14px;
  padding:14px;margin-bottom:16px;text-align:left;
  font-size:12.5px;color:#94a3b8;line-height:1.7;
  border:1px solid rgba(51,65,85,.6);
}
.result-info strong{color:#e2e8f0;display:block;margin-bottom:4px;font-size:11px;text-transform:uppercase;letter-spacing:.6px}
.result-actions{display:flex;gap:8px}

/* ─── STATUS COLORS ────────────────────────────────────────────────────────── */
.layak .result-score{color:#22c55e}
.layak .result-label{color:#22c55e}
.layak .result-bar-fill{background:linear-gradient(90deg,#22c55e,#16a34a)}
.pertimbangan .result-score{color:#f59e0b}
.pertimbangan .result-label{color:#f59e0b}
.pertimbangan .result-bar-fill{background:linear-gradient(90deg,#f59e0b,#d97706)}
.tidak-layak .result-score{color:#ef4444}
.tidak-layak .result-label{color:#ef4444}
.tidak-layak .result-bar-fill{background:linear-gradient(90deg,#ef4444,#dc2626)}

/* ─── SECTION TEKNIS RESULT ────────────────────────────────────────────────── */
.result-teknis .calc-row{font-size:12px}

/* ─── ANIMATIONS ───────────────────────────────────────────────────────────── */
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.5}}
@keyframes fadeUp{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:translateY(0)}}
.card{animation:fadeUp .3s ease both}
.card:nth-child(1){animation-delay:.05s}
.card:nth-child(2){animation-delay:.1s}
.card:nth-child(3){animation-delay:.15s}

/* ─── SAFE AREA (iPhone notch) ─────────────────────────────────────────────── */
header{padding-top:max(14px,env(safe-area-inset-top))}
.submit-area{padding-bottom:max(20px,env(safe-area-inset-bottom))}

/* ─── PRINT ────────────────────────────────────────────────────────────────── */
@media print{
  header,#formSection,.result-actions,#resultSection .btn{display:none!important}
  #resultSection{display:block!important;padding:0}
  body{background:#fff;color:#000}
  .result-card{border:1px solid #ccc;box-shadow:none;background:#fff}
  .result-breakdown,.result-teknis,.result-info{background:#f9f9f9;border:1px solid #ddd}
  .result-score,.result-label,.calc-row b,.breakdown-item .q-name{color:#000!important}
}
