* {
    box-sizing: border-box;
    max-width: 100%;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Arial, sans-serif;
    color: #111827;
    background: #f7f7f8;
}

button,
input,
select,
textarea {
    font: inherit;
    font-size: 16px;
}

button {
    cursor: pointer;
}

.app-page {
    width: 100%;
    min-height: 100vh;
    padding: 16px 14px 96px;
    overflow-x: hidden;
}

.app-shell {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 2px 18px;
}

.app-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 18px;
    background: rgba(255,255,255,.72);
    padding: 7px;
    box-shadow: 0 10px 30px rgba(15,23,42,.08);
}

.app-header small {
    display: block;
    color: #007aff;
    font-weight: 800;
    font-size: 12px;
    margin-bottom: 3px;
}

.app-header h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -.8px;
}

.progress-card,
.form-card {
    width: 100%;
    margin-bottom: 14px;
    padding: 16px;
    border-radius: 26px;
    background: rgba(255,255,255,.76);
    border: 1px solid rgba(255,255,255,.9);
    box-shadow: 0 16px 40px rgba(15,23,42,.08);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.progress-info span {
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
}

.progress-info strong {
    font-size: 13px;
}

.progress-track {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(17,24,39,.08);
}

.progress-fill {
    width: 20%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #007aff, #5856d6);
    transition: width .22s ease;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
    animation: fadeIn .24s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-card h2 {
    margin: 0 0 16px;
    font-size: 20px;
    letter-spacing: -.4px;
}

.form-card h3 {
    margin: 16px 0 8px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #374151;
    font-size: 13px;
    font-weight: 800;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 50px;
    border: 1px solid rgba(17,24,39,.08);
    border-radius: 18px;
    outline: 0;
    padding: 12px 14px;
    color: #111827;
    background: rgba(255,255,255,.86);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
}

textarea {
    min-height: 92px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(0,122,255,.35);
    box-shadow: 0 0 0 4px rgba(0,122,255,.09);
}

.hs-search-field {
    position: relative;
}

.hs-autocomplete {
    display: none;
    margin-top: 10px;
    padding: 8px;
    border-radius: 22px;
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(255,255,255,.92);
    box-shadow: 0 14px 34px rgba(15,23,42,.08);
}

.hs-autocomplete.show {
    display: block;
}

.hs-suggestion {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 46px;
    gap: 10px;
    align-items: center;
    border: 0;
    text-align: left;
    padding: 12px;
    border-radius: 16px;
    background: transparent;
}

.hs-suggestion:hover,
.hs-suggestion.active {
    background: rgba(0,122,255,.08);
}

.hs-suggestion-code {
    display: inline-block;
    margin-bottom: 5px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #007aff;
    background: rgba(0,122,255,.10);
    font-size: 12px;
    font-weight: 900;
}

.hs-suggestion-title {
    display: block;
    color: #111827;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
}

.hs-suggestion-desc {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

.hs-ai-score {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #007aff;
    background: rgba(0,122,255,.10);
    font-size: 12px;
    font-weight: 900;
}

.hs-empty-result {
    padding: 14px;
    color: #6b7280;
    font-size: 13px;
    text-align: center;
}

mark {
    color: #007aff;
    background: rgba(0,122,255,.12);
    border-radius: 4px;
    padding: 0 2px;
}

.selected-box {
    display: none;
    margin: 2px 0 14px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(0,122,255,.07);
    border: 1px solid rgba(0,122,255,.14);
}

.selected-box.show {
    display: block;
}

.selected-box span,
.selected-box small {
    display: block;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
}

.selected-box strong {
    display: block;
    margin: 4px 0;
    font-size: 22px;
}

.selected-box p {
    margin: 4px 0 8px;
    color: #374151;
    font-size: 13px;
    line-height: 1.4;
}

.tax-grid,
.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin: 8px 0 14px;
}

.tax-grid div,
.summary-grid div,
.receipt-row,
.receipt-total {
    padding: 13px;
    border-radius: 18px;
    background: rgba(255,255,255,.76);
    border: 1px solid rgba(17,24,39,.06);
}

.tax-grid span,
.summary-grid span,
.receipt-row span,
.receipt-total span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 4px;
}

.tax-grid strong,
.summary-grid strong,
.receipt-row strong,
.receipt-total strong {
    font-size: 15px;
    font-weight: 900;
}

.primary-btn {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 999px;
    color: white;
    background: linear-gradient(135deg, #007aff, #5856d6);
    font-weight: 900;
    box-shadow: 0 14px 30px rgba(0,122,255,.22);
}

.primary-btn.outline {
    color: #007aff;
    background: rgba(0,122,255,.10);
    box-shadow: none;
}

.primary-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.empty-cart {
    padding: 16px;
    text-align: center;
    color: #6b7280;
    border-radius: 18px;
    background: rgba(255,255,255,.62);
    margin-bottom: 12px;
}

.cart-list {
    display: grid;
    gap: 10px;
}

.cart-item {
    padding: 13px;
    border-radius: 18px;
    background: rgba(255,255,255,.76);
    border: 1px solid rgba(17,24,39,.06);
}

.cart-item-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.cart-item-head strong {
    font-size: 15px;
}

.cart-item-head button {
    border: 0;
    border-radius: 999px;
    color: #ef4444;
    background: rgba(239,68,68,.10);
    padding: 6px 10px;
    font-size: 12px;
}

.cart-item p {
    margin: 7px 0 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
}

.receipt-card hr {
    border: 0;
    border-top: 1px solid rgba(17,24,39,.08);
    margin: 16px 0;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.receipt-card p {
    margin: 0;
    color: #374151;
    line-height: 1.5;
}

.summary-items-list {
    display: grid;
    gap: 8px;
}

.summary-item {
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(17,24,39,.06);
}

.summary-item strong {
    display: block;
    font-size: 14px;
}

.summary-item span {
    color: #6b7280;
    font-size: 12px;
}

.receipt-total {
    margin: 16px 0;
    color: white;
    background: #111827;
}

.receipt-total span {
    color: rgba(255,255,255,.72);
}

/* LIQUID GLASS STEP DOCK - FINAL */
.step-dock.ios-dock {
    position: fixed;
    left: 50%;
    bottom: 14px;
    z-index: 80;

    width: min(304px, calc(100vw - 46px));
    height: 58px;

    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;

    padding: 7px;
    transform: translateX(-50%);

    border-radius: 999px;
    overflow: hidden;

    background: rgba(255,255,255,.42);
    border: 1px solid rgba(255,255,255,.55);

    box-shadow:
        0 14px 36px rgba(15,23,42,.14),
        inset 0 1px 1px rgba(255,255,255,.75);

    backdrop-filter: blur(34px) saturate(220%);
    -webkit-backdrop-filter: blur(34px) saturate(220%);
}

.dock-indicator {
    position: absolute;
    top: 7px;
    left: 7px;

    width: calc((100% - 14px) / 5);
    height: 44px;

    border-radius: 999px;
    background: rgba(0,122,255,.92);

    box-shadow:
        0 8px 22px rgba(0,122,255,.30),
        inset 0 1px 1px rgba(255,255,255,.45);

    transition: transform .38s cubic-bezier(.22, 1, .36, 1);
    z-index: 0;
}

.step-dock[data-active="1"] .dock-indicator { transform: translateX(0); }
.step-dock[data-active="2"] .dock-indicator { transform: translateX(100%); }
.step-dock[data-active="3"] .dock-indicator { transform: translateX(200%); }
.step-dock[data-active="4"] .dock-indicator { transform: translateX(300%); }
.step-dock[data-active="5"] .dock-indicator { transform: translateX(400%); }

.ios-dock .dock-step {
    position: relative;
    z-index: 2;

    width: 100%;
    height: 44px;

    border: 0;
    padding: 0;
    margin: 0;

    display: grid;
    place-items: center;

    background: transparent !important;
    color: rgba(17,24,39,.48) !important;
    box-shadow: none !important;

    transition: color .22s ease;
}

.ios-dock .dock-step.active {
    color: #fff !important;
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}

.ios-dock .dock-step svg {
    width: 21px;
    height: 21px;

    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ios-dock .dock-step:active {
    transform: scale(.92) !important;
}

/* STEP TRANSITION */
.wizard-step {
    display: none;
    transform-origin: center bottom;
}

.wizard-step.active {
    display: block;
}

.wizard-step.step-enter {
    display: block;
    opacity: 0;
    transform: translateY(24px) scale(.97);
    filter: blur(8px);
}

.wizard-step.step-enter-active {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    transition:
        opacity .32s ease,
        transform .42s cubic-bezier(.22, 1, .36, 1),
        filter .32s ease;
}

.wizard-step.step-exit {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.wizard-step.step-exit-active {
    opacity: 0;
    transform: translateY(-14px) scale(.985);
    filter: blur(7px);
    transition:
        opacity .22s ease,
        transform .26s ease,
        filter .22s ease;
}

@media (max-width: 420px) {
    .step-dock.ios-dock {
        width: min(286px, calc(100vw - 42px));
        height: 56px;
        bottom: 14px;
    }

    .dock-indicator {
        height: 42px;
    }

    .ios-dock .dock-step {
        height: 42px;
    }

    .ios-dock .dock-step svg {
        width: 20px;
        height: 20px;
    }
}

/* ===========================================
   Same As Sender
=========================================== */

.same-sender-box{
    display:flex;
    align-items:center;
    gap:14px;
    padding:14px 16px;
    border:1px solid #e6e8ef;
    border-radius:14px;
    background:#fafbfd;
    margin-bottom:18px;
}

.same-sender-text{
    display:flex;
    flex-direction:column;
}

.same-sender-text strong{
    font-size:15px;
    color:#222;
    font-weight:600;
}

.same-sender-text small{
    color:#7b8496;
    margin-top:3px;
    font-size:13px;
}

.switch{
    position:relative;
    display:inline-block;
    width:54px;
    height:30px;
    flex-shrink:0;
}

.switch input{
    opacity:0;
    width:0;
    height:0;
}

.slider{
    position:absolute;
    cursor:pointer;
    inset:0;
    background:#d8dbe3;
    transition:.25s;
    border-radius:999px;
}

.slider:before{
    position:absolute;
    content:"";
    width:24px;
    height:24px;
    left:3px;
    top:3px;
    background:#fff;
    border-radius:50%;
    transition:.25s;
    box-shadow:0 2px 8px rgba(0,0,0,.18);
}

.switch input:checked + .slider{
    background:#2F80ED;
}

.switch input:checked + .slider:before{
    transform:translateX(24px);
}

.switch input:focus + .slider{
    box-shadow:0 0 0 3px rgba(47,128,237,.15);
}

@media (max-width:768px){

.same-sender-box{
    padding:12px;
    gap:12px;
}

.same-sender-text strong{
    font-size:14px;
}

.same-sender-text small{
    font-size:12px;
}

}

/* ===== Qty & Harga ===== */

.item-input-row{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
}

.item-input-row .form-group{
    margin-bottom:0;
}

@media (max-width:768px){

.item-input-row{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}

.item-input-row .form-group{
    width:100%;
    margin:0;
}

.item-input-row input{
    width:100%;
    box-sizing:border-box;
}

}

/* ===== FINAL FIX: HS Item without Shipping on Step 4 ===== */
.tax-grid.tax-grid-no-shipping{
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shipment-cost-grid{
    margin-top: 10px;
}

.shipment-cost-grid div:last-child{
    background:#111827;
    color:#fff;
}

.shipment-cost-grid div:last-child span{
    color:rgba(255,255,255,.72);
}

@media (max-width:480px){
    .tax-grid.tax-grid-no-shipping{
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap:8px;
    }

    .tax-grid.tax-grid-no-shipping div{
        padding:11px 9px;
    }

    .tax-grid.tax-grid-no-shipping span{
        font-size:11px;
    }

    .tax-grid.tax-grid-no-shipping strong{
        font-size:13px;
    }

    .shipment-cost-grid{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ===== Signature ===== */

.signature-wrapper{
    display:flex;
    flex-direction:column;
    gap:12px;
}

#signaturePad{
    width:100%;
    height:220px;
    display:block;
    cursor:crosshair;

    border-radius:20px;
    border:1px solid rgba(17,24,39,.08);

    background:
        linear-gradient(rgba(255,255,255,.85),rgba(255,255,255,.85)),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 34px,
            rgba(0,122,255,.05) 35px
        );

    touch-action:none;
    pointer-events:auto;
    -ms-touch-action:none;

    overscroll-behavior:none;
    user-select:none;
    -webkit-user-select:none;
    -webkit-touch-callout:none;
    -webkit-user-drag:none;
}

.signature-clear{
    align-self:flex-end;
}