/* Tampilan formulir kunjungan yang ringkas dan responsif. */
.registration-page {
    max-width: 1020px;
    padding-top: 44px;
    padding-bottom: 64px;
}
.registration-heading {
    margin-bottom: 28px;
}
.registration-heading h1 {
    font-size: clamp(28px, 3.5vw, 42px);
    margin: 10px 0 14px;
}
.registration-heading p {
    color: #617771;
}
.registration-shell {
    border: 1px solid #dce7e1;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}
.registration-progress {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    list-style: none;
    padding: 24px 32px;
    margin: 0;
    background: #f6f9f7;
    border-bottom: 1px solid #e3ece6;
}
.registration-progress li {
    display: flex;
    gap: 10px;
    align-items: center;
    color: #71817a;
    font-size: 14px;
}
.registration-progress span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid #ccdcd2;
    border-radius: 50%;
    flex-shrink: 0;
}
.registration-progress .is-current {
    color: #126548;
    font-weight: 700;
}
.registration-progress .is-current span,
.registration-progress .is-complete span {
    background: #126548;
    border-color: #126548;
    color: #fff;
}
.registration-shell form {
    padding: 28px 32px;
}
.registration-shell [hidden] {
    display: none !important;
}
.registration-shell h2 {
    font-size: clamp(23px, 3vw, 29px);
    margin: 8px 0 12px;
}
.registration-status {
    background: #f3f7f5;
    border-left: 3px solid #88b59c;
    padding: 12px 16px;
    font-size: 13px;
    margin: 0 0 28px;
}
.registration-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
}
.registration-choices label {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 6px 12px;
    padding: 22px;
    border: 1px solid #d5e3da;
    border-radius: 12px;
    cursor: pointer;
    margin: 0;
}
.registration-choices label:has(input:checked) {
    background: #f1f8f3;
    border-color: #29835c;
    box-shadow: 0 0 0 1px #29835c;
}
.registration-choices input {
    width: 18px;
    height: 18px;
    margin: 3px 0;
    accent-color: #126548;
}
.registration-choices strong {
    font-size: 17px;
}
.registration-choices small {
    grid-column: 2;
    color: #6a7e74;
    line-height: 1.6;
}
.registration-jkn {
    background: #f0f7fc;
    border-radius: 12px;
    padding: 20px;
}
.registration-jkn h3 {
    margin-top: 0;
}
.registration-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 22px;
    border-top: 1px solid #e3ece6;
    margin-top: 24px;
}
.registration-actions [data-back] {
    margin-right: auto;
}
.registration-actions button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
.registration-feedback {
    color: #89551a;
    font-size: 14px;
}

.registration-shell input[readonly] {
    background: #f5f7f6;
}
.registration-shell .check {
    margin-top: 22px;
}
@media (max-width: 640px) {
    .registration-page {
        padding-top: 28px;
    }
    .registration-progress {
        padding: 18px 14px;
        gap: 8px;
    }
    .registration-progress li {
        flex-direction: column;
        gap: 6px;
        font-size: 11px;
        text-align: center;
    }
    .registration-shell form {
        padding: 24px 18px;
    }
    .registration-choices {
        grid-template-columns: 1fr;
    }
    .registration-actions .button {
        padding: 12px 16px;
        font-size: 13px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .registration-page * {
        scroll-behavior: auto;
    }
}

/* Kalender kunjungan: tanggal tanpa sesi API tidak dapat dipilih. */
[data-visit-calendar] {
    max-width: 340px;
    padding: 12px;
    margin-top: 6px;
    border: 1px solid #d5e3dc;
    border-radius: 10px;
    background: #fff;
}
.visit-calendar-heading {
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.visit-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    text-align: center;
    margin-bottom: 10px;
}
/* Ukuran khusus kalender agar tidak mengikuti font tombol utama. */
[data-visit-calendar] button {
    padding: 4px;
    min-height: 30px;
    font-size: 12px;
    line-height: 1.3;
    border: 0;
    border-radius: 6px;
    background: #edf6f0;
    color: #146347;
    cursor: pointer;
}
[data-visit-calendar] button:disabled {
    background: #f3f4f3;
    color: #a4aba7;
    cursor: default;
}
[data-visit-calendar] button[aria-pressed='true'] {
    background: #146347;
    color: #fff;
}
[data-visit-calendar] button:focus-visible {
    outline: 2px solid #146347;
    outline-offset: 2px;
}

/* Kolom tanggal tetap ringkas seperti input sebelumnya; kalender berupa popover. */
.visit-date-field {
    position: relative;
    margin-bottom: 19px;
}
/* Label tanggal terpisah dari input; samakan jaraknya dengan label pembungkus select. */
.visit-date-field > label {
    margin-bottom: 0;
}
.registration-shell input[name='visit_date'],
.registration-shell select[name='session'],
.visit-date-trigger {
    box-sizing: border-box;
    height: 44px;
    font-size: 14px;
}
.visit-date-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 42px;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #cbded5;
    border-radius: 5px;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.visit-date-trigger::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 1px solid currentColor;
    border-radius: 2px;
    background: linear-gradient(currentColor, currentColor) 0 3px / 100% 1px no-repeat;
}
.visit-date-trigger:disabled {
    color: #89958f;
    background: #f7f9f8;
    cursor: default;
}
.visit-date-field [data-visit-calendar] {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    width: min(270px, 100%);
    box-sizing: border-box;
    box-shadow: 0 5px 18px #143d2920;
}

/* Bukti pendaftaran hanya muncul setelah respons API berhasil, tanpa animasi gerak. */
.registration-receipt {
    width: min(650px, calc(100vw - 32px));
    max-width: 650px;
    max-height: calc(100dvh - 40px);
    box-sizing: border-box;
    padding: 0;
    border: 1px solid #dce7e1;
    border-radius: 20px;
    color: #183f39;
    background: #fff;
    box-shadow: 0 24px 90px #092b3d33;
    overflow: auto;
    overscroll-behavior: contain;
}
.registration-receipt::backdrop {
    background: #102d2866;
}
.receipt-sheet {
    padding: 30px;
}
.receipt-heading {
    display: flex;
    gap: 14px;
    align-items: center;
}
.receipt-heading img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}
.receipt-heading .eyebrow {
    margin: 0 0 6px;
}
.receipt-heading h2 {
    margin: 0;
    font-size: clamp(22px, 4vw, 28px);
    line-height: 1.25;
}
.receipt-close {
    align-self: flex-start;
    margin-left: auto;
    border: 0;
    background: #eff6f1;
    color: #174c3a;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font: inherit;
    font-size: 24px;
    flex-shrink: 0;
    cursor: pointer;
}
#receipt-intro {
    font-size: 14px;
    line-height: 1.7;
    color: #58726b;
    margin: 22px 0;
}
.receipt-number-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 12px;
    background: #eff6f2;
    border: 1px solid #dce9e1;
    border-radius: 12px;
    padding: 18px;
}
.receipt-number-grid span {
    display: block;
    font-size: 12px;
    color: #526f63;
    margin-bottom: 8px;
}
.receipt-number-grid strong {
    display: block;
    font-size: 19px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.receipt-number-grid [data-receipt='queue_number'] {
    font-size: 28px;
}
.receipt-details {
    margin: 24px 0;
}
.receipt-details > div {
    display: grid;
    grid-template-columns: 155px minmax(0, 1fr);
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid #e4ece7;
    font-size: 14px;
    line-height: 1.6;
}
.receipt-details dt {
    color: #58726b;
}
.receipt-details dd {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.receipt-notice {
    background: #fafbf9;
    padding: 14px;
    border-left: 3px solid #7ba58b;
    font-size: 13px;
    line-height: 1.7;
}
.receipt-contact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    margin-top: 22px;
}
.receipt-contact strong {
    margin-bottom: 3px;
}
.receipt-contact p {
    margin: 0;
}
.receipt-contact a {
    color: #167059;
    overflow-wrap: anywhere;
}
.receipt-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 0 30px 18px;
}
.receipt-controls .button {
    font-size: 13px;
    padding: 11px 15px;
}
.receipt-controls .text-link {
    border: 0;
    background: transparent;
    color: #526f63;
    cursor: pointer;
    padding: 10px;
}
.receipt-feedback {
    margin: 0;
    padding: 0 30px 20px;
    color: #58726b;
    font-size: 12px;
    line-height: 1.6;
}
.receipt-feedback:empty {
    padding-bottom: 5px;
}
.registration-receipt [hidden] {
    display: none !important;
}
@media (max-width: 520px) {
    .receipt-sheet {
        padding: 22px 18px;
    }
    .receipt-heading {
        gap: 10px;
    }
    .receipt-heading img {
        width: 38px;
        height: 38px;
    }
    .receipt-heading .eyebrow {
        font-size: 9px;
        letter-spacing: 1px;
    }
    .receipt-number-grid {
        padding: 14px;
    }
    .receipt-number-grid strong {
        font-size: 15px;
    }
    .receipt-details > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }
    .receipt-controls {
        padding: 0 18px 14px;
    }
    .receipt-feedback {
        padding: 0 18px 18px;
    }
}
@media print {
    @page {
        size: A4;
        margin: 14mm;
    }
    body.receipt-print-mode > *:not(.registration-receipt) {
        display: none !important;
    }
    body.receipt-print-mode {
        margin: 0;
        background: white;
    }
    body.receipt-print-mode .registration-receipt {
        display: block;
        position: static;
        width: 100%;
        max-width: none;
        max-height: none;
        margin: 0;
        overflow: visible;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    body.receipt-print-mode .receipt-controls,
    body.receipt-print-mode .receipt-feedback,
    body.receipt-print-mode .receipt-close,
    body.receipt-print-mode #receipt-intro,
    body.receipt-print-mode .receipt-notice,
    body.receipt-print-mode .receipt-contact {
        display: none !important;
    }
    body.receipt-print-mode .receipt-heading h2 {
        font-size: 0;
    }
    body.receipt-print-mode .receipt-heading h2::after {
        content: 'Bukti Pendaftaran Online';
        font-size: 24px;
    }
    body.receipt-print-mode .receipt-sheet {
        padding: 0;
    }
    body.receipt-print-mode .registration-receipt::backdrop {
        display: none;
    }
}
