:root {
    --ink: #172a34;
    --muted: #52656f;
    --line: #dce5e9;
    --surface: #f4f8fa;
    --maersk: #00a8d1;
    --maersk-dark: #006983;
    --signal: #f59e0b;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: #ffffff;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-width: 320px;
    background: #ffffff;
}

a {
    color: inherit;
}

.portal-header {
    min-height: 88px;
    display: flex;
    align-items: stretch;
    border-top: 6px solid var(--signal);
    border-bottom: 1px solid var(--line);
}

.brand {
    width: 245px;
    display: flex;
    align-items: center;
    padding: 14px 24px;
    background: #ffffff;
}

.brand img {
    display: block;
    width: 176px;
    height: auto;
}

.portal-title {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(24px, 5vw, 72px);
    color: #ffffff;
    background: var(--maersk-dark);
}

.portal-title span {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
}

.portal-title strong {
    font-size: 24px;
    text-align: right;
}

.service-nav {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px clamp(20px, 5vw, 72px);
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.service-nav a {
    flex: 0 0 auto;
    padding: 9px 12px;
    color: var(--maersk-dark);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.service-nav a:hover,
.service-nav a:focus-visible,
.service-nav a.active {
    border-bottom-color: var(--maersk);
    outline: none;
}

.workflow-page,
.result-page {
    padding: 42px 0 64px;
}

.workflow-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 460px);
    gap: 48px;
    align-items: end;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--line);
}

.workflow-heading h1,
.result-page h1 {
    margin: 0;
}

.workflow-heading p {
    color: var(--muted);
    line-height: 1.5;
}

.workflow-heading a,
.depot-note a {
    color: var(--maersk-dark);
    font-weight: 700;
}

.depot-note {
    margin: 0;
    padding: 16px 18px;
    border-left: 3px solid var(--maersk);
    background: var(--surface);
}

.form-alert {
    margin: 24px 0;
    padding: 14px 16px;
    color: #8a1c1c;
    border: 1px solid #e6bcbc;
    background: #fff5f5;
}

.linking-form {
    max-width: 900px;
    margin-top: 28px;
}

.workflow-step {
    margin: 0;
    padding: 28px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
}

.workflow-step legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 19px;
    font-weight: 700;
}

.workflow-step legend span {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    border-radius: 50%;
    background: var(--maersk-dark);
}

.choice-grid,
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.choice-option {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #ffffff;
}

.choice-option:has(input:checked) {
    border-color: var(--maersk-dark);
    background: var(--surface);
}

.choice-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--maersk-dark);
}

.choice-option span,
.choice-option small,
.form-grid label,
.container-row label,
.file-field,
.tracking-form label {
    display: block;
}

.choice-option small,
.field-help,
.file-field small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.form-grid label,
.container-row label,
.file-field,
.tracking-form label {
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.form-grid input,
.form-grid select,
.container-row input,
.file-field input,
.tracking-form input {
    width: 100%;
    min-height: 44px;
    margin-top: 7px;
    padding: 9px 11px;
    color: var(--ink);
    font: inherit;
    font-weight: 400;
    border: 1px solid #b9c7ce;
    border-radius: 3px;
    background: #ffffff;
}

.form-grid input:focus,
.form-grid select:focus,
.container-row input:focus,
.file-field input:focus,
.tracking-form input:focus {
    border-color: var(--maersk-dark);
    outline: 2px solid rgba(0, 105, 131, 0.15);
}

.form-grid select {
    width: 100%;
    min-height: 44px;
    margin-top: 7px;
    padding: 9px 11px;
    color: var(--ink);
    font: inherit;
    font-weight: 400;
    border: 1px solid #b9c7ce;
    border-radius: 3px;
    background: #ffffff;
}

.form-success {
    margin: 24px 0;
    padding: 14px 16px;
    color: #185c37;
    border: 1px solid #acd2bc;
    background: #eaf7ef;
}

.wide-form {
    max-width: 1040px;
}

.verification-row {
    display: grid;
    grid-template-columns: minmax(240px, 420px) auto;
    gap: 12px;
    align-items: end;
}

.verification-row label,
.simple-container-row label {
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.verification-row input,
.simple-container-row input {
    width: 100%;
    min-height: 44px;
    margin-top: 7px;
    padding: 9px 11px;
    color: var(--ink);
    font: inherit;
    font-weight: 400;
    border: 1px solid #b9c7ce;
    border-radius: 3px;
}

.verification-result {
    min-height: 22px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
}

.verification-result.is-valid { color: #185c37; }
.verification-result.is-error { color: #8a1c1c; }

.form-grid-spaced,
.simple-container-list {
    margin-top: 20px;
}

.full-field {
    grid-column: 1 / -1;
}

.simple-container-row {
    display: grid;
    grid-template-columns: minmax(220px, 520px) 38px;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
}

.compact-choices {
    max-width: 650px;
}

.container-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.4fr) 38px;
    gap: 14px;
    align-items: end;
    margin-bottom: 14px;
}

.icon-button {
    width: 38px;
    height: 44px;
    color: #8a1c1c;
    font-size: 24px;
    border: 1px solid #d5a8a8;
    border-radius: 3px;
    background: #ffffff;
}

.add-container {
    margin-top: 4px;
}

.liability-check {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    margin-top: 22px;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
}

.liability-check input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: var(--maersk-dark);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 28px;
}

.status-mark {
    display: inline-block;
    margin: 0 0 14px;
    padding: 6px 10px;
    color: #185c37;
    font-size: 13px;
    font-weight: 700;
    background: #eaf7ef;
}

.result-table-wrap {
    margin-top: 28px;
    overflow-x: auto;
    border: 1px solid var(--line);
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.result-table th,
.result-table td {
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.result-table th {
    background: var(--surface);
}

.tracking-form {
    max-width: 760px;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 14px;
    align-items: end;
    margin-top: 28px;
}

main {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.portal-intro {
    min-height: 230px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 40px;
    padding: 42px 0 34px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--maersk-dark);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2,
p {
    letter-spacing: 0;
}

h1 {
    max-width: 720px;
    margin: 0;
    font-size: 38px;
    line-height: 1.15;
}

.portal-intro p:last-child {
    max-width: 700px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.6;
}

.primary-actions {
    display: flex;
    gap: 10px;
}

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid var(--maersk-dark);
    border-radius: 4px;
}

.button-primary {
    color: #ffffff;
    background: var(--maersk-dark);
}

.button-secondary {
    color: var(--maersk-dark);
    background: #ffffff;
}

.notice-band {
    padding: 28px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.notice-band a,
.notice-band img {
    display: block;
}

.notice-band img {
    width: 100%;
    height: auto;
}

.booking-guide {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
    gap: 48px;
    padding: 52px 0 60px;
}

.section-heading h2 {
    margin: 0;
    font-size: 27px;
    line-height: 1.25;
}

.booking-guide img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
}

footer {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(20px, 5vw, 72px);
    color: #ffffff;
    font-size: 13px;
    background: var(--ink);
}

@media (max-width: 820px) {
    .portal-header {
        display: block;
    }

    .brand {
        width: 100%;
        min-height: 76px;
    }

    .portal-title {
        min-height: 68px;
    }

    .portal-intro,
    .booking-guide,
    .workflow-heading {
        grid-template-columns: 1fr;
    }

    .portal-intro {
        gap: 24px;
    }

    .primary-actions {
        justify-content: flex-start;
    }

    .booking-guide {
        gap: 24px;
    }

    .container-row,
    .tracking-form,
    .verification-row {
        grid-template-columns: 1fr;
    }

    .container-row {
        padding-bottom: 20px;
        border-bottom: 1px dashed var(--line);
    }
}

@media (max-width: 560px) {
    .portal-title {
        display: block;
    }

    .portal-title strong {
        display: block;
        margin-top: 6px;
        font-size: 20px;
        text-align: left;
    }

    main {
        width: min(100% - 28px, 1120px);
    }

    h1 {
        font-size: 30px;
    }

    .primary-actions,
    footer,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .notice-band {
        margin-inline: -14px;
        padding: 14px;
    }

    .choice-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- container-row triangulation toggle ---- */

.triangulated-panel {
    grid-column: 1 / -1;
    margin-top: 4px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.toggle-row input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: var(--maersk-dark);
}

.toggle-row small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.reveal {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}

.reveal label {
    display: block;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.reveal > .field-help {
    grid-column: 1 / -1;
    max-width: 720px;
    margin: 0;
}

.reveal input {
    width: 100%;
    min-height: 40px;
    margin-top: 6px;
    padding: 8px 10px;
    font: inherit;
    font-weight: 400;
    border: 1px solid #b9c7ce;
    border-radius: 3px;
    background: #ffffff;
}

@media (max-width: 820px) {
    .reveal {
        grid-template-columns: 1fr;
    }
}

/* ---- review screen ---- */

.review-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 28px 0 0;
}

.review-summary div {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
}

.review-summary dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.review-summary dd {
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 700;
}

.review-heading {
    margin: 34px 0 16px;
    font-size: 20px;
}

.review-containers {
    display: grid;
    gap: 16px;
}

.review-container {
    padding: 20px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--maersk);
    border-radius: 4px;
}

.review-container.is-triangulated {
    border-left-color: var(--signal);
}

.review-container__head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.review-container__index {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.review-container__number {
    font-size: 18px;
    letter-spacing: 0.03em;
}

.review-container__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 18px 0 0;
}

.review-container__meta dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.review-container__meta dd {
    margin: 4px 0 0;
    font-size: 14px;
    word-break: break-all;
}

.review-container__blocked {
    margin: 16px 0 0;
    padding: 10px 12px;
    color: #8a1c1c;
    font-size: 13px;
    border: 1px solid #e6bcbc;
    border-radius: 3px;
    background: #fff5f5;
}

/* ---- status pills ---- */

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 999px;
}

.status-pill--pending {
    color: #8a5a00;
    background: #fdf3d7;
}

.status-pill--verified {
    color: #185c37;
    background: #eaf7ef;
}

.status-pill--rejected {
    color: #8a1c1c;
    background: #fdeaea;
}

.status-pill--neutral {
    color: var(--muted);
    background: var(--surface);
}

@media (max-width: 820px) {
    .review-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .review-summary {
        grid-template-columns: 1fr;
    }
}
