:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --ink: #111827;
    --muted: #667085;
    --line: #e4e7ec;
    --primary: #111827;
    --primary-soft: #f2f4f7;
    --success: #087443;
    --success-bg: #ecfdf3;
    --warning: #b54708;
    --warning-bg: #fffaeb;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top, #ffffff 0, var(--bg) 35rem);
    color: var(--ink);
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea {
    font: inherit;
}

.page-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding:
        max(18px, env(safe-area-inset-top))
        14px
        max(32px, env(safe-area-inset-bottom));
}

.app-card,
.center-card {
    background: var(--card);
    border: 1px solid rgba(16, 24, 40, .06);
    border-radius: 28px;
    box-shadow: 0 18px 60px rgba(16, 24, 40, .08);
    overflow: hidden;
}

.center-card {
    padding: 42px 24px;
    text-align: center;
    margin-top: 7vh;
}

.hero {
    padding: 26px 22px;
    background: linear-gradient(145deg, #101828, #344054);
    color: white;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: flex-start;
}

.hero h1,
.center-card h1 {
    margin: 7px 0 5px;
    font-size: clamp(25px, 6vw, 36px);
    line-height: 1.08;
}

.hero p {
    margin: 0;
    color: #d0d5dd;
}

.eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    opacity: .78;
}

.secure-pill,
.count-pill {
    border-radius: 999px;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 800;
}

.secure-pill {
    padding: 8px 10px;
    background: rgba(255,255,255,.12);
}

.shipment-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--line);
    border-bottom: 1px solid var(--line);
}

.metric {
    background: white;
    padding: 17px 18px;
    min-width: 0;
}

.metric span,
.section-label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 800;
}

.metric strong {
    display: block;
    margin-top: 5px;
    font-size: 17px;
    overflow-wrap: anywhere;
}

.driver-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.driver-row > div {
    min-width: 0;
}

.driver-row strong,
.driver-row small {
    display: block;
    margin-top: 4px;
}

.driver-row small,
.muted,
.footnote {
    color: var(--muted);
}

.right {
    text-align: right;
}

.section {
    padding: 24px 20px;
    border-bottom: 1px solid var(--line);
}

.section h2 {
    margin: 4px 0 14px;
    font-size: 20px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.count-pill {
    padding: 6px 9px;
    background: var(--primary-soft);
    color: #344054;
}

.items {
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
}

.item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 14px;
}

.item-row + .item-row {
    border-top: 1px solid var(--line);
}

.item-row small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}

.location-card {
    border-radius: 18px;
    padding: 15px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    border: 1px solid;
}

.location-card .secondary-btn {
    grid-column: 1 / -1;
}

.location-card.pending,
.location-card.locating {
    background: var(--warning-bg);
    border-color: #fedf89;
}

.location-card.success {
    background: var(--success-bg);
    border-color: #abefc6;
}

.location-card.error {
    background: var(--danger-bg);
    border-color: #fecdca;
}

.location-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.8);
    font-size: 21px;
    font-weight: 900;
}

.location-copy strong,
.location-copy span,
.location-copy small {
    display: block;
}

.location-copy span {
    margin-top: 3px;
    color: #475467;
    line-height: 1.35;
    font-size: 14px;
}

.location-copy small {
    margin-top: 5px;
    color: var(--muted);
}

.secondary-btn {
    border: 1px solid rgba(16,24,40,.14);
    background: white;
    color: var(--ink);
    border-radius: 12px;
    padding: 11px 14px;
    font-weight: 800;
    cursor: pointer;
}

.compact {
    margin-top: -7px;
    margin-bottom: 14px;
}

.photo-picker {
    min-height: 125px;
    border: 1.5px dashed #98a2b3;
    background: #fcfcfd;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    text-align: center;
    cursor: pointer;
    padding: 18px;
}

.photo-picker small {
    color: var(--muted);
}

.camera-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 22px;
    margin-bottom: 4px;
}

.hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.photo-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.photo-thumb {
    aspect-ratio: 1 / 1;
    border-radius: 13px;
    overflow: hidden;
    background: #eaecf0;
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-count {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.field {
    margin-top: 14px;
}

.field label {
    display: block;
    font-weight: 750;
    font-size: 14px;
    margin-bottom: 6px;
}

.field label span {
    color: var(--muted);
    font-weight: 500;
}

.field input,
.field textarea {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 13px;
    padding: 13px 14px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border .15s, box-shadow .15s;
}

.field textarea {
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    border-color: #667085;
    box-shadow: 0 0 0 4px rgba(16,24,40,.06);
}

.consent-note {
    margin: 20px 20px 12px;
    padding: 13px 14px;
    background: #f9fafb;
    border-radius: 13px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.primary-btn {
    width: calc(100% - 40px);
    margin: 0 20px;
    border: 0;
    border-radius: 15px;
    padding: 15px 18px;
    background: var(--primary);
    color: white;
    font-weight: 850;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(16,24,40,.16);
}

.primary-btn:disabled {
    background: #d0d5dd;
    color: #667085;
    box-shadow: none;
    cursor: not-allowed;
}

.submit-hint {
    text-align: center;
    padding: 0 20px 22px;
    margin: 9px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.validation-summary {
    margin: 18px 20px 0;
    padding: 14px;
    border-radius: 14px;
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fecdca;
    font-size: 14px;
}

.validation-summary ul {
    margin: 7px 0 0;
    padding-left: 19px;
}

.brand-mark,
.success-icon,
.status-icon,
.error-icon {
    margin: 0 auto 18px;
    width: 66px;
    height: 66px;
    border-radius: 21px;
    display: grid;
    place-items: center;
    font-size: 31px;
    font-weight: 900;
}

.brand-mark {
    background: var(--ink);
    color: white;
}

.success-icon,
.status-icon {
    background: var(--success-bg);
    color: var(--success);
}

.error-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

.info-box {
    margin-top: 22px;
    padding: 14px;
    border-radius: 14px;
    background: #f9fafb;
    color: #475467;
    line-height: 1.5;
    font-size: 14px;
}

.receipt {
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    margin-top: 24px;
}

.receipt > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 14px;
}

.receipt > div + div {
    border-top: 1px solid var(--line);
}

.receipt span {
    color: var(--muted);
}

.receipt strong {
    text-align: right;
}

.pending-text {
    color: var(--warning);
}

.footnote {
    font-size: 13px;
    margin-top: 24px;
}

@media (max-width: 430px) {
    .page-shell {
        padding-left: 0;
        padding-right: 0;
        padding-top: 0;
    }

    .app-card {
        border-radius: 0 0 24px 24px;
        border-top: 0;
    }

    .center-card {
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .hero {
        padding-top: max(24px, env(safe-area-inset-top));
    }

    .driver-row {
        flex-direction: column;
    }

    .right {
        text-align: left;
    }
}
