/* ==========================================================================
   AutoKirim Landing v2 — Cek Paket
   Hero, form dasar & state kosong memakai cek-ongkir.css; file ini hanya
   menambahkan bagian yang khusus halaman lacak paket.
   ========================================================================== */

/* ---------- form ---------- */

.ak-paket-form {
    grid-template-columns: minmax(0, 1fr) auto;
}

.ak-paket-form--captcha {
    grid-template-columns: minmax(0, 1fr) 215px auto;
}

.ak-paket-form__submit {
    min-width: 172px;
    font-size: 1.05rem;
    font-weight: 700;
}

/* ---------- input AWB (pill) ---------- */

.ak-ongkir-form__control.ak-awb-tags {
    flex-wrap: wrap;
    gap: 6px 8px;
    height: auto;
    min-height: 52px;
    padding: 8px 12px;
    cursor: text;
}

.ak-awb-tags__input {
    flex: 1 1 160px;
    height: 34px;
    padding: 0 4px;
}

.ak-awb-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 5px 6px 5px 12px;
    border-radius: 999px;
    background: var(--ak-red-soft);
    color: var(--ak-red-dark);
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.3;
}

.ak-awb-tag__text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.ak-awb-tag__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.ak-awb-tag__remove:hover,
.ak-awb-tag__remove:focus-visible {
    background: var(--ak-red);
    color: #fff;
    outline: 0;
}

/* Tombol & captcha tetap sejajar baris atas saat pill membuat input tinggi. */
.ak-paket-form {
    align-items: start;
}

.ak-paket-form .ak-ongkir-form__submit {
    margin-top: 29px;
}

/* ---------- result ---------- */

.ak-paket-result {
    padding: 48px 0 var(--ak-section-y);
}

.ak-paket-result__caption {
    margin: 0 0 16px;
    color: #404040;
    font-size: 1.05rem;
}

.ak-paket-list {
    display: grid;
    gap: 10px;
}

.ak-paket-card {
    padding: 18px 24px 18px 28px;
    border: 1px solid #dcdcdc;
    border-radius: 12px;
    background: #fff;
}

.ak-paket-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ak-paket-card__awb {
    margin: 0;
    min-width: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ak-ink);
    overflow-wrap: anywhere;
}

.ak-paket-card__btn {
    flex-shrink: 0;
    min-width: 128px;
    padding: 9px 20px;
    border: 1px solid #f26b6b;
    border-radius: 999px;
    background: #fff;
    color: var(--ak-red);
    font: inherit;
    font-size: .9rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.ak-paket-card__btn:hover {
    background: var(--ak-red-soft);
}

.ak-paket-card__btn:disabled {
    opacity: .6;
    cursor: progress;
}

.ak-paket-card__body {
    margin-top: 14px;
}

.ak-paket-card__message {
    margin: 0;
    color: var(--ak-ink);
    font-size: .95rem;
    line-height: 1.6;
}

/* ---------- timeline ---------- */

.ak-paket-timeline {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ak-paket-timeline__item {
    position: relative;
    display: grid;
    grid-template-columns: 96px 32px minmax(0, 1fr);
    column-gap: 12px;
    padding-bottom: 18px;
}

.ak-paket-timeline__item:last-child {
    padding-bottom: 0;
}

.ak-paket-timeline__when {
    text-align: right;
    font-size: .93rem;
    line-height: 1.5;
    color: var(--ak-ink);
}

.ak-paket-timeline__when span {
    display: block;
}

.ak-paket-timeline__dot {
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 13px;
}

.ak-paket-timeline__dot::before {
    content: "";
    position: relative;
    z-index: 1;
    width: 12px;
    height: 12px;
    border: 1px solid #555;
    border-radius: 50%;
    background: #fff;
}

/* Garis putus-putus ke item berikutnya. */
.ak-paket-timeline__item:not(:last-child) .ak-paket-timeline__dot::after {
    content: "";
    position: absolute;
    top: 25px;
    bottom: -31px;
    left: 50%;
    border-left: 1px dashed #555;
}

.ak-paket-timeline__item:first-child .ak-paket-timeline__dot::before {
    width: 16px;
    height: 16px;
    margin-top: -2px;
    border: 2px solid var(--ak-red);
}

.ak-paket-timeline__info {
    font-size: .95rem;
    line-height: 1.5;
    color: var(--ak-ink);
    overflow-wrap: anywhere;
}

.ak-paket-timeline__status {
    display: block;
}

.ak-paket-timeline__desc {
    display: block;
}

/* ---------- modal ---------- */

.ak-paket-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(70, 70, 70, .8);
}

.ak-paket-modal[hidden] {
    display: none;
}

body.ak-paket-modal-open {
    overflow: hidden;
}

.ak-paket-modal__dialog {
    width: 100%;
    max-width: 860px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 48px 64px 56px;
    border-radius: 28px;
    background: #fff;
    text-align: center;
}

.ak-paket-modal__title {
    margin: 0 0 24px;
    font-size: clamp(1.3rem, 2.4vw, 1.75rem);
    font-weight: 700;
    color: #000;
}

.ak-paket-modal__text {
    max-width: 640px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #111;
}

.ak-paket-modal__text b {
    overflow-wrap: anywhere;
}

.ak-paket-modal__error {
    margin: 24px 0 0;
    color: var(--ak-red);
    font-size: 1.1rem;
    font-weight: 700;
}

.ak-paket-pin {
    display: flex;
    justify-content: center;
    gap: 44px;
    margin: 36px 0 52px;
}

.ak-paket-pin__box {
    width: 118px;
    height: 118px;
    padding: 0;
    border: 1px solid #000;
    border-radius: 14px;
    background: #fff;
    text-align: center;
    font: inherit;
    font-size: 2.6rem;
    font-weight: 700;
    color: #000;
    outline: 0;
    transition: border-color .2s, box-shadow .2s;
}

.ak-paket-pin__box:focus {
    border-color: var(--ak-red);
    box-shadow: 0 0 0 4px var(--ak-red-soft);
}

.ak-paket-pin.is-invalid .ak-paket-pin__box {
    border-color: var(--ak-red);
}

.ak-paket-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 30px;
}

.ak-paket-modal__confirm,
.ak-paket-modal__cancel {
    min-width: 180px;
    padding: 14px 24px;
    border-radius: 10px;
    font: inherit;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s, color .2s, opacity .2s;
}

.ak-paket-modal__confirm {
    border: 1px solid var(--ak-red);
    background: var(--ak-red);
    color: #fff;
}

.ak-paket-modal__confirm:hover {
    background: var(--ak-red-dark);
}

.ak-paket-modal__confirm:disabled {
    border-color: #eee;
    background: #eee;
    color: #bdbdbd;
    cursor: not-allowed;
}

.ak-paket-modal__confirm.is-loading {
    opacity: .75;
    cursor: progress;
}

.ak-paket-modal__cancel {
    border: 1px solid #777;
    background: #fff;
    color: #777;
}

.ak-paket-modal__cancel:hover {
    background: #f5f5f5;
}

/* ---------- responsive ---------- */

@media (max-width: 991.98px) {
    .ak-paket-form--captcha {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .ak-paket-form--captcha .ak-ongkir-form__field:first-child,
    .ak-paket-form--captcha .ak-paket-form__submit {
        grid-column: 1 / -1;
    }

    /* Tombol pindah ke baris sendiri, tidak perlu disejajarkan dengan label. */
    .ak-paket-form--captcha .ak-ongkir-form__submit {
        margin-top: 0;
    }

    .ak-paket-modal__dialog {
        padding: 36px 32px 40px;
    }

    .ak-paket-pin {
        gap: 20px;
    }

    .ak-paket-pin__box {
        width: 88px;
        height: 88px;
        font-size: 2.1rem;
    }
}

@media (max-width: 575.98px) {
    .ak-paket-form,
    .ak-paket-form--captcha {
        grid-template-columns: minmax(0, 1fr);
    }

    .ak-paket-form__submit,
    .ak-paket-form .ak-ongkir-form__submit {
        width: 100%;
        margin-top: 0;
    }

    .ak-awb-tags__input {
        flex-basis: 100%;
    }

    .ak-paket-card {
        padding: 16px;
    }

    .ak-paket-card__awb {
        font-size: 1.1rem;
    }

    .ak-paket-card__btn {
        min-width: 96px;
    }

    .ak-paket-timeline__item {
        grid-template-columns: 82px 24px minmax(0, 1fr);
        column-gap: 8px;
    }

    .ak-paket-timeline__when,
    .ak-paket-timeline__info {
        font-size: .85rem;
    }

    .ak-paket-modal__dialog {
        padding: 28px 20px 28px;
        border-radius: 20px;
    }

    .ak-paket-modal__text {
        font-size: .95rem;
    }

    .ak-paket-pin {
        gap: 12px;
        margin: 24px 0 32px;
    }

    .ak-paket-pin__box {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
        border-radius: 10px;
    }

    .ak-paket-modal__actions {
        gap: 12px;
    }

    .ak-paket-modal__confirm,
    .ak-paket-modal__cancel {
        flex: 1;
        min-width: 0;
    }
}
