/* BatasanConnect — online document request wizard (public/request.php). Uses tokens from public.css. */

/* Progress */
.rq-steps { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; counter-reset: rq; }
.rq-steps li { counter-increment: rq; position: relative; padding-top: 2.1rem; text-align: center; font-size: .78rem; font-weight: 600; color: var(--ink-400); cursor: pointer; }
.rq-steps li::before { content: counter(rq); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 1.7rem; height: 1.7rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--surface); border: 2px solid var(--line); color: var(--ink-500); font-size: .8rem; }
.rq-steps li::after { content: ''; position: absolute; top: .85rem; left: calc(50% + 1.05rem); right: calc(-50% + 1.05rem); height: 2px; background: var(--line); }
.rq-steps li:last-child::after { display: none; }
.rq-steps li.active { color: var(--ink-900); }
.rq-steps li.active::before { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 0 0 5px var(--accent-soft); transform: translateX(-50%) scale(1.08); }
.rq-steps li::before, .rq-steps li::after { transition: background .3s ease, border-color .3s ease, box-shadow .3s ease, transform .3s ease; }
.rq-steps li:hover:not(.active) { color: var(--ink-700); }
.rq-steps li.done { color: var(--ink-700); }
.rq-steps li.done::before { content: '✓'; border-color: var(--success); background: var(--success); color: #fff; }
.rq-steps li.done::after { background: var(--success); }

.rq-form.public-form { max-width: none; }
.rq-step h2 { font-size: 1.15rem; margin: 0 0 .9rem; color: var(--ink-900); }
.rq-form.js .rq-step[hidden], .rq-type[hidden], .rq-field[hidden], [hidden] { display: none !important; }
.rq-form:not(.js) .rq-step { border-bottom: 1px solid var(--line); padding-bottom: 1.25rem; margin-bottom: 1.25rem; }

/* Step 1: document cards */
.rq-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.rq-doc { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: .75rem; row-gap: .2rem; margin: 0 !important;
  padding: 1rem; border: 1.5px solid var(--line); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.rq-doc:hover { border-color: var(--ink-400); }
.rq-doc input { position: absolute; opacity: 0; pointer-events: none; }
.rq-doc:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rq-doc:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.rq-doc-icon { grid-row: 1 / span 3; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; }
.rq-doc-name { font-weight: 700; color: var(--ink-900); font-size: .95rem; line-height: 1.3; }
.rq-doc-sum { font-size: .8rem; color: var(--ink-500); font-weight: 400; line-height: 1.4; }
.rq-doc-fee { justify-self: start; margin-top: .3rem; font-size: .78rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: var(--surface-soft); color: var(--ink-700); border: 1px solid var(--line); }
.rq-doc-fee.free { background: var(--success-soft); color: var(--success); border-color: transparent; }

/* Step 2: fields */
.rq-type { border: 0; margin: 0; padding: 0; min-width: 0; }
.rq-type legend { font-size: .8rem; font-weight: 700; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .2rem; padding: 0; }
.rq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.rq-field { display: flex; flex-direction: column; min-width: 0; }
.rq-field.wide { grid-column: 1 / -1; }
.rq-field label b, .rq-label b, .rq-upload label b { color: var(--danger); }
.rq-label { font-size: .82rem; margin-top: .85rem; font-weight: 600; color: var(--ink-700); }
.rq-choices { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .4rem; }
.rq-chip { margin: 0 !important; font-weight: 500 !important; }
.rq-chip input { position: absolute; opacity: 0; pointer-events: none; }
.rq-chip span { display: inline-block; padding: .45rem .85rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .85rem; color: var(--ink-700); cursor: pointer; }
.rq-chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.rq-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rq-check-line { display: flex !important; gap: .6rem; align-items: flex-start; font-weight: 500 !important; line-height: 1.5; margin-top: 1rem !important; cursor: pointer; }
.rq-check-line input { width: 1.15rem; height: 1.15rem; margin-top: .15rem; flex-shrink: 0; accent-color: var(--accent); }
.rq-contact { margin-top: .5rem; padding-top: .75rem; border-top: 1px dashed var(--line); }
.rq-sigpad { position: relative; margin-top: .4rem; border: 1.5px dashed var(--ink-400); border-radius: var(--radius-sm); background: #fff; }
.rq-sigpad canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; }
.rq-sig-clear { position: absolute !important; top: .4rem; right: .4rem; margin: 0 !important; padding: .25rem .65rem !important; font-size: .75rem !important; background: var(--surface-soft) !important; color: var(--ink-700) !important; border: 1px solid var(--line) !important; }

/* Step 3: uploads */
.rq-upload { display: flex; flex-direction: column; padding: .2rem 0 .4rem; }

/* Step 4: payment */
.rq-fee { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; padding: 1rem 1.1rem; border-radius: var(--radius-md); background: var(--brand); color: #fff; margin-bottom: 1rem; }
.rq-fee span { font-size: .85rem; opacity: .8; }
.rq-fee strong { font-size: 1.6rem; }
.rq-fee small { flex-basis: 100%; font-size: .78rem; opacity: .75; }
.rq-pay { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: .5rem 1.25rem; align-items: start; }
.rq-pay > .rq-grid { grid-column: 1 / -1; }
.rq-qr img { width: 100%; max-width: 220px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; }
.rq-qr-missing { padding: 1rem; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); font-size: .82rem; color: var(--ink-500); text-align: center; }
.rq-pay-steps { margin: 0; padding-left: 1.2rem; font-size: .88rem; color: var(--ink-700); line-height: 1.6; }
.rq-free { padding: 1rem; border-radius: var(--radius-md); background: var(--success-soft); color: var(--success); font-weight: 600; font-size: .9rem; }
#rqAssess { background: var(--accent-soft); color: var(--accent-ink); }

/* Step 5: review */
.rq-review dl { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.rq-review dl > div { display: grid; grid-template-columns: minmax(120px, 38%) minmax(0, 1fr); gap: .75rem; padding: .55rem .85rem; font-size: .88rem; }
.rq-review dl > div:nth-child(odd) { background: var(--surface-soft); }
.rq-review dt { color: var(--ink-500); }
.rq-review dd { margin: 0; font-weight: 600; color: var(--ink-800); overflow-wrap: anywhere; }
.rq-consent { font-size: .85rem; color: var(--ink-700); }

/* Navigation */
.rq-nav { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.rq-form:not(.js) #rqNext, .rq-form:not(.js) #rqBack { display: none; }
.rq-btn, .public-form .rq-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .75rem 1.4rem; border-radius: var(--radius-sm); border: 1.5px solid var(--accent);
  background: var(--accent); color: #fff; font-weight: 700; font-size: .95rem; text-decoration: none; margin: 0; cursor: pointer; }
.rq-btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.rq-btn-ghost, .public-form .rq-btn-ghost { background: var(--surface); color: var(--accent-ink); }
.rq-btn-ghost:hover, .public-form .rq-btn-ghost:hover { background: var(--accent-soft); color: var(--accent-ink); } /* must beat .public-form button:hover */
.rq-btn[disabled] { opacity: .6; cursor: wait; }
#rqNext, #rqSubmit { margin-left: auto; }

.rq-errors { background: var(--danger-soft); border: 1px solid #fecaca; color: #991b1b; border-radius: var(--radius-md); padding: .85rem 1rem; margin-bottom: 1rem; font-size: .9rem; }
.rq-errors ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.rq-errors p { margin: .4rem 0 0; }
.rq-shake { animation: rq-shake .45s; }
@keyframes rq-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* Submitted */
.rq-done { max-width: 560px; margin: 0 auto; }
.rq-receipt { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem 1.4rem 1.2rem; text-align: center; box-shadow: var(--shadow-md); }
.rq-receipt-head { display: flex; align-items: center; gap: .65rem; text-align: left; padding-bottom: .9rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.rq-receipt-head strong { display: block; color: var(--ink-900); }
.rq-receipt-head span { font-size: .8rem; color: var(--ink-500); }
.rq-check { width: 52px; height: 52px; margin: 0 auto .5rem; border-radius: 50%; background: var(--success-soft); color: var(--success); font-size: 1.6rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.rq-receipt h1 { font-size: 1.35rem; margin: 0 0 .25rem; }
.rq-sub { color: var(--ink-500); font-size: .9rem; margin: 0 0 1rem; }
.rq-ref-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-500); }
.rq-ref { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: clamp(1.25rem, 6vw, 1.7rem); font-weight: 800; letter-spacing: 1px; color: var(--ink-900);
  background: var(--accent-soft); border: 2px dashed var(--accent); border-radius: var(--radius-sm); padding: .6rem .5rem; margin: .35rem 0 1rem; user-select: all; overflow-wrap: anywhere; }
.rq-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: 0; text-align: left; }
.rq-meta div { background: var(--surface-soft); border-radius: var(--radius-sm); padding: .5rem .7rem; }
.rq-meta dt { font-size: .72rem; color: var(--ink-500); }
.rq-meta dd { margin: 0; font-weight: 700; font-size: .88rem; color: var(--ink-800); }
.rq-fine { font-size: .75rem; color: var(--ink-400); margin: .9rem 0 0; }
.rq-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin: 1.1rem 0 .6rem; }
.rq-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: var(--radius-sm); padding: .65rem .85rem; font-size: .85rem; }
.rq-next { font-size: .9rem; color: var(--ink-700); }

.rq-toast { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 150%); max-width: min(92vw, 480px);
  background: var(--ink-800); color: #fff; padding: .8rem 1.1rem; border-radius: var(--radius-md); font-size: .88rem; box-shadow: var(--shadow-md); z-index: 50; transition: transform .25s, opacity .25s, visibility 0s linear .25s; opacity: 0; visibility: hidden; pointer-events: none; }
.rq-toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .25s, opacity .25s, visibility 0s; }

@media (max-width: 640px) {
  .rq-steps li { font-size: 0; padding-top: 1.9rem; }
  .rq-grid { grid-template-columns: 1fr; }
  .rq-pay { grid-template-columns: 1fr; justify-items: center; }
  .rq-pay-steps { justify-self: stretch; }
  .rq-nav .rq-btn { flex: 1 1 0; }
  .rq-actions .rq-btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .rq-shake { animation: none; } .rq-toast { transition: none; } }

/* Track page */
.tr-saved { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: .75rem 1rem; margin: 0 0 1rem; font-size: .88rem; }
.tr-saved ul { margin: .35rem 0 0; padding-left: 1.1rem; }
.tr-saved a { font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
.tr-box { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .9rem; margin: .75rem 0; font-size: .9rem; }
.tr-bad { background: var(--danger-soft); border-color: #fecaca; color: #991b1b; }
.tr-bad-text { color: #b91c1c; }
.tr-pay { margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.tr-pay h2 { margin: 0 0 .75rem; font-size: 1.1rem; }
.status-badge.status-approved { background: var(--success-soft); color: var(--success); }

/* Verify page */
.vf { display: flex; gap: 1rem; align-items: flex-start; border-radius: var(--radius-md); padding: 1rem 1.1rem; margin-top: 1rem; }
.vf-ok { background: var(--success-soft); border: 1px solid #a7f3d0; }
.vf-bad { background: var(--danger-soft); border: 1px solid #fecaca; color: #991b1b; }
.vf-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 800; color: #fff; background: var(--success); }
.vf-bad .vf-icon { background: var(--danger); }
.vf strong { font-size: 1.05rem; }
.vf p { margin: .3rem 0 0; }
.vf dl { margin: .5rem 0; display: grid; gap: .3rem; }
.vf-photo { margin: .6rem 0 .2rem; }
.vf-photo img { display: block; width: 110px; height: 110px; border-radius: var(--radius-sm); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); background: #fff; }
.vf-photo figcaption { margin-top: .25rem; font-size: .75rem; color: var(--ink-500); }
.vf dl div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .5rem; font-size: .92rem; }
.vf dt { color: var(--ink-500); }
.vf dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.rq-payto { margin: .5rem 0 0; font-size: .85rem; color: var(--ink-700); text-align: center; overflow-wrap: anywhere; }

/* Phones: step 1 advances on tap, so explain that instead of showing Next */
.rq-tap-hint { display: none; margin: -.4rem 0 .8rem; font-size: .85rem; color: var(--ink-500); }
@media (max-width: 640px) { .rq-tap-hint { display: block; } }

/* Submitting overlay with upload progress */
.rq-sending { position: fixed; inset: 0; z-index: 1000; background: rgba(16, 22, 42, .55); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.rq-sending[hidden] { display: none; }
.rq-sending-box { background: #fff; border-radius: var(--radius-lg); padding: 1.6rem 1.5rem 1.3rem; width: min(340px, 100%); text-align: center; box-shadow: var(--shadow-md); }
.rq-sending-box strong { display: block; font-size: 1.05rem; color: var(--ink-900); }
.rq-sending-box p { margin: .35rem 0 .9rem; font-size: .9rem; color: var(--ink-700); }
.rq-sending-box small { display: block; margin-top: .7rem; color: var(--ink-500); font-size: .78rem; }
.rq-sending-track { height: 8px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.rq-sending-bar { height: 100%; width: 5%; background: var(--accent); border-radius: 999px; transition: width .25s ease; }
.rq-spinner { width: 38px; height: 38px; margin: 0 auto .8rem; border: 4px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: rq-spin .8s linear infinite; }
@keyframes rq-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rq-spinner { animation-duration: 2.4s; } .rq-sending-bar { transition: none; } }
.vf-warn { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }
.vf-warn .vf-icon { background: #d97706; }
.vf dl div { grid-template-columns: 9rem minmax(0, 1fr); }
@media (max-width: 420px) { .vf dl div { grid-template-columns: 1fr; gap: 0; } .vf dl div dd { margin-bottom: .25rem; } }
.tr-saved-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.public-form .tr-saved-clear, .tr-saved-clear { margin: 0; padding: .2rem .55rem; background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-500); font-size: .76rem; font-weight: 600; cursor: pointer; }
.tr-saved-clear:hover { color: var(--danger); border-color: #fecaca; background: var(--danger-soft); }
.tr-saved li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem; }
.tr-saved-x { margin-left: auto; padding: 0 .35rem; background: none; border: none; color: var(--ink-400); font-size: .85rem; cursor: pointer; line-height: 1.4; }
.tr-saved-x:hover { color: var(--danger); }
.tr-saved .field-hint { margin: .4rem 0 0; font-size: .76rem; }
.rq-hours { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: var(--radius-md); padding: .7rem .95rem; font-size: .88rem; line-height: 1.5; margin: 0 0 1rem; }

.rq-restored { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; background: var(--accent-soft); color: var(--ink-700); border-radius: var(--radius-md); padding: .6rem .9rem; font-size: .86rem; margin: 0 0 1rem; }
.rq-restart, .public-form .rq-restart { margin: 0 0 0 auto; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-700); font-size: .8rem; font-weight: 600; cursor: pointer; }
.rq-restart:hover { border-color: var(--danger); color: var(--danger); }

/* Dark mode */
@media (prefers-color-scheme: dark) {
.rq-hours { background: #33290a; color: #fde68a; border-color: #5c4a10; }
.rq-toast { background: #1c2740; color: var(--ink-800); }
.rq-btn:not(.rq-btn-ghost) { background: #2f5fd0; border-color: #2f5fd0; }
.rq-btn-ghost, .public-form .rq-btn-ghost { background: var(--surface); color: #a5c0fb; border-color: #3b5bab; }
.rq-btn-ghost:hover, .public-form .rq-btn-ghost:hover { background: var(--accent-soft); color: #c7d7fe; }
.rq-receipt, .rq-sending-box { background: var(--surface); }
.rq-ref { color: #e2e8f0; }
.rq-doc-icon { color: #a5c0fb; }
.rq-type legend, .rq-chip input:checked + span, #rqAssess { color: #a5c0fb; }
.rq-warn { background: #33290a; border-color: #5c4a10; color: #fde68a; }
.rq-errors, .tr-bad { background: var(--danger-soft); border-color: #5b2124; color: #fecaca; }
.tr-bad-text { color: #fca5a5; }
.rq-fee { background: #1a2747; border: 1px solid #2c3a5c; }
.rq-sigpad { border-color: #475569; } /* the pad itself stays white so the ink shows */
.rq-sig-clear { background: #e2e8f0 !important; color: #1e293b !important; border-color: #cbd5e1 !important; }
.rq-qr img { border-color: #2c3a5c; }
.vf-ok { border-color: #14532d; }
.vf-bad { border-color: #5b2124; color: #fecaca; }
.vf-warn { background: #33290a; border-color: #5c4a10; color: #fde68a; }
.rq-sending { background: rgba(0, 0, 0, .65); }
}.rq-steps li { color: var(--ink-500); }

/* Bank transfer option beside / instead of the QR */
.rq-bank { display: flex; flex-direction: column; align-items: center; gap: .15rem; margin-top: .6rem; padding: .8rem .9rem; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface); text-align: center; width: 100%; max-width: 220px; box-sizing: border-box; }
.rq-qr img + .rq-payto + .rq-bank, .rq-qr img + .rq-bank { margin-top: .8rem; }
.rq-bank-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); }
.rq-bank-name { font-size: 1rem; color: var(--ink-900); }
.rq-bank-acct { font-size: .82rem; color: var(--ink-700); overflow-wrap: anywhere; }
.rq-bank-no { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; font-weight: 800; letter-spacing: .04em; color: var(--ink-900); user-select: all; }
.rq-bank-copy, .public-form .rq-bank-copy { margin: .35rem 0 0; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--accent-ink); font-size: .76rem; font-weight: 600; cursor: pointer; }
.rq-or { display: block; margin-top: .15rem; color: var(--ink-500); font-size: .84rem; }
@media (prefers-color-scheme: dark) { .rq-bank-copy, .public-form .rq-bank-copy { color: #a5c0fb; } }
