/* ===== Tema Mobile JKN: putih bersih, biru langit #EBF7FC, biru tua #0088CC ===== */
.jkn {
  --sky: #EBF7FC;
  --hl: #E6F6FD;
  --blue: #0088CC;
  --blue-d: #006fa8;
  --blue-l: #9fd6ef;
  --ink: #1d2b3a;
  --muted: #6b7b8c;
  --line: #d8e9f2;
  --green: #22a06b;
  --red: #e5484d;
  --amber: #d98a00;
  --r: 14px;
  margin: 0;
  min-height: 100vh;
  background: var(--sky);
  color: var(--ink);
  font-size: 15px;
}
.jkn .ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.jkn :where(a) { color: var(--blue); }

.jkn-app { width: min(480px, 100%); margin: 0 auto; padding: 0 14px 28px; }

/* App bar */
.jkn-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  margin: 0 -14px; padding: 12px 14px;
  background: var(--blue); color: #fff;
  box-shadow: 0 4px 14px -8px rgba(0, 72, 110, .7);
}
.jkn-bar h1 { margin: 0; flex: 1; font-size: 1.05rem; font-weight: 700; }
.jkn-bar .bar-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center;
  color: #fff; background: rgba(255, 255, 255, .14); text-decoration: none; cursor: pointer;
}
.jkn-bar .bar-btn:hover { background: rgba(255, 255, 255, .26); }
.jkn-bar .bar-btn .ic { width: 20px; height: 20px; }
.bar-logo { height: 30px; width: auto; }

/* Tombol "Muat ulang" melayang */
.reload-wrap { position: sticky; top: 60px; z-index: 25; display: flex; justify-content: center; align-items: flex-start; height: 0; pointer-events: none; }
.reload-wrap .reload-pill { pointer-events: auto; }
.reload-pill {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 6px 14px; border: 0; border-radius: 999px; cursor: pointer;
  font-size: .82rem; font-weight: 700; color: #fff; background: var(--blue);
  box-shadow: 0 6px 16px -6px rgba(0, 104, 160, .8);
  transition: transform .15s ease, background-color .2s ease;
}
.reload-pill:hover { background: var(--blue-d); }
.reload-pill:active { transform: scale(.96); }
.reload-pill .ic { width: 15px; height: 15px; transition: transform .5s ease; }
.reload-pill.loading .ic { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.jkn-content { padding-top: 52px; display: flex; flex-direction: column; gap: 14px; }

.sec-label { margin: 4px 0 6px; font-size: .86rem; font-weight: 700; color: var(--blue); }
.peserta-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px; border-radius: 10px; background: #fff; border: 1.5px solid var(--blue-l);
  font-weight: 600; font-size: .9rem; text-transform: uppercase;
}
.peserta-box .ic { color: var(--blue); width: 20px; height: 20px; }
.peserta-box span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.faskes-card {
  padding: 14px 16px; border-radius: var(--r); background: #fff; border: 1.5px solid var(--blue-l);
}
.faskes-card h2 { margin: 0 0 10px; text-align: center; font-size: .98rem; font-weight: 800; text-transform: uppercase; letter-spacing: .01em; }
.info-row { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: start; font-size: .82rem; padding: 3px 0; }
.info-row dt { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.info-row dd { margin: 0; text-align: right; font-weight: 600; text-transform: uppercase; word-break: break-word; }
.info-row dd a { color: inherit; text-decoration: none; }
.ic-pin { color: var(--red); }
.ic-tel { color: var(--green); }

/* ---------- Kartu tiket ---------- */
.tiket {
  position: relative; background: #fff; border-radius: 18px;
  box-shadow: 0 14px 34px -22px rgba(0, 80, 125, .55), 0 1px 0 var(--line);
}
.tk-pad { padding: 16px; }
.tk-head { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); }
.tk-head b { display: block; font-size: .95rem; }
.tk-head small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.tk-head .tk-time { text-align: right; flex: none; }
.tk-head .tk-time b { font-weight: 700; font-size: .85rem; }

.hl-box {
  position: relative; margin-top: 12px; padding: 14px 14px 12px; border-radius: 14px; text-align: center;
  background: var(--hl); border: 1.5px solid #bfe5f6;
}
.hl-box .hl-label { font-size: .85rem; color: var(--blue); font-weight: 600; }
.hl-box .hl-num {
  display: block; margin: 4px 0 2px; font-size: clamp(2.8rem, 15vw, 3.6rem); font-weight: 800; line-height: 1.05;
  color: var(--blue); letter-spacing: .02em;
}
.hl-box .hl-kode { font-size: .8rem; color: var(--blue); }
.hl-box .hl-kode b { font-weight: 800; }
.qr-btn {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 9px; border: 0; cursor: pointer;
  display: grid; place-items: center; color: var(--blue); background: rgba(255, 255, 255, .7);
}
.qr-btn:hover { background: #fff; }
.qr-btn .ic { width: 22px; height: 22px; }
.hl-box.called { background: #fff7e6; border-color: #ffd48a; animation: called-glow 1.2s ease-in-out infinite; }
.hl-box.called .hl-num, .hl-box.called .hl-label, .hl-box.called .hl-kode { color: #b26b00; }
@keyframes called-glow { 50% { box-shadow: 0 0 0 6px rgba(255, 180, 60, .25); } }
.hl-num.bump { animation: bump .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes bump { from { transform: scale(.8); opacity: .3; } }

.tk-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; text-align: center; }
.tk-stat .st-label { display: block; font-size: .78rem; font-weight: 700; line-height: 1.25; min-height: 2.5em; }
.tk-stat .st-val { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 4px; font-size: .95rem; font-weight: 800; color: var(--ink); }
.tk-stat .st-val .ic { color: var(--muted); width: 18px; height: 18px; }
.tk-stat .st-big { font-size: 1.35rem; }
.tk-stat small { display: block; margin-top: 2px; font-size: .7rem; color: var(--muted); }
.tk-note { margin: 10px 0 0; font-size: .72rem; font-style: italic; color: var(--muted); }

/* Garis sobekan karcis */
.tk-tear { position: relative; height: 26px; }
.tk-tear::before { content: ""; position: absolute; left: 18px; right: 18px; top: 50%; border-top: 2px dashed var(--line); }
.tk-tear i {
  position: absolute; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; background: var(--sky);
  box-shadow: inset 0 0 0 1px var(--line);
}
.tk-tear i:first-child { left: -13px; clip-path: inset(0 0 0 50%); }
.tk-tear i:last-child { right: -13px; clip-path: inset(0 50% 0 0); }

.rujukan { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; text-align: center; }
.rujukan div { padding: 9px 8px; }
.rujukan div + div { border-left: 1.5px solid var(--line); }
.rujukan dt { font-size: .8rem; font-weight: 700; }
.rujukan dd { margin: 2px 0 0; font-size: .82rem; color: var(--muted); word-break: break-all; }

.status-title { margin: 16px 0 10px; font-size: .9rem; font-weight: 800; }
.stepper { list-style: none; margin: 0; padding: 0; }
.stepper li { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding-bottom: 18px; }
.stepper li:last-child { padding-bottom: 0; }
.stepper li::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: #d5dde5; }
.stepper li:last-child::before { display: none; }
.stepper li.done::before { background: var(--blue); }
.step-dot {
  position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #cfd8e0; color: #fff;
}
.step-dot .ic { width: 15px; height: 15px; stroke-width: 3; }
.stepper li.done .step-dot { background: var(--blue); }
.stepper li.current .step-dot { background: #fff; border: 3px solid var(--blue); }
.stepper li.current .step-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: pulse 1.4s ease-in-out infinite; }
.stepper li.alert .step-dot { background: #f59e0b; border: 0; animation: ring 1.2s ease-in-out infinite; }
.stepper li.cancel .step-dot { background: var(--red); }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .5; } }
@keyframes ring { 50% { box-shadow: 0 0 0 7px rgba(245, 158, 11, .25); } }
.stepper b { display: block; font-size: .92rem; color: var(--muted); font-weight: 600; }
.stepper li.done b, .stepper li.current b, .stepper li.alert b { color: var(--ink); font-weight: 700; }
.stepper p { margin: 2px 0 0; font-size: .78rem; color: var(--muted); line-height: 1.45; }
.stepper time { display: block; margin-top: 2px; font-size: .72rem; color: var(--blue); font-weight: 600; }

/* Banner dipanggil */
.called-banner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r);
  color: #fff; background: linear-gradient(120deg, #f59e0b, #e46b00);
  box-shadow: 0 14px 30px -16px rgba(228, 107, 0, .9); animation: shake-in .5s cubic-bezier(.2, 1.4, .4, 1);
}
.called-banner .ic { width: 30px; height: 30px; flex: none; animation: wiggle 1s ease-in-out infinite; }
.called-banner b { display: block; font-size: 1rem; }
.called-banner span { font-size: .85rem; opacity: .95; }
@keyframes shake-in { from { transform: scale(.9); opacity: 0; } }
@keyframes wiggle { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.alert-box { padding: 12px 14px; border-radius: 12px; font-size: .86rem; font-weight: 600; line-height: 1.45; }
.alert-red { color: #9b1c1f; background: #fdecec; border: 1px solid #f7c7c8; }
.alert-blue { color: #075985; background: #e0f2fe; border: 1px solid #bae6fd; }
.alert-green { color: #14633f; background: #e5f6ee; border: 1px solid #b7e4cd; }

/* Tombol */
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-j {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 14px; border-radius: 12px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  font-size: .9rem; font-weight: 700; transition: background-color .2s ease, transform .1s ease, box-shadow .2s ease;
}
.btn-j:active { transform: scale(.98); }
.btn-j:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }
.btn-j[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary-j { color: #fff; background: var(--blue); box-shadow: 0 10px 22px -12px rgba(0, 104, 160, .9); }
.btn-primary-j:hover { background: var(--blue-d); }
.btn-outline-j { color: var(--blue); background: #fff; border-color: var(--blue-l); }
.btn-outline-j:hover { background: var(--hl); }
.btn-block { width: 100%; }
.updated { text-align: center; font-size: .74rem; color: var(--muted); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(10, 40, 60, .5); backdrop-filter: blur(3px); animation: fade .2s ease; }
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.modal-card { width: min(360px, 100%); padding: 22px; border-radius: 18px; background: #fff; text-align: center; animation: pop .3s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.modal-card h3 { margin: 0; font-size: 1.05rem; }
.modal-card p { margin: 4px 0 14px; font-size: .84rem; color: var(--muted); }
.qr-holder { width: min(240px, 70vw); margin: 0 auto; padding: 10px; border-radius: 12px; border: 1.5px solid var(--line); }
.qr-holder svg { display: block; width: 100%; height: auto; }
.qr-kode { margin: 10px 0 14px !important; font-size: 1.4rem !important; font-weight: 800; letter-spacing: .25em; color: var(--blue) !important; }

/* ---------- Form ---------- */
.card { padding: 16px; border-radius: var(--r); background: #fff; box-shadow: 0 10px 28px -22px rgba(0, 80, 125, .55); }
.card h2 { margin: 0 0 4px; font-size: 1rem; }
.card > p { margin: 0 0 12px; font-size: .82rem; color: var(--muted); }
.f-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.f-group:last-child { margin-bottom: 0; }
.f-group label, .f-label { font-size: .84rem; font-weight: 700; }
.f-group label em, .f-label em { font-style: normal; color: var(--muted); font-weight: 500; }
.f-input {
  width: 100%; padding: 12px 13px; border-radius: 11px; border: 1.5px solid var(--line); background: #fff;
  font-size: .95rem; color: var(--ink); transition: border-color .2s ease, box-shadow .2s ease;
}
.f-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 136, 204, .14); }
.f-input.err { border-color: var(--red); }
.f-err { font-size: .78rem; color: var(--red); font-weight: 600; }
.f-hint { font-size: .76rem; color: var(--muted); }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-list { display: grid; gap: 8px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-body {
  display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
  transition: border-color .2s ease, background-color .2s ease;
}
.choice input:checked + .choice-body { border-color: var(--blue); background: var(--hl); }
.choice input:focus-visible + .choice-body { outline: 3px solid #fbbf24; }
.choice-ic { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--blue); font-weight: 800; font-size: .8rem; }
.choice-body b { display: block; font-size: .92rem; }
.choice-body small { display: block; font-size: .78rem; color: var(--muted); }
.choice-tag { margin-left: auto; flex: none; padding: 3px 8px; border-radius: 999px; font-size: .7rem; font-weight: 800; color: var(--blue); background: var(--hl); }
.poli-meta { display: none; padding: 10px 12px; border-radius: 11px; background: var(--hl); font-size: .8rem; color: #075985; }
.poli-meta.show { display: block; }

.recent { display: grid; gap: 8px; }
.recent a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line); text-decoration: none; color: var(--ink); }
.recent a b { color: var(--blue); }
.recent a small { color: var(--muted); }

.hero-mini { text-align: center; padding: 20px 10px 6px; }
.hero-mini img { height: 64px; width: auto; margin: 0 auto 8px; }
.hero-mini h2 { margin: 0; font-size: 1.15rem; }
.hero-mini p { margin: 4px 0 0; font-size: .84rem; color: var(--muted); }

.skeleton { position: relative; overflow: hidden; background: #edf3f7; border-radius: 8px; color: transparent !important; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Layar lebar: kartu tetap ramping di tengah dengan latar dekoratif */
@media (min-width: 720px) {
  .jkn { background: radial-gradient(900px 500px at 50% -10%, #cdebf8, transparent 70%), var(--sky); }
  .jkn-app { padding-bottom: 40px; }
  .jkn-bar { margin: 0; border-radius: 0 0 16px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .jkn *, .jkn *::before, .jkn *::after { animation: none !important; }
}

/* ===== Akun pasien: kartu peserta, pilihan tanggal cepat, dashboard ===== */
.me-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); color: #fff;
  background: linear-gradient(120deg, var(--blue), #12a3e0); box-shadow: 0 14px 30px -18px rgba(0, 104, 160, .9);
}
.me-avatar { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; font-weight: 800; color: var(--blue); background: #fff; }
.me-info { flex: 1; min-width: 0; }
.me-info small { display: block; font-size: .72rem; opacity: .85; font-weight: 600; }
.me-info b { display: block; font-size: 1rem; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-info span { display: block; font-size: .78rem; opacity: .9; }
.me-switch { flex: none; padding: 7px 11px; border-radius: 10px; font-size: .78rem; font-weight: 800; color: #fff !important; text-decoration: none; background: rgba(255, 255, 255, .18); }
.me-switch:hover { background: rgba(255, 255, 255, .3); }

.day-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.day-chips button {
  padding: 10px 6px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; cursor: pointer;
  font-weight: 800; font-size: .9rem; color: var(--ink); transition: border-color .2s ease, background-color .2s ease;
}
.day-chips button small { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); margin-top: 2px; }
.day-chips button.active { border-color: var(--blue); background: var(--hl); color: var(--blue); }
.tag-closed { color: #9b1c1f !important; background: #fdecec !important; }
.rujukan-box summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; font-weight: 700; font-size: .92rem; }
.rujukan-box summary::-webkit-details-marker { display: none; }
.rujukan-box summary em { font-style: normal; color: var(--muted); font-weight: 500; }
.rujukan-box summary .ic { color: var(--blue); transition: transform .25s ease; }
.rujukan-box[open] summary .ic { transform: rotate(45deg); }
.btn-xl { padding: 16px; font-size: 1.02rem; }

/* Dashboard pasien */
.dash-hero { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dash-hero h2 { margin: 0; font-size: 1.2rem; }
.dash-hero p { margin: 2px 0 0; font-size: .84rem; color: var(--muted); }
.big-cta {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; text-decoration: none; color: #fff !important;
  background: linear-gradient(120deg, var(--blue), #12a3e0); box-shadow: 0 16px 34px -18px rgba(0, 104, 160, .95);
  transition: transform .15s ease;
}
.big-cta:active { transform: scale(.98); }
.big-cta .cta-ic { flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .2); }
.big-cta .cta-ic .ic { width: 28px; height: 28px; }
.big-cta b { display: block; font-size: 1.08rem; }
.big-cta small { display: block; font-size: .8rem; opacity: .9; }
.big-cta > .ic { margin-left: auto; transform: rotate(180deg); }
.mini-tiket {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 14px 16px; border-radius: 16px; background: #fff; text-decoration: none; color: var(--ink) !important;
  box-shadow: 0 10px 26px -20px rgba(0, 80, 125, .6); border: 1.5px solid transparent; transition: border-color .2s ease;
}
.mini-tiket:hover { border-color: var(--blue-l); }
.mini-tiket::before, .mini-tiket::after { content: ""; position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--sky); }
.mini-tiket::before { left: -8px; }
.mini-tiket::after { right: -8px; }
.mt-num, .mt-poli, .mt-meta { grid-column: 1; min-width: 0; }
.mt-num { font-size: 1.7rem; font-weight: 800; color: var(--blue); line-height: 1.05; white-space: nowrap; }
.mt-poli { font-size: .84rem; font-weight: 700; }
.mt-meta { font-size: .76rem; color: var(--muted); }
.mt-side { grid-column: 2; grid-row: 1 / span 3; align-self: stretch; display: flex; flex-direction: column; justify-content: center; min-width: 74px; text-align: center; padding-left: 14px; border-left: 2px dashed var(--line); }
.mt-side b { display: block; font-size: 1.4rem; font-weight: 800; }
.mt-side small { display: block; font-size: .7rem; color: var(--muted); font-weight: 600; }
.mini-tiket.called { border-color: #ffd48a; background: #fff7e6; animation: called-glow 1.2s ease-in-out infinite; }
.tiket-list { display: grid; gap: 12px; }
.hist-list { display: grid; gap: 8px; }
.hist-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border-radius: 12px; background: #fff; text-decoration: none; color: var(--ink) !important; border: 1px solid var(--line); }
.hist-list b { color: var(--blue); }
.hist-list small { color: var(--muted); }
.empty-box { padding: 18px; border-radius: 14px; border: 1.5px dashed var(--blue-l); text-align: center; color: var(--muted); font-size: .88rem; background: #fff; }
.link-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.link-row a, .link-row button { padding: 8px 12px; border-radius: 10px; border: 0; background: #fff; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 700; color: var(--blue); text-decoration: none; }
