/*
|--------------------------------------------------------------------------
| RJA DELIVERY
| Customer Web — Cek Resi
|--------------------------------------------------------------------------
*/

/* ==========================================================
   RESET
========================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
    background: #f5f8fc;
    color: #1d2939;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}


/* ==========================================================
   HEADER
========================================================== */

.customer-header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e6ebf2;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    width: min(1200px, calc(100% - 40px));
    min-height: 78px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-logo {
    display: block;
    width: auto;
    height: 48px;
    object-fit: contain;
}

.main-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    flex: 1;
}

.main-navigation a {
    position: relative;

    color: #1d2939;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;

    padding: 30px 0;

    transition:
        color 0.2s ease;
}

.main-navigation a::after {
    content: "";

    position: absolute;
    left: 0;
    right: 0;
    bottom: 22px;

    height: 2px;

    background: #0b63ce;

    transform: scaleX(0);
    transform-origin: center;

    transition:
        transform 0.2s ease;
}

.main-navigation a:hover {
    color: #0b63ce;
}

.main-navigation a:hover::after {
    transform: scaleX(1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-login,
.btn-logout {
    min-width: 88px;
    min-height: 38px;

    padding: 9px 17px;

    border: 1px solid #0b63ce;
    border-radius: 5px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.btn-login {
    color: #ffffff;
    background: #0b63ce;
}

.btn-login:hover {
    background: #084f9f;
    border-color: #084f9f;
}

.btn-logout {
    color: #0b63ce;
    background: #ffffff;
}

.btn-logout:hover {
    color: #ffffff;
    background: #0b63ce;
}

/*
|--------------------------------------------------------------------------
| Native hidden attribute
|--------------------------------------------------------------------------
*/

.btn-login[hidden],
.btn-logout[hidden] {
    display: none !important;
}


/* ==========================================================
   HERO
========================================================== */

.tracking-hero {
    width: 100%;
    min-height: 260px;

    display: flex;
    align-items: center;

    background:
        linear-gradient(
            135deg,
            #0756b5 0%,
            #0b63ce 55%,
            #1976d2 100%
        );
}

.tracking-hero-content {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;

    padding: 55px 0;
}

.tracking-label {
    display: inline-block;

    margin-bottom: 12px;

    color: #ffffff;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.tracking-hero h1 {
    margin: 0 0 12px;

    color: #ffffff;

    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.1;
    font-weight: 800;
}

.tracking-hero p {
    max-width: 620px;

    margin: 0;

    color: rgba(255, 255, 255, 0.92);

    font-size: 16px;
    line-height: 1.7;
}


/* ==========================================================
   MAIN TRACKING SECTION
========================================================== */

.tracking-page {
    min-height: calc(100vh - 78px);
}

.tracking-section {
    padding: 50px 0 70px;
}

.tracking-container {
    width: min(1000px, calc(100% - 40px));
    margin: 0 auto;
}


/* ==========================================================
   CARDS
========================================================== */

.tracking-card,
.result-card {
    background: #ffffff;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    box-shadow:
        0 5px 18px rgba(15, 23, 42, 0.06);
}

.tracking-card {
    max-width: 760px;
    margin: 0 auto 30px;

    padding: 30px;
}

.tracking-card-header {
    margin-bottom: 25px;
}

.tracking-card-header h2 {
    margin: 0 0 8px;

    color: #172b4d;

    font-size: 24px;
    line-height: 1.3;
}

.tracking-card-header p {
    margin: 0;

    color: #667085;

    font-size: 14px;
    line-height: 1.6;
}


/* ==========================================================
   FORM
========================================================== */

.tracking-form {
    display: flex;
    align-items: flex-end;
    gap: 14px;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    color: #344054;

    font-size: 13px;
    font-weight: 700;
}

.form-group input {
    width: 100%;
    height: 46px;

    padding: 0 14px;

    border: 1px solid #cbd5e1;
    border-radius: 6px;

    outline: none;

    color: #1d2939;
    background: #ffffff;

    font-size: 14px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.form-group input::placeholder {
    color: #98a2b3;
}

.form-group input:focus {
    border-color: #0b63ce;

    box-shadow:
        0 0 0 3px rgba(11, 99, 206, 0.12);
}

.input-hint {
    display: block;

    margin-top: 7px;

    color: #667085;

    font-size: 11px;
    line-height: 1.5;
}

.btn-tracking {
    min-width: 130px;
    height: 46px;

    padding: 0 20px;

    border: 1px solid #0b63ce;
    border-radius: 6px;

    color: #ffffff;
    background: #0b63ce;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        opacity 0.2s ease;
}

.btn-tracking:hover:not(:disabled) {
    background: #084f9f;
    border-color: #084f9f;
}

.btn-tracking:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.btn-loading {
    display: inline-block;
}

.btn-loading[hidden] {
    display: none !important;
}

#btnTrackingText[hidden] {
    display: none !important;
}

/* ==========================================================
   ALERT
========================================================== */

.tracking-alert {
    margin-top: 20px;

    padding: 13px 15px;

    border: 1px solid #e1e7ef;
    border-radius: 6px;

    background: #f8fafc;

    color: #344054;

    font-size: 13px;
    line-height: 1.5;
}

.tracking-alert.success {
    border-color: #b7dfc5;
    background: #f0fdf4;
    color: #166534;
}

.tracking-alert.error {
    border-color: #f1b5b5;
    background: #fff5f5;
    color: #b42318;
}


/* ==========================================================
   RESULT
========================================================== */

.tracking-result {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tracking-result[hidden] {
    display: none !important;
}

.result-card {
    padding: 28px;
}

.result-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding-bottom: 22px;

    border-bottom: 1px solid #edf1f5;
}

.result-label {
    display: block;

    margin-bottom: 7px;

    color: #667085;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.result-card-header h2 {
    margin: 0;

    color: #172b4d;

    font-size: 22px;
    line-height: 1.3;
    word-break: break-word;
}


/* ==========================================================
   STATUS
========================================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 32px;

    padding: 7px 13px;

    border-radius: 20px;

    color: #0b63ce;
    background: #edf5ff;

    font-size: 11px;
    font-weight: 700;

    white-space: nowrap;
}

.status-badge.status-success {
    color: #166534;
    background: #f0fdf4;
}

.status-badge.status-danger {
    color: #b42318;
    background: #fff5f5;
}


/* ==========================================================
   SUMMARY
========================================================== */

.result-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;

    padding-top: 22px;
}

.summary-item,
.info-item {
    min-width: 0;
}

.summary-item span,
.info-item span {
    display: block;

    margin-bottom: 7px;

    color: #667085;

    font-size: 11px;
    line-height: 1.4;
}

.summary-item strong,
.info-item strong {
    display: block;

    color: #172b4d;

    font-size: 14px;
    line-height: 1.5;

    word-break: break-word;
}


/* ==========================================================
   CARD TITLE
========================================================== */

.result-card-title {
    margin-bottom: 22px;
}

.result-card-title h3 {
    margin: 0 0 6px;

    color: #172b4d;

    font-size: 19px;
    line-height: 1.4;
}

.result-card-title p {
    margin: 0;

    color: #667085;

    font-size: 13px;
    line-height: 1.6;
}


/* ==========================================================
   PACKAGE INFORMATION
========================================================== */

.package-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px 20px;
}


/* ==========================================================
   TRACKING TIMELINE
========================================================== */

.tracking-timeline {
    position: relative;

    display: flex;
    flex-direction: column;
}

.tracking-timeline:not(:empty)::before {
    /* Garis penghubung dihapus agar tidak menimpa teks riwayat. */
    content: none;
    display: none;
}

.timeline-item {
    position: relative;

    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);

    column-gap: 16px;

    padding-bottom: 25px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: relative;
    z-index: 2;

    width: 18px;
    height: 18px;

    margin-top: 2px;

    border: 3px solid #ffffff;
    border-radius: 50%;

    background: #0b63ce;

    box-shadow:
        0 0 0 1px #0b63ce;
}

.timeline-content {
    min-width: 0;
}

.timeline-content-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;

    margin-bottom: 5px;
}

.timeline-title {
    margin: 0;

    color: #172b4d;

    font-size: 14px;
    line-height: 1.5;
    font-weight: 700;
}

.timeline-date {
    flex-shrink: 0;

    color: #667085;

    font-size: 11px;
    line-height: 1.5;
}

.timeline-status {
    margin: 0 0 5px;

    color: #0b63ce;

    font-size: 11px;
    font-weight: 700;
}

.timeline-description {
    margin: 0;

    color: #667085;

    font-size: 12px;
    line-height: 1.6;
}

.timeline-location {
    margin-top: 7px;

    color: #475467;

    font-size: 11px;
    line-height: 1.5;
}


/* ==========================================================
   EMPTY TRACKING
========================================================== */

.tracking-empty {
    padding: 30px 20px;

    text-align: center;

    border: 1px dashed #d6dee8;
    border-radius: 8px;

    background: #fafcff;
}

.tracking-empty[hidden] {
    display: none !important;
}

.empty-icon {
    width: 38px;
    height: 38px;

    margin: 0 auto 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #edf5ff;

    color: #0b63ce;

    font-size: 18px;
    font-weight: 700;
}

.tracking-empty h4 {
    margin: 0 0 7px;

    color: #344054;

    font-size: 14px;
}

.tracking-empty p {
    max-width: 420px;

    margin: 0 auto;

    color: #667085;

    font-size: 12px;
    line-height: 1.6;
}


/* ==========================================================
   FOOTER
========================================================== */

.customer-footer {
    margin-top: 20px;

    color: #ffffff;
    background: #0b2f5b;
}

.footer-container {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;

    padding: 45px 0;

    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 50px;
}

.footer-brand img {
    display: block;

    width: auto;
    height: 45px;

    margin-bottom: 15px;

    object-fit: contain;
}

.footer-brand p,
.footer-contact p {
    max-width: 350px;

    margin: 0;

    color: rgba(255, 255, 255, 0.78);

    font-size: 13px;
    line-height: 1.7;
}

.footer-links h4,
.footer-contact h4 {
    margin: 0 0 15px;

    color: #ffffff;

    font-size: 13px;
    font-weight: 700;
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.78);

    font-size: 12px;

    transition:
        color 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-bottom p {
    width: min(1200px, calc(100% - 40px));

    margin: 0 auto;

    padding: 18px 0;

    color: rgba(255, 255, 255, 0.65);

    font-size: 11px;
    line-height: 1.5;
}


/* ==========================================================
   RESPONSIVE — TABLET
========================================================== */

@media (max-width: 900px) {

    .header-container {
        gap: 18px;
    }

    .main-navigation {
        gap: 16px;
    }

    .main-navigation a {
        font-size: 11px;
    }

    .result-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .package-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 35px;
    }

    .footer-contact {
        grid-column: 1 / -1;
    }
}


/* ==========================================================
   RESPONSIVE — MOBILE
========================================================== */

@media (max-width: 700px) {

    .header-container {
        min-height: auto;

        padding: 14px 0;

        flex-wrap: wrap;
    }

    .brand-logo {
        height: 40px;
    }

    .main-navigation {
        order: 3;

        width: 100%;

        justify-content: flex-start;

        overflow-x: auto;

        padding-bottom: 3px;

        gap: 20px;
    }

    .main-navigation a {
        flex-shrink: 0;

        padding: 8px 0;

        font-size: 10px;
    }

    .main-navigation a::after {
        bottom: 0;
    }

    .header-actions {
        margin-left: auto;
    }

    .btn-login,
    .btn-logout {
        min-width: 76px;
        min-height: 34px;

        padding: 7px 12px;

        font-size: 10px;
    }

    .tracking-hero {
        min-height: 220px;
    }

    .tracking-hero-content {
        padding: 45px 0;
    }

    .tracking-hero h1 {
        font-size: 34px;
    }

    .tracking-hero p {
        font-size: 14px;
    }

    .tracking-section {
        padding: 30px 0 50px;
    }

    .tracking-container {
        width: min(100% - 24px, 1000px);
    }

    .tracking-card,
    .result-card {
        padding: 20px;
    }

    .tracking-form {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-tracking {
        width: 100%;
    }

    .result-card-header {
        flex-direction: column;
    }

    .result-summary-grid,
    .package-info-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .timeline-content-header {
        flex-direction: column;
        gap: 3px;
    }

    .timeline-date {
        white-space: normal;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;

        padding: 35px 0;
    }

    .footer-contact {
        grid-column: auto;
    }
}


/* ==========================================================
   RESPONSIVE — SMALL MOBILE
========================================================== */

@media (max-width: 420px) {

    .header-container {
        width: calc(100% - 24px);
    }

    .tracking-hero-content {
        width: calc(100% - 24px);
    }

    .tracking-hero h1 {
        font-size: 30px;
    }

    .tracking-card,
    .result-card {
        padding: 17px;
    }

    .result-card-header h2 {
        font-size: 18px;
    }

    .status-badge {
        min-height: 29px;

        padding: 6px 10px;

        font-size: 10px;
    }

    .footer-container,
    .footer-bottom p {
        width: calc(100% - 24px);
    }
}

/* ==========================================================
   QR SCANNER
========================================================== */

.tracking-scan {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-scan-qr,
.btn-close-scanner {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        opacity 0.2s ease,
        box-shadow 0.2s ease;
}

.btn-scan-qr {
    background: #0b63ce;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(11, 99, 206, 0.18);
}

.btn-scan-qr:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(11, 99, 206, 0.24);
}

.btn-close-scanner {
    background: #dc2626;
    color: #ffffff;
}

.btn-close-scanner:hover {
    opacity: 0.92;
}

.qr-scanner {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #0f172a;
}

.qr-scanner video {
    width: 100% !important;
    height: auto !important;
    display: block;
}

.qr-scanner img {
    max-width: 100%;
}

@media (max-width: 600px) {

    .qr-scanner {
        max-width: 100%;
        border-radius: 12px;
    }

    .btn-scan-qr,
    .btn-close-scanner {
        min-height: 48px;
    }
}