:root {
    --red: #ec1329;
    --red-dark: #c70d20;
    --ink: #151518;
    --ink-soft: #242428;
    --muted: #696971;
    --line: #e7e7ea;
    --surface: #ffffff;
    --surface-soft: #f5f5f6;
    --success: #17874f;
    --shadow: 0 26px 80px rgba(0, 0, 0, 0.22);
    --radius-lg: 18px;
    --radius-md: 10px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--surface-soft);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 10px;
    left: 10px;
    padding: 10px 16px;
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: relative;
    z-index: 10;
    border-bottom: 1px solid rgba(15, 15, 18, 0.1);
    background: rgba(255, 255, 255, 0.96);
}

.header-inner {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    font-size: clamp(1.15rem, 2.4vw, 1.45rem);
    font-weight: 850;
    letter-spacing: -0.06em;
    text-decoration: none;
}

.brand strong {
    color: var(--red);
    font-weight: 850;
}

.secure-note {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #47474e;
    font-size: 0.82rem;
    font-weight: 650;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(23, 135, 79, 0.12);
}

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 780px;
    padding: 82px 0 96px;
    background:
        radial-gradient(circle at 15% 20%, rgba(236, 19, 41, 0.2), transparent 27%),
        radial-gradient(circle at 85% 80%, rgba(236, 19, 41, 0.08), transparent 25%),
        linear-gradient(135deg, #111114 0%, #1b1b20 55%, #121216 100%);
    color: #fff;
}

.hero::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    content: "";
    mask-image: linear-gradient(to right, #000, transparent 80%);
}

.signal-lines {
    position: absolute;
    z-index: -1;
    width: 520px;
    height: 520px;
    top: 80px;
    left: -250px;
    border: 1px solid rgba(236, 19, 41, 0.18);
    border-radius: 50%;
    box-shadow:
        0 0 0 80px rgba(236, 19, 41, 0.035),
        0 0 0 160px rgba(236, 19, 41, 0.025);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(540px, 1.18fr);
    gap: clamp(50px, 7vw, 104px);
    align-items: start;
}

.hero-copy {
    position: sticky;
    top: 44px;
    padding-top: 56px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    color: #d9d9de;
    font-size: 0.73rem;
    font-weight: 750;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.eyebrow span {
    display: inline-block;
    width: 28px;
    height: 2px;
    background: var(--red);
}

.eyebrow.dark {
    color: var(--muted);
}

.hero h1 {
    max-width: 520px;
    margin: 0;
    font-size: clamp(3.3rem, 6vw, 5.25rem);
    line-height: 0.96;
    letter-spacing: -0.072em;
}

.hero h1 em {
    color: var(--red);
    font-style: normal;
}

.hero-text {
    max-width: 430px;
    margin: 28px 0 0;
    color: #bdbdc5;
    font-size: clamp(1rem, 1.6vw, 1.18rem);
}

.hero-details {
    display: flex;
    gap: 32px;
    margin-top: 52px;
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-details div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hero-details strong {
    font-size: 0.92rem;
}

.hero-details span {
    color: #8f8f98;
    font-size: 0.78rem;
}

.quote-shell {
    padding: clamp(26px, 4vw, 42px);
    border-top: 4px solid var(--red);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--ink);
}

.quote-heading {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 34px;
}

.step-label {
    display: block;
    margin-bottom: 7px;
    color: var(--red);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.quote-heading h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 1.9rem);
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.environment-badge {
    flex: none;
    padding: 6px 9px;
    border: 1px solid #dedee2;
    border-radius: 999px;
    color: #66666f;
    font-size: 0.65rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

fieldset {
    min-width: 0;
    margin: 0;
    padding: 0 0 28px;
    border: 0;
}

fieldset + fieldset {
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

legend {
    margin-bottom: 15px;
    padding: 0;
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fieldset-note {
    margin: -8px 0 18px;
    color: var(--muted);
    font-size: 0.78rem;
}

.form-grid {
    display: grid;
    gap: 18px;
}

.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-columns {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(120px, 0.55fr);
}

.route-fields {
    grid-template-columns: 1fr 22px 1fr;
    align-items: start;
}

.route-arrow {
    display: grid;
    height: 48px;
    margin-top: 25px;
    place-items: center;
    color: var(--red);
    font-size: 1.15rem;
}

.dimensions-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.field-group {
    position: relative;
    min-width: 0;
}

.field-group label {
    display: block;
    margin-bottom: 7px;
    color: #2d2d32;
    font-size: 0.78rem;
    font-weight: 700;
}

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

.field-group input,
.sort-control select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #d8d8dd;
    border-radius: 7px;
    outline: none;
    background: #fff;
    color: var(--ink);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field-group input {
    padding: 10px 12px;
}

.field-group input::placeholder {
    color: #aaaab2;
}

.field-group input:hover,
.sort-control select:hover {
    border-color: #aaaab2;
}

.field-group input:focus,
.sort-control select:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(236, 19, 41, 0.1);
}

.field-group input[aria-invalid="true"] {
    border-color: var(--red);
    background: #fff8f8;
}

.field-group small {
    display: block;
    margin-top: 6px;
    color: #777780;
    font-size: 0.69rem;
}

.field-error {
    display: block;
    min-height: 17px;
    margin-top: 4px;
    color: #bd0b1c;
    font-size: 0.69rem;
    line-height: 1.25;
}

.currency-field input {
    padding-left: 42px;
}

.currency-prefix {
    position: absolute;
    z-index: 1;
    top: 39px;
    left: 12px;
    color: #777780;
    font-size: 0.84rem;
    font-weight: 700;
}

.calculate-button {
    display: flex;
    width: 100%;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    border-radius: 7px;
    background: var(--red);
    box-shadow: 0 12px 24px rgba(236, 19, 41, 0.22);
    color: #fff;
    font-weight: 800;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.calculate-button:hover:not(:disabled) {
    background: var(--red-dark);
    box-shadow: 0 14px 30px rgba(236, 19, 41, 0.3);
    transform: translateY(-1px);
}

.calculate-button:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(236, 19, 41, 0.35);
    outline-offset: 3px;
}

.calculate-button:disabled {
    cursor: wait;
    opacity: 0.82;
}

.button-arrow {
    font-size: 1.15rem;
}

.spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.is-loading .button-arrow {
    display: none;
}

.is-loading .spinner {
    display: inline-block;
}

.privacy-note {
    margin: 12px 0 0;
    color: #7f7f87;
    font-size: 0.7rem;
    text-align: center;
}

.form-alert {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-left: 3px solid var(--red);
    border-radius: 4px;
    background: #fff1f3;
    color: #8f0b17;
    font-size: 0.84rem;
}

.honeypot {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.results-section {
    padding: 90px 0 96px;
    background: var(--surface-soft);
    scroll-margin-top: 20px;
}

.results-header {
    display: flex;
    gap: 30px;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 30px;
}

.results-header h2 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
    letter-spacing: -0.055em;
}

.results-header p:not(.eyebrow) {
    margin: 0;
    color: var(--muted);
}

.sort-control {
    min-width: 190px;
}

.sort-control label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.sort-control select {
    min-height: 44px;
    padding: 8px 36px 8px 12px;
}

.results-list {
    display: grid;
    gap: 12px;
}

.quote-card {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(180px, 0.7fr) minmax(180px, 0.6fr);
    gap: 28px;
    align-items: center;
    min-height: 122px;
    padding: 22px 28px;
    border: 1px solid #e0e0e4;
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: 0 8px 24px rgba(18, 18, 22, 0.04);
}

.quote-card.is-highlighted {
    border-color: rgba(236, 19, 41, 0.5);
    box-shadow: 0 14px 40px rgba(236, 19, 41, 0.09);
}

.carrier-block {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 16px;
}

.carrier-logo {
    display: grid;
    width: 60px;
    height: 60px;
    flex: none;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
}

.carrier-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.carrier-logo.fallback-logo {
    background: var(--ink);
    color: #fff;
    font-size: 0.86rem;
    font-weight: 850;
    letter-spacing: 0.04em;
}

.carrier-name,
.quote-metric span,
.quote-price span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
}

.carrier-block h3 {
    margin: 3px 0 0;
    overflow: hidden;
    font-size: 1.05rem;
    line-height: 1.2;
    text-overflow: ellipsis;
}

.best-badge {
    position: absolute;
    top: -19px;
    left: 76px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #fff0f2;
    color: var(--red-dark);
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.quote-metric,
.quote-price {
    padding-left: 24px;
    border-left: 1px solid var(--line);
}

.quote-metric strong {
    display: block;
    margin-top: 4px;
    font-size: 1rem;
}

.quote-price strong {
    display: block;
    margin-top: 1px;
    color: var(--red);
    font-size: clamp(1.35rem, 2.6vw, 1.85rem);
    letter-spacing: -0.04em;
}

.quote-observation {
    grid-column: 1 / -1;
    margin: -10px 0 0 76px;
    color: var(--muted);
    font-size: 0.75rem;
}

.unavailable-note {
    margin-top: 18px;
    padding: 15px 18px;
    border: 1px solid #dddde1;
    border-radius: 8px;
    background: #fff;
    color: #5c5c64;
    font-size: 0.8rem;
}

.unavailable-note summary {
    font-weight: 700;
    cursor: pointer;
}

.unavailable-note ul {
    margin: 12px 0 0;
    padding-left: 20px;
}

.empty-section {
    padding: 76px 0;
}

.empty-card {
    display: flex;
    max-width: 760px;
    margin-inline: auto;
    gap: 18px;
    align-items: center;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
}

.empty-card > span {
    display: grid;
    width: 48px;
    height: 48px;
    flex: none;
    place-items: center;
    border-radius: 50%;
    background: #fff0f2;
    color: var(--red);
    font-size: 1.4rem;
    font-weight: 900;
}

.empty-card h2,
.empty-card p {
    margin: 0;
}

.empty-unavailable-note {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.76rem;
}

.empty-unavailable-note ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.empty-card p {
    margin-top: 5px;
    color: var(--muted);
}

.site-footer {
    padding: 48px 0;
    background: #1a1a1a;
    color: #fff;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto minmax(260px, 0.85fr);
    gap: 48px;
    align-items: center;
}

.footer-brand {
    color: #fff;
}

.footer-grid p {
    margin: 8px 0 0;
    color: #9e9ea6;
    font-size: 0.78rem;
}

.footer-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-link > span {
    color: #83838c;
    font-size: 0.67rem;
    text-transform: uppercase;
}

.footer-link a {
    color: #fff;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.footer-link a:hover {
    color: var(--red);
}

.legal-note {
    max-width: 360px;
    margin: 0 !important;
    line-height: 1.6;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
    .hero {
        padding-top: 58px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .hero-copy {
        position: static;
        padding-top: 0;
    }

    .hero h1 {
        max-width: 680px;
    }

    .hero-text {
        max-width: 620px;
    }

    .quote-card {
        grid-template-columns: minmax(240px, 1fr) minmax(170px, 0.65fr) minmax(160px, 0.55fr);
        gap: 16px;
        padding-inline: 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .legal-note {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .container {
        width: min(100% - 28px, 620px);
    }

    .header-inner {
        min-height: 64px;
    }

    .secure-note {
        font-size: 0.73rem;
    }

    .hero {
        min-height: 0;
        padding: 48px 0 64px;
    }

    .hero h1 {
        font-size: clamp(3rem, 15vw, 4.5rem);
    }

    .hero-details {
        gap: 22px;
        margin-top: 36px;
    }

    .quote-shell {
        margin-inline: -4px;
        padding: 26px 20px;
    }

    .quote-heading {
        margin-bottom: 28px;
    }

    .environment-badge {
        display: none;
    }

    .two-columns,
    .three-columns,
    .route-fields {
        grid-template-columns: 1fr;
    }

    .route-arrow {
        display: none;
    }

    .dimensions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .results-section {
        padding: 64px 0;
    }

    .results-header {
        align-items: stretch;
        flex-direction: column;
    }

    .sort-control {
        min-width: 0;
    }

    .quote-card {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        padding: 22px 18px;
    }

    .carrier-block {
        grid-column: 1 / -1;
        padding-bottom: 18px;
        border-bottom: 1px solid var(--line);
    }

    .quote-metric,
    .quote-price {
        padding-left: 0;
        border-left: 0;
    }

    .quote-price {
        text-align: right;
    }

    .quote-observation {
        margin: -4px 0 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .legal-note {
        grid-column: auto;
    }
}

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

    .hero-details {
        flex-direction: column;
        gap: 14px;
    }

    .quote-card {
        grid-template-columns: 1fr;
    }

    .carrier-block {
        grid-column: auto;
    }

    .quote-price {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
