/* ===== BUKU TAMU - CADISDIK XIII ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Poppins", sans-serif;
    background-color: #f0f0f0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 8px 18px;
}

.wrapper {
    width: 100%;
    max-width: 1600px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.header {
    background: #0f9455;
    padding: 14px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.header img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    background: white;
    padding: 6px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header-text {
    text-align: center;
}

.header-text h1 {
    color: white;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 2px;
}

.header-text p {
    color: white;
    font-size: 15px;
    font-weight: 300;
    opacity: 0.9;
}

.apk-reminder {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 1200;
    width: min(360px, calc(100vw - 32px));
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(5, 150, 105, 0.22);
    padding: 12px 12px 10px;
    text-align: center;
    opacity: 0;
    transform: translate(-50%, calc(-50% + 12px));
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.apk-reminder.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

.apk-reminder.is-hidden {
    display: none;
}

.apk-reminder__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: #d1fae5;
    color: #047857;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.apk-reminder__content {
    padding-right: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.apk-reminder__logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #a7f3d0;
    padding: 4px;
    margin-bottom: 4px;
}

.apk-reminder__title {
    color: #065f46;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.apk-reminder__desc {
    color: #047857;
    font-size: 12px;
    margin-top: 2px;
    line-height: 1.35;
}

.apk-reminder__action {
    margin-top: 10px;
    appearance: none;
    border: none;
    border-radius: 9px;
    background: #0f9455;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    padding: 9px 12px;
    min-width: 150px;
}

.apk-reminder__action.is-disabled {
    background: #9ca3af;
}

.form-container {
    background: white;
    padding: 10px 24px 8px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-height: 0;
}

.public-footer {
    flex-shrink: 0;
    margin-top: 6px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    font-family: "Poppins", sans-serif;
}

.public-footer__link {
    display: inline-block;
    text-align: center;
    color: #6b7280;
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.2px;
    line-height: 1.25;
    border-bottom: 1px solid transparent;
    transition:
        color 0.2s ease,
        border-color 0.2s ease;
}

.public-footer__link:hover {
    color: #4b5563;
    border-color: rgba(75, 85, 99, 0.2);
}

.form-container form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.form-main {
    display: flex;
    gap: 18px;
    flex: 1;
    min-height: 0;
    overflow: visible;
}

.form-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.form-left-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    align-items: start;
    align-content: stretch;
    flex: 1;
    overflow: visible;
}

.form-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    width: 40%;
    flex-shrink: 0;
    min-height: 0;
    overflow: hidden;
}

.form-right .foto-section {
    grid-column: 1;
}

.form-right .ttd-section {
    grid-column: 2;
    grid-row: 1 / 3;
}

.form-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    padding-bottom: 5px; /* Standby space for hints */
}

.form-group label {
    font-size: 11.5px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group label .required {
    color: #ff3b3b;
    margin-left: 2px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 7.5px 40px 7.5px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13.5px;
    font-family: "Poppins", sans-serif;
    color: #333;
    background: white;
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease;
    outline: none;
    appearance: none;
    cursor: pointer;
}

.input-wrapper select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    border-color: #0f9455;
    box-shadow: 0 0 0 3px rgba(15, 148, 85, 0.1);
}

.input-wrapper .input-icon {
    position: absolute;
    right: 12px;
    color: #b0b0b0;
    font-size: 17px;
    pointer-events: none;
}

/* Autocomplete Jenis ID */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}
.autocomplete-wrapper input {
    width: 100%;
    padding: 7.5px 40px 7.5px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13.5px;
    font-family: "Poppins", sans-serif;
    color: #333;
    background: white;
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease;
    outline: none;
    cursor: text;
}
.autocomplete-wrapper input:focus {
    border-color: #0f9455;
    box-shadow: 0 0 0 3px rgba(15, 148, 85, 0.1);
}
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 2500;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.autocomplete-list.show {
    display: block;
}
.autocomplete-item {
    padding: 10px 15px;
    font-size: 15px;
    font-family: "Poppins", sans-serif;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.autocomplete-item:hover,
.autocomplete-item.active {
    background: #0f9455;
    color: white;
}
.autocomplete-item .autocomplete-meta {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    background: #fee2e2;
    color: #b91c1c;
    line-height: 1.2;
    white-space: nowrap;
}
.autocomplete-item.is-disabled,
.autocomplete-item.is-disabled:hover,
.autocomplete-item.is-disabled.active {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}
.autocomplete-item.is-disabled strong {
    color: #4b5563;
}
.autocomplete-item:last-child {
    border-radius: 0 0 6px 6px;
}

/* Phone Input */
.phone-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
}
.phone-prefix {
    flex-shrink: 0;
    padding: 7.5px 8px 7.5px 12px;
    background: #f0f0f0;
    border: 1.5px solid #e0e0e0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 13.5px;
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    color: #333;
    user-select: none;
    line-height: 1.5;
}
.phone-wrapper input {
    flex: 1;
    min-width: 0;
    padding: 7.5px 40px 7.5px 8px;
    border: 1.5px solid #e0e0e0;
    border-left: none;
    border-radius: 0 8px 8px 0;
    font-size: 13.5px;
    font-family: "Poppins", sans-serif;
    color: #333;
    background: white;
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease;
    outline: none;
}
.phone-wrapper:focus-within .phone-prefix {
    border-color: #0f9455;
    box-shadow: 0 0 0 3px rgba(15, 148, 85, 0.1);
}
.phone-wrapper:focus-within input {
    border-color: #0f9455;
    box-shadow: 0 0 0 3px rgba(15, 148, 85, 0.1);
}
.phone-hint {
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    font-size: 10.5px;
    margin-top: 0;
    font-family: "Poppins", sans-serif;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
    z-index: 5;
}
.phone-hint.valid {
    color: #0f9455;
}
.phone-hint.invalid {
    color: #e53935;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #e53935;
    color: white;
    padding: 14px 28px;
    border-radius: 10px;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition:
        transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 0.4s;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    max-width: 90vw;
}
.toast-notification.toast-success {
    background: #0f9455;
}
.toast-notification.toast-warning {
    background: #e68a00;
}
.toast-notification.toast-info {
    background: #2196f3;
}
.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast-notification i {
    margin-right: 8px;
}
.form-group.shake input,
.form-group.shake select,
.form-group.shake .autocomplete-wrapper input,
.form-group.shake .phone-wrapper input {
    border-color: #e53935 !important;
    animation: shake 0.5s ease;
}
@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-4px);
    }
    40% {
        transform: translateX(4px);
    }
    60% {
        transform: translateX(-4px);
    }
    80% {
        transform: translateX(4px);
    }
}

/* Foto Sections (Selfie & Penerimaan) */
.foto-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.foto-penerimaan-section .foto-box .camera-icon {
    background: linear-gradient(135deg, #a8c8db, #7ca8c9);
}

.foto-penerimaan-section .foto-box p {
    color: #2e7d9e;
}

.foto-box {
    border: 2px dashed #b8dcc8;
    border-radius: 10px;
    background: #f0faf4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    flex: 1;
    text-align: center;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

.foto-box .camera-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #a8dbb8, #7cc99a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.foto-box .camera-icon i {
    font-size: 18px;
    color: white;
}

.foto-box p {
    color: #0f9455;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    flex-shrink: 0;
}

.foto-box video,
.foto-box canvas,
.foto-box img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 15px;
    margin-bottom: 0;
    object-fit: contain;
    flex: 1;
    min-height: 0;
}

.foto-box.has-media {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}

.foto-box.has-media .camera-preview-wrapper {
    height: 100%;
    min-height: 100%;
    border-radius: 8px;
}

.foto-box.has-media video,
.foto-box.has-media canvas,
.foto-box.has-media img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 8px;
    object-fit: cover;
}

.camera-controls {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.btn-camera {
    flex: 1;
    padding: 8px;
    background: #0f9455;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-camera:hover {
    background: #0b7a46;
}

.btn-close-camera {
    width: 38px;
    height: auto;
    padding: 8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-camera:hover {
    background: #dc2626;
}

.btn-flip-camera {
    width: 38px;
    height: auto;
    padding: 8px;
    background: #374151;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-flip-camera:hover {
    background: #1f2937;
}

/* Camera Preview Wrapper & Detection Overlay */
.camera-preview-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.camera-preview-wrapper video {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.detection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border-radius: 8px;
}

/* Tanda Tangan Section */
.ttd-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.ttd-box {
    border: 2px dashed #b8dcc8;
    border-radius: 10px;
    background: #f0faf4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    flex: 1;
    text-align: center;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

.ttd-box .pen-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #a8dbb8, #7cc99a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.ttd-box .pen-icon i {
    font-size: 18px;
    color: white;
}

.ttd-box p {
    color: #0f9455;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
}

.ttd-box canvas {
    border: 1px solid #b8dcc8;
    border-radius: 8px;
    background: white;
    cursor: crosshair;
    max-width: 100%;
}

.btn-ttd {
    width: 100%;
    padding: 10px;
    background: #0f9455;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.3s ease;
}

.btn-ttd:hover {
    background: #0b7a46;
}

/* Catatan */
.catatan {
    margin-top: 1px;
    padding-top: 0;
    max-height: 35px; /* Prevent it from taking too much space */
    overflow: hidden;
}

.catatan p:first-child {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    font-style: italic;
}

.catatan p:last-child {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.catatan .required {
    color: #ff3b3b;
}

/* Submit Button */
.btn-simpan {
    width: 100%;
    padding: 8px; /* Slightly more compact */
    background: #0f9455;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.btn-simpan:hover {
    background: #0b7a46;
}

/* Floating Barcode Button (Draggable) */
.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #0f9455;
    border: none;
    outline: none;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(15, 148, 85, 0.4);
    cursor: grab;
    text-decoration: none;
    z-index: 100;
    user-select: none;
    touch-action: none;
    transition:
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

/* Rotating light orbit ring */
.floating-btn::before {
    content: "";
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.9);
    border-right-color: rgba(255, 255, 255, 0.3);
    animation: orbitSpin 2s linear infinite;
    pointer-events: none;
}

/* Pulsing glow behind the button */
.floating-btn::after {
    content: "";
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(15, 148, 85, 0.4) 0%,
        transparent 70%
    );
    animation: glowPulse 2.5s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes orbitSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes glowPulse {
    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

.floating-btn:active,
.floating-btn.dragging {
    cursor: grabbing;
    box-shadow: 0 8px 25px rgba(15, 148, 85, 0.6);
    transform: scale(1.08);
}

.floating-btn:hover {
    box-shadow: 0 6px 20px rgba(15, 148, 85, 0.5);
    transform: scale(1.05);
}

.floating-btn:focus {
    outline: none;
    box-shadow: 0 6px 20px rgba(15, 148, 85, 0.5);
}

.floating-btn i {
    color: white;
    font-size: 26px;
    position: relative;
    z-index: 1;
}

/* Confirmation / Review Modal */
.confirm-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10002;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.confirm-modal-overlay.active {
    display: flex;
}

.confirm-modal {
    background: white;
    border-radius: 18px;
    max-width: 950px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.confirm-modal__container {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 24px;
}

.confirm-modal__left-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.confirm-modal__right-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-left: 1px solid #f0f0f0;
    padding-left: 24px;
}

.confirm-skm-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    padding: 16px;
}

.confirm-skm-desc {
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 12px;
    line-height: 1.5;
}

.confirm-barcode-img-box {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 180px;
    height: 180px;
    margin-bottom: 12px;
}

.confirm-barcode-img-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.confirm-skm-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #e8f5e9;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
    margin-top: 4px;
}

.confirm-skm-note i {
    color: #0f9455;
    font-size: 16px;
    margin-top: 2px;
}

.confirm-skm-note span {
    font-family: "Poppins", sans-serif;
    font-size: 11.5px;
    color: #2e7d32;
    line-height: 1.4;
}

.confirm-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    font-family: "Poppins", sans-serif;
    z-index: 2;
}

.confirm-modal__close:hover {
    color: #e53935;
}

.confirm-modal__header {
    text-align: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.confirm-modal__header i {
    font-size: 32px;
    color: #0f9455;
    margin-bottom: 8px;
}

.confirm-modal__header h3 {
    font-family: "Poppins", sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 4px;
}

.confirm-modal__header p {
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.confirm-modal__body {
    padding: 16px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.confirm-section {
    margin-bottom: 18px;
}

.confirm-section:last-child {
    margin-bottom: 0;
}

.confirm-section h4 {
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #0f9455;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e8f5e9;
}

.confirm-section h4 i {
    font-size: 14px;
}

.confirm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}

.confirm-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.confirm-label {
    font-family: "Poppins", sans-serif;
    font-size: 10.5px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confirm-value {
    font-family: "Poppins", sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    color: #1f2937;
    word-break: break-word;
}

.confirm-media {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.confirm-media-item {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.confirm-img-box {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #f9fafb;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.confirm-ttd-box {
    aspect-ratio: 2 / 1;
    background: #ffffff;
}

.confirm-ttd-box img {
    object-fit: contain;
    padding: 6px;
}

.confirm-modal__footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.confirm-btn {
    flex: 1;
    padding: 11px 16px;
    border: none;
    border-radius: 10px;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.confirm-btn--back {
    background: #f3f4f6;
    color: #4b5563;
}

.confirm-btn--back:hover {
    background: #e5e7eb;
}

.confirm-btn--next {
    background: #0f9455;
    color: #fff;
}

.confirm-btn--next:hover {
    background: #0b7a46;
}

@media (max-width: 768px) {
    .confirm-modal {
        max-width: 580px;
        max-height: 95vh;
        border-radius: 14px;
    }

    .confirm-modal__header {
        padding: 18px 18px 12px;
    }

    .confirm-modal__header h3 {
        font-size: 16px;
    }

    .confirm-modal__body {
        padding: 12px 18px;
    }

    .confirm-modal__container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .confirm-modal__right-col {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #f0f0f0;
        padding-top: 16px;
    }

    .confirm-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .confirm-media {
        flex-direction: column;
    }

    .confirm-img-box {
        max-height: 160px;
    }

    .confirm-modal__footer {
        flex-direction: column;
        padding: 12px 18px;
    }
}

/* Barcode Survey Modal */
.barcode-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}
.barcode-modal-overlay.active {
    display: flex;
}
.barcode-modal {
    background: white;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
.barcode-modal .close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    font-family: "Poppins", sans-serif;
}
.barcode-modal .close-btn:hover {
    color: #e53935;
}
.barcode-modal h3 {
    font-family: "Poppins", sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #0f9455;
    margin-bottom: 6px;
}
.barcode-modal p {
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
}
.barcode-modal img {
    width: 100%;
    max-width: 280px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.survey-submit-gate {
    display: none;
    margin-top: 14px;
}

.survey-submit-gate.active {
    display: block;
}

.survey-timer-text {
    margin: 0 0 10px;
    font-size: 12px;
    color: #4f4f4f;
}

.btn-lanjut-submit {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: #0f9455;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-lanjut-submit:disabled {
    background: #b7c3bc;
    cursor: not-allowed;
}

.btn-lanjut-submit:not(:disabled):hover {
    background: #0b7a46;
}

/* Signature Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.modal-content canvas {
    border: 2px solid #b8dcc8;
    border-radius: 8px;
    cursor: crosshair;
    background: white;
    width: 100%;
    height: 250px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.modal-buttons button {
    padding: 10px 30px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-clear {
    background: #e5e7eb;
    color: #333;
}

.btn-clear:hover {
    background: #d1d5db;
}

.btn-save-ttd {
    background: #0f9455;
    color: white;
}

.btn-save-ttd:hover {
    background: #0b7a46;
}

.btn-cancel {
    background: #f87171;
    color: white;
}

.btn-cancel:hover {
    background: #ef4444;
}

/* ===== RESPONSIVE ===== */

@media (max-height: 850px) {
    .header {
        padding: 10px 24px;
    }
    .header img {
        width: 52px;
        height: 52px;
        padding: 5px;
    }
    .header-text h1 {
        font-size: 22px;
    }
    .header-text p {
        font-size: 13px;
    }
    .form-container {
        padding: 8px 20px 6px;
    }
    .form-left-grid {
        gap: 4px 12px;
    }
    .form-group label {
        font-size: 11px;
        margin-bottom: 2px;
    }
    .input-wrapper input,
    .input-wrapper select,
    .autocomplete-wrapper input,
    .phone-prefix,
    .phone-wrapper input {
        padding-top: 6px;
        padding-bottom: 6px;
        font-size: 13px;
    }
    .foto-box,
    .ttd-box {
        padding: 8px 6px;
    }
    .btn-simpan {
        padding: 8px;
        font-size: 14px;
        margin-top: 4px;
    }
}

/* ---- LARGE DESKTOP (24-inch and wider) ---- */
@media (min-width: 1500px) {
    body {
        padding: 10px 14px;
    }

    .wrapper {
        max-width: none;
        width: 100%;
        height: min(calc(100vh - 20px), 920px);
    }

    .form-container {
        padding: 16px 20px 14px;
    }

    .form-main {
        gap: 16px;
    }

    .form-left-grid {
        gap: 8px 14px;
    }

    .form-right {
        width: 39%;
    }
}

/* ---- HIGH-RES TABLET (touch devices >1200px) ---- */
/* DevTools tablet presets with large dimensions (e.g. 2560x1600) bypass the
   existing max-width: 1200 tablet rules. This ensures full-width layout. */
@media (pointer: coarse) and (min-width: 1201px) {
    body {
        padding: 10px 12px;
    }

    .wrapper {
        max-width: none;
        width: 100%;
    }
}

/* ---- LARGE TABLET / SMALL DESKTOP (max 1366px) ---- */
@media (max-width: 1366px) {
    body {
        padding: 20px 30px 15px;
    }
    .header {
        padding: 22px 30px;
        gap: 18px;
    }
    .header img {
        width: 72px;
        height: 72px;
    }
    .header-text h1 {
        font-size: 24px;
    }
    .form-container {
        padding: 18px 25px 15px;
    }
    .form-main {
        gap: 20px;
    }
    .form-left-grid {
        gap: 10px 18px;
    }
    .form-right {
        width: 46%;
    }
}

/* ---- TABLET LANDSCAPE SCROLL SAFETY (up to 1366px) ---- */
@media (max-width: 1366px) and (orientation: landscape) {
    body {
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        align-items: flex-start;
    }

    .wrapper {
        height: auto;
        min-height: calc(100dvh - 32px);
    }

    .form-container {
        overflow: visible;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .form-container form,
    .form-main,
    .form-left,
    .form-left-grid,
    .form-right {
        min-height: unset;
    }

    .btn-simpan {
        position: sticky;
        bottom: 0;
        z-index: 30;
    }
}

/* ---- HIGH-RES TALL TABLET/PHONE (1440x2304px @ 249ppi) ---- */
/* Dioptimalkan untuk perangkat portrait dengan resolusi tinggi dan aspect ratio 5:8 */
@media (min-width: 1400px) and (min-height: 2200px) and (orientation: portrait) {
    body {
        padding: 24px 32px 20px;
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        align-items: flex-start;
        background-color: #fafafa;
    }

    .wrapper {
        max-width: 100%;
        height: auto;
        min-height: calc(100dvh - 40px);
    }

    /* ---- HEADER ---- */
    .header {
        padding: 28px 40px;
        gap: 20px;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }

    .header img {
        width: 88px;
        height: 88px;
        padding: 8px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }

    .header-text {
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .header-text h1 {
        font-size: 32px;
        font-weight: 700;
        line-height: 1.3;
        margin-bottom: 6px;
        letter-spacing: -0.3px;
    }

    .header-text p {
        font-size: 16px;
        font-weight: 400;
        opacity: 0.95;
        line-height: 1.4;
    }

    /* ---- FORM CONTAINER ---- */
    .form-container {
        padding: 28px 32px 24px;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        background: #ffffff;
    }

    .form-main {
        flex-direction: column;
        gap: 20px;
    }

    /* ---- FORM LEFT (INPUT FIELDS) ---- */
    .form-left-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px 20px;
        align-content: start;
    }

    .form-group {
        padding-bottom: 8px;
    }

    .form-group label {
        font-size: 12.5px;
        font-weight: 700;
        margin-bottom: 6px;
        letter-spacing: 0.6px;
        text-transform: uppercase;
        color: #1f2937;
    }

    .form-group label .required {
        color: #ef4444;
        margin-left: 3px;
    }

    .input-wrapper input,
    .input-wrapper select,
    .autocomplete-wrapper input {
        padding: 12px 44px 12px 16px;
        font-size: 15px;
        border: 2px solid #e5e7eb;
        border-radius: 10px;
        line-height: 1.5;
        transition: all 0.25s ease;
    }

    .input-wrapper input:hover,
    .autocomplete-wrapper input:hover {
        border-color: #d1d5db;
        background-color: #fafafa;
    }

    .input-wrapper input:focus,
    .input-wrapper select:focus,
    .autocomplete-wrapper input:focus {
        border-color: #0f9455;
        box-shadow: 0 0 0 4px rgba(15, 148, 85, 0.12);
        background-color: #fff;
    }

    .input-wrapper .input-icon {
        font-size: 18px;
        right: 14px;
        color: #9ca3af;
    }

    /* ---- PHONE INPUT ---- */
    .phone-wrapper {
        gap: 0;
    }

    .phone-prefix {
        padding: 12px 12px 12px 16px;
        font-size: 15px;
        font-weight: 700;
        border: 2px solid #e5e7eb;
        border-right: none;
    }

    .phone-wrapper input {
        padding: 12px 44px 12px 12px;
        font-size: 15px;
        border: 2px solid #e5e7eb;
        border-left: none;
    }

    .phone-wrapper:focus-within .phone-prefix {
        border-color: #0f9455;
        box-shadow: 0 0 0 4px rgba(15, 148, 85, 0.12);
    }

    .phone-wrapper:focus-within input {
        border-color: #0f9455;
        box-shadow: 0 0 0 4px rgba(15, 148, 85, 0.12);
    }

    .phone-hint {
        bottom: -16px;
        font-size: 12px;
        color: #6b7280;
    }

    /* ---- AUTOCOMPLETE ---- */
    .autocomplete-list {
        max-height: 280px;
        border: 2px solid #e5e7eb;
        border-top: none;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
        border-radius: 0 0 10px 10px;
    }

    .autocomplete-item {
        padding: 14px 16px;
        font-size: 15px;
    }

    /* ---- FORM RIGHT (FOTO & TTD) ---- */
    .form-right {
        width: 100%;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 16px;
    }

    .form-right .foto-section {
        grid-column: 1;
    }

    .form-right .foto-penerimaan-section {
        grid-column: 2;
    }

    .form-right .ttd-section {
        grid-column: 1 / 3;
        grid-row: 2;
    }

    /* ---- FOTO BOXES ---- */
    .foto-box,
    .ttd-box {
        border: 3px dashed #a7f3d0;
        border-radius: 12px;
        padding: 16px 12px;
        background: linear-gradient(135deg, #f0faf4 0%, #e8f7f1 100%);
        min-height: 200px;
    }

    .foto-box .camera-icon,
    .ttd-box .pen-icon {
        width: 52px;
        height: 52px;
        margin-bottom: 12px;
        font-size: 24px;
    }

    .foto-box p,
    .ttd-box p {
        font-size: 14px;
        color: #047857;
        font-weight: 500;
        line-height: 1.5;
    }

    .camera-controls {
        gap: 8px;
        margin-top: 12px;
    }

    .btn-camera,
    .btn-ttd {
        padding: 12px 16px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 10px;
        transition: all 0.25s ease;
    }

    .btn-camera:hover,
    .btn-ttd:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(15, 148, 85, 0.3);
    }

    .btn-camera:active,
    .btn-ttd:active {
        transform: translateY(0);
    }

    /* ---- CATATAN ---- */
    .catatan {
        margin-top: 16px;
        padding: 14px 16px;
        background: #fef3c7;
        border-left: 4px solid #f59e0b;
        border-radius: 8px;
        max-height: none;
        overflow: visible;
    }

    .catatan p:first-child {
        font-size: 13px;
        font-weight: 700;
        color: #92400e;
        margin-bottom: 4px;
    }

    .catatan p:last-child {
        font-size: 13px;
        color: #78350f;
        font-style: normal;
    }

    /* ---- SUBMIT BUTTON ---- */
    .btn-simpan {
        width: 100%;
        padding: 16px 20px;
        margin-top: 16px;
        font-size: 16px;
        font-weight: 700;
        border-radius: 10px;
        transition: all 0.25s ease;
        box-shadow: 0 4px 12px rgba(15, 148, 85, 0.2);
        letter-spacing: 0.3px;
    }

    .btn-simpan:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(15, 148, 85, 0.35);
    }

    .btn-simpan:active {
        transform: translateY(-1px);
    }

    /* ---- FOOTER ---- */
    .public-footer {
        margin-top: 20px;
        padding: 8px 12px;
    }

    .public-footer__link {
        font-size: 13px;
        letter-spacing: 0.2px;
    }

    /* ---- MODALS ---- */
    .barcode-modal {
        padding: 40px;
        border-radius: 16px;
        max-width: 480px;
    }

    .barcode-modal h3 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .barcode-modal p {
        font-size: 15px;
        margin-bottom: 20px;
    }

    .barcode-modal img {
        max-width: 320px;
        border-radius: 12px;
    }

    .modal-content {
        padding: 40px;
        max-width: 700px;
        border-radius: 16px;
    }

    .modal-content h3 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .modal-content canvas {
        height: 380px;
        border-radius: 10px;
    }

    .modal-buttons button {
        padding: 14px 32px;
        font-size: 15px;
        border-radius: 10px;
        font-weight: 600;
    }

    /* ---- FLOATING BUTTON ---- */
    .floating-btn {
        width: 72px;
        height: 72px;
        bottom: 40px;
        right: 40px;
        font-size: 32px;
        box-shadow: 0 8px 28px rgba(15, 148, 85, 0.3);
    }

    .floating-btn:hover {
        transform: scale(1.08);
        box-shadow: 0 12px 36px rgba(15, 148, 85, 0.4);
    }

    /* ---- APK REMINDER ---- */
    .apk-reminder {
        width: min(420px, 90vw);
        padding: 20px 20px 18px;
        border-radius: 14px;
    }

    .apk-reminder__logo {
        width: 68px;
        height: 68px;
    }

    .apk-reminder__title {
        font-size: 16px;
    }

    .apk-reminder__desc {
        font-size: 14px;
    }

    .apk-reminder__action {
        padding: 12px 16px;
        font-size: 14px;
        min-width: 160px;
    }
}

/* ---- TABLET LANDSCAPE (landscape + 768-1200px) ---- */
/* Ini mode utama untuk loket: landscape di tablet */
@media (max-width: 1200px) and (orientation: landscape) {
    body {
        padding: 8px 14px;
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        align-items: flex-start;
    }
    .header {
        padding: 12px 25px;
        gap: 14px;
        border-radius: 10px 10px 0 0;
    }
    .header img {
        width: 55px;
        height: 55px;
        padding: 7px;
    }
    .header-text h1 {
        font-size: 20px;
    }
    .header-text p {
        font-size: 12px;
    }
    .form-container {
        padding: 14px 22px 12px;
    }
    .form-main {
        gap: 14px;
        flex-direction: row;
    }
    .form-left {
        flex: 1;
    }
    .form-left-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px 14px;
        align-content: stretch;
        flex: 1;
    }
    .form-right {
        width: 40%;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 10px;
    }
    .form-group label {
        font-size: 12px;
        margin-bottom: 3px;
    }
    .input-wrapper input,
    .input-wrapper select,
    .autocomplete-wrapper input {
        font-size: 14px;
        padding: 9px 38px 9px 12px;
    }
    .phone-prefix {
        font-size: 14px;
        padding: 9px 8px 9px 10px;
    }
    .phone-wrapper input {
        font-size: 14px;
        padding: 9px 38px 9px 8px;
    }
    .phone-hint {
        font-size: 11.5px;
        margin-top: 3px;
    }
    .input-wrapper .input-icon {
        font-size: 15px;
        right: 11px;
    }
    .foto-box,
    .ttd-box {
        aspect-ratio: auto;
        padding: 10px 8px;
        min-height: 80px;
    }
    .foto-box .camera-icon,
    .ttd-box .pen-icon {
        width: 38px;
        height: 38px;
        margin-bottom: 6px;
    }
    .foto-box .camera-icon i,
    .ttd-box .pen-icon i {
        font-size: 17px;
    }
    .foto-box p,
    .ttd-box p {
        font-size: 10.5px;
    }
    .btn-camera,
    .btn-ttd {
        padding: 9px;
        font-size: 13px;
        margin-top: 6px;
    }
    .btn-simpan {
        padding: 11px;
        font-size: 15px;
        margin-top: 8px;
    }
    .catatan {
        margin-top: 4px;
        padding-top: 2px;
    }
    .catatan p:first-child,
    .catatan p:last-child {
        font-size: 11.5px;
    }
    .floating-btn {
        width: 48px;
        height: 48px;
        bottom: 15px;
        right: 15px;
    }
    .floating-btn i {
        font-size: 21px;
    }
}

/* ---- TABLET PORTRAIT (portrait + 600-1200px) ---- */
/* Tablet ditegakkan: scroll aktif, form di atas, foto/ttd di bawah */
@media (max-width: 1200px) and (orientation: portrait) {
    body {
        height: auto;
        min-height: 100vh;
        overflow: auto;
        padding: 15px 20px;
    }
    .wrapper {
        max-width: 100%;
    }
    .header {
        padding: 20px 25px;
        gap: 15px;
    }
    .header img {
        width: 65px;
        height: 65px;
        padding: 8px;
    }
    .header-text h1 {
        font-size: 22px;
    }
    .header-text p {
        font-size: 13px;
    }
    .form-container {
        padding: 18px 22px 15px;
    }
    .form-main {
        flex-direction: column;
        gap: 14px;
    }
    .form-left-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px 14px;
        align-content: stretch;
        flex: 1;
    }
    .form-right {
        width: 100%;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 14px;
    }
    .form-right .foto-section {
        grid-column: 1;
    }
    .form-right .ttd-section {
        grid-column: 2;
        grid-row: 1 / 3;
    }
    .foto-box,
    .ttd-box {
        aspect-ratio: 4 / 3;
        max-height: 260px;
    }
    .btn-camera,
    .btn-ttd {
        padding: 10px;
        font-size: 13px;
    }
    .btn-simpan {
        padding: 12px;
        font-size: 14px;
    }
    .catatan {
        margin-top: 8px;
    }
}

/* ---- MOBILE LANDSCAPE (landscape + max 768px height) ---- */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 8px 15px;
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }
    .header {
        padding: 10px 20px;
        gap: 12px;
    }
    .header img {
        width: 40px;
        height: 40px;
        padding: 5px;
    }
    .header-text h1 {
        font-size: 16px;
    }
    .header-text p {
        font-size: 10px;
    }
    .form-container {
        padding: 10px 15px;
    }
    .form-left-grid {
        gap: 6px 12px;
    }
    .form-group label {
        font-size: 10px;
        margin-bottom: 3px;
    }
    .input-wrapper input,
    .input-wrapper select,
    .autocomplete-wrapper input {
        font-size: 12px;
        padding: 6px 32px 6px 10px;
    }
    .phone-prefix {
        font-size: 12px;
        padding: 6px 5px 6px 8px;
    }
    .phone-wrapper input {
        font-size: 12px;
        padding: 6px 32px 6px 5px;
    }
}

/* ---- MOBILE / SMALL TABLET (max 768px) ---- */
@media (max-width: 768px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow: auto;
        padding: 10px 12px;
        align-items: flex-start;
    }
    .header {
        padding: 18px 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
        border-radius: 10px 10px 0 0;
    }
    .header img {
        width: 58px;
        height: 58px;
        padding: 7px;
    }
    .header-text h1 {
        font-size: 18px;
    }
    .header-text p {
        font-size: 12px;
    }
    .apk-reminder {
        left: 50%;
        top: 50%;
        right: auto;
        bottom: auto;
        width: min(92vw, 360px);
        padding: 10px 10px 9px;
        transform: translate(-50%, calc(-50% + 12px));
    }
    .apk-reminder.is-visible {
        transform: translate(-50%, -50%);
    }
    .form-container {
        padding: 15px 14px 12px;
        border-radius: 0 0 10px 10px;
    }
    .form-main {
        flex-direction: column;
        gap: 15px;
    }
    .form-left-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .form-right {
        width: 100%;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 12px;
    }
    .form-right .foto-section,
    .form-right .ttd-section {
        grid-column: 1;
        grid-row: auto;
    }
    .foto-box,
    .ttd-box {
        aspect-ratio: 4 / 3;
        max-height: 240px;
    }
    .form-group label {
        font-size: 11px;
    }
    .input-wrapper input,
    .input-wrapper select,
    .autocomplete-wrapper input {
        font-size: 13px;
        padding: 9px 38px 9px 12px;
    }
    .phone-prefix {
        font-size: 13px;
        padding: 9px 8px 9px 12px;
    }
    .phone-wrapper input {
        font-size: 13px;
        padding: 9px 38px 9px 8px;
    }
    .btn-camera,
    .btn-ttd {
        padding: 10px;
        font-size: 13px;
    }
    .btn-simpan {
        padding: 12px;
        font-size: 14px;
    }
    .floating-btn {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
    .floating-btn i {
        font-size: 22px;
    }

    .public-footer {
        margin-top: 6px;
        padding: 2px 6px;
    }

    .public-footer__link {
        font-size: 11px;
    }
    .catatan p:first-child,
    .catatan p:last-child {
        font-size: 11px;
    }
    .modal-content {
        padding: 20px 15px;
        width: 95%;
    }
    .barcode-modal {
        padding: 20px 15px;
        width: 95%;
    }
    .barcode-modal img {
        max-width: 220px;
    }
}

/* ---- MOBILE PORTRAIT (max 480px) ---- */
@media (max-width: 480px) {
    body {
        padding: 6px;
    }
    .header {
        padding: 14px 10px;
        gap: 8px;
    }
    .header img {
        width: 48px;
        height: 48px;
        padding: 5px;
    }
    .header-text h1 {
        font-size: 15px;
    }
    .header-text p {
        font-size: 10.5px;
    }
    .apk-reminder {
        width: min(94vw, 340px);
    }
    .apk-reminder__title {
        font-size: 13px;
    }
    .apk-reminder__desc {
        font-size: 11px;
    }
    .form-container {
        padding: 10px 10px;
    }
    .form-left-grid {
        gap: 8px;
    }
    .input-wrapper input,
    .input-wrapper select,
    .autocomplete-wrapper input {
        font-size: 12px;
        padding: 8px 34px 8px 10px;
    }
    .input-wrapper .input-icon {
        font-size: 14px;
        right: 10px;
    }
    .phone-prefix {
        font-size: 12px;
        padding: 8px 5px 8px 8px;
    }
    .phone-wrapper input {
        font-size: 12px;
        padding: 8px 34px 8px 5px;
    }
    .phone-hint {
        font-size: 10px;
    }
    .foto-box,
    .ttd-box {
        aspect-ratio: auto;
        min-height: 180px;
        max-height: 220px;
    }
    .foto-box .camera-icon,
    .ttd-box .pen-icon {
        width: 42px;
        height: 42px;
        margin-bottom: 10px;
    }
    .foto-box .camera-icon i,
    .ttd-box .pen-icon i {
        font-size: 17px;
    }
    .toast-notification {
        font-size: 11px;
        padding: 10px 14px;
        max-width: 96vw;
    }
    .floating-btn {
        width: 44px;
        height: 44px;
        bottom: 12px;
        right: 12px;
    }
    .floating-btn i {
        font-size: 19px;
    }

    .public-footer {
        margin-top: 5px;
        padding: 1px 4px;
    }

    .public-footer__link {
        font-size: 10.5px;
    }
}

/* ---- ANDROID TOUCH FIX (PHONE + TABLET) ---- */
/* Pada Android, kombinasi 100vh + overflow hidden bisa memotong area bawah.
   Pakai scroll vertikal + tombol Kirim sticky supaya tetap terlihat saat form panjang. */
@media (pointer: coarse) and (max-width: 1200px) {
    body {
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        align-items: flex-start;
        padding: 10px 12px;
    }

    .wrapper {
        height: auto;
        min-height: calc(100dvh - 20px);
    }

    .form-container {
        overflow: visible;
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
    }

    .form-container form,
    .form-main,
    .form-left,
    .form-left-grid,
    .form-right {
        min-height: unset;
    }

    .btn-simpan {
        position: sticky;
        bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 40;
        margin-top: 12px;
        padding: 13px;
        font-size: 15px;
        box-shadow: 0 -6px 14px rgba(15, 148, 85, 0.18);
    }
}

@media (pointer: coarse) and (max-width: 768px) {
    .form-container {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    .btn-simpan {
        width: 100%;
        border-radius: 10px;
    }
}

/* ---- LANDSCAPE SAFETY (ALL DEVICES, SHORT VIEWPORT) ---- */
/* Saat tinggi layar terbatas pada mode landscape, aktifkan scroll agar tombol Kirim tidak tertutup. */
@media (orientation: landscape) and (max-height: 900px) {
    body {
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        align-items: flex-start;
    }

    .wrapper {
        height: auto;
        min-height: calc(100dvh - 20px);
    }

    .form-container {
        overflow: visible;
        /* Reserve kecil agar tidak muncul gap besar saat tombol masih mode sticky. */
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }

    .form-container form,
    .form-main,
    .form-left,
    .form-left-grid,
    .form-right {
        min-height: unset;
    }

    .btn-simpan {
        position: sticky;
        bottom: 0;
        z-index: 45;
        margin-top: 12px;
    }
}

/* ---- LANDSCAPE ANDROID/TABLET FIXED SUBMIT ---- */
/* Untuk perangkat touch di landscape, tombol Kirim dikunci di bawah layar agar selalu terlihat. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 900px) {
    body {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    .wrapper,
    .form-container {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    .btn-simpan {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        bottom: calc(10px + env(safe-area-inset-bottom));
        width: min(560px, calc(100vw - 24px));
        margin: 0;
        z-index: 120;
        border-radius: 10px;
        box-shadow:
            0 -6px 14px rgba(15, 148, 85, 0.2),
            0 8px 20px rgba(15, 148, 85, 0.25);
    }

    .floating-btn {
        bottom: calc(88px + env(safe-area-inset-bottom));
    }
}
