:root {
  --ins-primary: #0F4C81;
  --ins-primary-dark: #0A3960;
  --ins-primary-soft: #EBF2F9;
  --ins-accent: #BD993B;
  --ins-accent-soft: #F8F1DF;
  --ins-bg: #F5F7FA;
  --ins-text: #1E2A38;
  --ins-muted: #64748B;
  --ins-radius: 18px;
}

* { -webkit-tap-highlight-color: transparent; }

body {
  background: var(--ins-bg);
  color: var(--ins-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,h2,h3,h4,h5,h6,.section-title { font-family: 'Poppins', sans-serif; }

/* ── Header ── */
.app-header {
  background: #fff;
  position: sticky; top: 0; z-index: 1030;
  box-shadow: 0 1px 10px rgba(15,76,129,.08);
  padding: .7rem 0;
}
.app-header .brand { display: flex; align-items: center; gap: .7rem; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--ins-primary-soft); color: var(--ins-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0; overflow: hidden;
}
.brand h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem; font-weight: 700; margin: 0; line-height: 1.25;
  color: var(--ins-primary);
}
.brand small { color: var(--ins-muted); font-size: .72rem; font-weight: 500; }
.header-inst {
  font-size: .75rem; font-weight: 600; color: var(--ins-muted);
  text-align: right; max-width: 220px; line-height: 1.35; display: none;
}
@media(min-width:768px) { .header-inst { display: block; } }

/* ── Nav pills ── */
.mode-switch { margin-top: 1.25rem; }
.mode-switch .nav {
  background: #fff; border-radius: 999px; padding: .35rem;
  box-shadow: 0 8px 24px rgba(15,76,129,.12); display: flex;
}
.mode-switch .nav-link {
  flex: 1; text-align: center; border-radius: 999px;
  font-weight: 600; font-size: .9rem; color: var(--ins-muted); padding: .6rem .5rem;
}
.mode-switch .nav-link.active { background: var(--ins-primary); color: #fff; }

/* ── Card ── */
.card { border: none; border-radius: var(--ins-radius); box-shadow: 0 6px 22px rgba(30,42,56,.06); }

/* ── Stepper ── */
.stepper {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; position: relative;
}
.stepper::before {
  content: ""; position: absolute; top: 17px; left: 8%; right: 8%;
  height: 3px; background: #DDE4EC; z-index: 0; border-radius: 3px;
}
.stepper .bar {
  position: absolute; top: 17px; left: 8%;
  height: 3px; background: var(--ins-primary);
  z-index: 1; border-radius: 3px; transition: width .4s ease; max-width: 84%;
}
.step-dot {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: .3rem; flex: 1;
}
.step-dot .circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; border: 3px solid #DDE4EC;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: var(--ins-muted);
  transition: all .3s ease;
}
.step-dot.active .circle { border-color: var(--ins-primary); color: var(--ins-primary); box-shadow: 0 0 0 5px var(--ins-primary-soft); }
.step-dot.done .circle { background: var(--ins-primary); border-color: var(--ins-primary); color: #fff; }
.step-dot span { font-size: .65rem; font-weight: 600; color: var(--ins-muted); text-align: center; display: none; }
.step-dot.active span { color: var(--ins-primary); }
@media(min-width:576px) { .step-dot span { display: block; } }

/* ── Step panels ── */
.step-panel { display: none; animation: fadeSlide .35s ease; }
.step-panel.active { display: block; }
@keyframes fadeSlide { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
@media(prefers-reduced-motion:reduce) { .step-panel { animation: none; } }

.section-title { font-weight: 700; font-size: 1.05rem; color: var(--ins-primary); margin-bottom: .25rem; }
.section-sub { color: var(--ins-muted); font-size: .85rem; margin-bottom: 1.1rem; }

/* ── Status choice ── */
.choice-card {
  border: 2px solid #E1E8F0; border-radius: 14px; padding: 1.1rem;
  cursor: pointer; transition: all .2s ease; height: 100%; background: #fff;
}
.choice-card:hover { border-color: var(--ins-primary); }
.choice-card.selected { border-color: var(--ins-primary); background: var(--ins-primary-soft); }
.choice-card .icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--ins-primary-soft); color: var(--ins-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: .6rem;
}
.choice-card.selected .icon { background: var(--ins-primary); color: #fff; }
.choice-card h6 { font-weight: 700; margin-bottom: .15rem; }
.choice-card p { font-size: .78rem; color: var(--ins-muted); margin: 0; }

/* ── Form ── */
.form-label { font-weight: 600; font-size: .85rem; }
.form-control,.form-select { border-radius: 10px; padding: .65rem .85rem; border-color: #DDE4EC; font-size: .9rem; }
.form-control:focus,.form-select:focus { border-color: var(--ins-primary); box-shadow: 0 0 0 .2rem rgba(15,76,129,.14); }
.required::after { content: " *"; color: #D9483B; }

/* ── Jenis pengajuan ── */
.jenis-item {
  border: 2px solid #E1E8F0; border-radius: 12px; padding: .75rem .9rem;
  margin-bottom: .6rem; display: flex; align-items: center; gap: .7rem;
  cursor: pointer; transition: all .2s; background: #fff; user-select: none;
}
.jenis-item.selected { border-color: var(--ins-primary); background: var(--ins-primary-soft); }
.jenis-item .form-check-input { width: 1.2rem; height: 1.2rem; margin: 0; flex-shrink: 0; pointer-events: none; }
.jenis-item label { font-weight: 600; font-size: .88rem; cursor: pointer; margin: 0; }

/* ── Dokumen upload ── */
.doc-upload {
  border: 2px dashed #C9D5E2; border-radius: 12px; padding: .9rem;
  margin-bottom: .75rem; background: #fff; transition: border-color .2s;
}
.doc-upload.has-file { border-style: solid; border-color: #2E9E5B; background: #F1FAF4; }
.doc-upload .doc-name { font-weight: 700; font-size: .88rem; }
.doc-upload .doc-status { font-size: .75rem; color: var(--ins-muted); }
.doc-upload.has-file .doc-status { color: #2E9E5B; font-weight: 600; }

/* ── Review ── */
.review-box { background: #fff; border: 1px solid #E1E8F0; border-radius: 12px; padding: 1rem; margin-bottom: .75rem; }
.review-box h6 { font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--ins-muted); font-weight: 700; margin-bottom: .6rem; }
.review-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; padding: .25rem 0; }
.review-row .k { color: var(--ins-muted); flex-shrink: 0; }
.review-row .v { font-weight: 600; text-align: right; word-break: break-word; }

/* ── Buttons ── */
.btn-insima { background: var(--ins-primary); color: #fff; border-radius: 10px; font-weight: 600; padding: .65rem 1.4rem; border: none; }
.btn-insima:hover,.btn-insima:focus { background: var(--ins-primary-dark); color: #fff; }
.btn-insima:disabled { background: #9FB4C9; }
.btn-outline-insima { border: 2px solid var(--ins-primary); color: var(--ins-primary); border-radius: 10px; font-weight: 600; padding: .55rem 1.3rem; background: transparent; }
.btn-outline-insima:hover { background: var(--ins-primary-soft); color: var(--ins-primary); }

.wizard-nav { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.4rem; }
.wizard-nav .btn { flex: 1; }
@media(min-width:576px) { .wizard-nav .btn { flex: 0 0 auto; min-width: 130px; } }

/* ── Success ── */
.success-panel { text-align: center; padding: 1.5rem .5rem; }
.success-icon {
  width: 78px; height: 78px; border-radius: 50%;
  background: #E8F8EE; color: #2E9E5B;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.3rem; margin: 0 auto 1rem;
}
.ticket-box {
  background: var(--ins-accent-soft); border: 2px dashed var(--ins-accent);
  border-radius: 14px; padding: 1rem; margin: 1rem auto; max-width: 340px;
}
.ticket-box .num { font-size: 1.3rem; font-weight: 800; letter-spacing: 1px; color: var(--ins-primary-dark); word-break: break-all; }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: #DDE4EC; }
.tl-item { position: relative; padding-bottom: 1.1rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -1.6rem; top: 4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 4px solid var(--ins-primary); margin-left: 0;
}
.tl-item.first::before { background: var(--ins-primary); }
.tl-item .t-status { font-weight: 700; font-size: .9rem; }
.tl-item .t-time { font-size: .72rem; color: var(--ins-muted); }
.tl-item .t-note { font-size: .82rem; color: var(--ins-text); margin-top: .15rem; }

/* ── Hero / landing ── */
.hero-eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase;
  color: var(--ins-accent); background: var(--ins-accent-soft);
  padding: .3rem .7rem; border-radius: 999px; margin-bottom: .7rem;
}
.hero-title { font-weight: 700; color: var(--ins-primary); font-size: 1.7rem; margin-bottom: .6rem; }
@media(min-width:768px) { .hero-title { font-size: 2.1rem; } }
.hero-sub { color: var(--ins-muted); font-size: .95rem; margin: 0; }

.feature-card { background: var(--ins-bg); border-radius: 14px; padding: 1.2rem; height: 100%; text-align: center; }
.fc-icon {
  width: 48px; height: 48px; border-radius: 12px; margin: 0 auto .7rem;
  background: var(--ins-primary-soft); color: var(--ins-primary);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.feature-card h6 { font-weight: 700; font-size: .92rem; }
.feature-card p { font-size: .8rem; color: var(--ins-muted); margin: 0; }

.flow { display: flex; flex-direction: column; gap: 0; }
.flow-item { display: flex; gap: 1rem; position: relative; padding-bottom: 1.5rem; }
.flow-item:last-child { padding-bottom: 0; }
.flow-item::before { content: ""; position: absolute; left: 19px; top: 42px; bottom: 4px; width: 2px; background: #DDE4EC; }
.flow-item:last-child::before { display: none; }
.flow-num {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--ins-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: 'Poppins', sans-serif; position: relative; z-index: 1;
}
.flow-item h6 { font-weight: 700; font-size: .95rem; margin-bottom: .25rem; }
.flow-item p { font-size: .85rem; color: var(--ins-muted); margin: 0; }

.info-box { background: var(--ins-primary-soft); border-left: 4px solid var(--ins-primary); border-radius: 12px; padding: 1.1rem 1.25rem; }
.info-box .ib-title { font-weight: 700; color: var(--ins-primary); font-size: .9rem; margin-bottom: .5rem; }
.info-box ul { margin: 0; padding-left: 1.1rem; }
.info-box li { font-size: .83rem; color: var(--ins-text); padding: .15rem 0; }

.cta-band {
  background: linear-gradient(135deg, var(--ins-primary), var(--ins-primary-dark));
  border-radius: var(--ins-radius); color: #fff; padding: 2rem 1.5rem; text-align: center;
}
.cta-band h4 { font-weight: 700; margin-bottom: 1rem; }

/* ── Payment ── */
.pay-box { background: #fff; border: 1px solid #E1E8F0; border-radius: 14px; padding: 1.25rem; margin-top: .75rem; }
.pay-box .pb-title { font-weight: 700; color: var(--ins-primary); font-size: .95rem; margin-bottom: .5rem; }
.pay-amount {
  background: var(--ins-accent-soft); border: 2px dashed var(--ins-accent);
  border-radius: 12px; padding: .8rem; text-align: center; margin: .75rem 0;
}
.pay-amount .a-l { font-size: .68rem; font-weight: 700; letter-spacing: 1px; color: var(--ins-muted); }
.pay-amount .a-v { font-size: 1.35rem; font-weight: 800; color: var(--ins-primary-dark); font-family: 'Poppins', sans-serif; }
.qris-img { max-width: 240px; width: 100%; border-radius: 12px; border: 1px solid #E1E8F0; display: block; margin: 0 auto; }

/* ── Stat items ── */
.stat-item {
  background: #fff; border-radius: 14px; padding: 1rem .75rem;
  text-align: center; height: 100%; box-shadow: 0 4px 14px rgba(30,42,56,.05);
}
.stat-item i { font-size: 1.4rem; color: var(--ins-accent); }
.stat-item .s-t { font-weight: 700; font-size: .9rem; margin-top: .35rem; color: var(--ins-primary); }
.stat-item .s-l { font-size: .72rem; color: var(--ins-muted); font-weight: 600; }

/* ── Footer ── */
.footer { text-align: center; color: var(--ins-muted); font-size: .78rem; padding: 1.5rem 0 2rem; margin-top: auto; }

/* ── Loading ── */
#appLoading {
  position: fixed; inset: 0; z-index: 2000; background: var(--ins-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
}

/* ── Admin styles ── */
.admin-body { --ins-primary: #0D8A8D; --ins-primary-dark: #0A6265; --ins-primary-soft: #E4F3F3; --ins-bg: #F2F8F8; }
.topbar { background: linear-gradient(135deg, #0D8A8D, #0A6265); color: #fff; padding: 1rem 0; }
.stat-card { background: #fff; border-radius: 14px; padding: .9rem 1rem; border-left: 4px solid var(--ins-accent); height: 100%; }
.stat-card .n { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.stat-card .l { font-size: .7rem; font-weight: 700; color: var(--ins-muted); text-transform: uppercase; letter-spacing: .5px; }
.p-item {
  background: #fff; border: 1px solid #E1E8F0; border-radius: 12px;
  padding: .85rem 1rem; margin-bottom: .6rem; cursor: pointer; transition: border-color .15s;
}
.p-item:hover { border-color: var(--ins-primary); }
.p-item .tk { font-size: .72rem; color: var(--ins-muted); }
.p-item .nm { font-weight: 700; font-size: .92rem; }
.p-item .jn { font-size: .78rem; color: var(--ins-muted); }
.detail-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ins-muted); }
