/* Variables moved to static/css/variables.css */

.hero {
    background: linear-gradient(180deg, var(--hero-bg) 0%, #ffffff 100%);
    padding: var(--hero-space-6) 0;
}

.hero-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--hero-space-4);
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-5);
}

.hero-banner {
    display: flex;
    flex-direction: column-reverse;
    gap: var(--hero-space-5);
    position: relative;
    overflow: hidden;
}

.hero-banner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--hero-space-3);
}

.hero-banner-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--hero-text-primary);
    line-height: 1.3;
    margin: 0;
    letter-spacing: -0.01em;
}

.hero-cities {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--hero-space-2);
    margin-top: 0;
    flex-wrap: nowrap;
}

.hero-city {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--hero-text-primary);
    white-space: nowrap;
}

.hero-bidirectional {
    width: 24px;
    height: 24px;
    color: var(--hero-primary);
    flex-shrink: 0;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: rotate(90deg);
}

.hero-banner-text {
    font-size: 1rem;
    color: var(--hero-text-secondary);
    line-height: 1.6;
    max-width: 480px;
    margin: 0;
    margin-top: var(--hero-space-2);
}

.hero-banner-image {
    flex-shrink: 0;
    overflow: hidden;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    aspect-ratio: 992 / 500;
}

@media (max-width: 768px) {
    .hero-banner-image {
        max-width: 450px;
    }
}

.hero-banner-image img,
.hero-banner-image svg {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

@media (min-width: 1400px) {
    .hero-banner-image {
        max-width: 820px;
    }
}

@media (min-width: 1600px) {
    .hero-banner-image {
        max-width: 980px;
    }
}

.hero-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--hero-space-4);
}

.hero-card-calculator {
    order: -1;
}

.hero-card {
    background: var(--hero-card-bg);
    border-radius: var(--hero-radius-2xl);
    padding: var(--hero-space-6);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    box-shadow: none;
    border: 1px solid var(--hero-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hero-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--hero-text-primary);
    margin: 0 0 var(--hero-space-4) 0;
    letter-spacing: -0.01em;
}

.hero-card-compact {
    padding: var(--hero-space-4);
    min-height: auto;
}

.hero-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--hero-space-3);
    margin-bottom: var(--hero-space-3);
}

.hero-card-header .hero-card-title {
    margin: 0;
    flex: 1;
}

.hero-card-text {
    font-size: 0.875rem;
    color: var(--hero-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.track-order-form {
    margin-top: auto;
}

.track-input-group {
    display: flex;
    align-items: stretch;
    border-radius: var(--hero-radius-xl);
    overflow: hidden;
    border: 1px solid var(--hero-border);
    background: var(--hero-card-bg);
    transition:
        border-color var(--hero-transition),
        box-shadow var(--hero-transition);
}

.track-input-group:focus-within {
    border-color: var(--hero-accent);
    box-shadow: var(--shadow-accent-focus);
}

.track-input {
    flex: 1;
    min-width: 0;
    padding: var(--hero-space-3) var(--hero-space-4);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--hero-text-primary);
    background: transparent;
    border: none;
    outline: none;
}

.track-input::placeholder {
    color: var(--hero-text-muted);
}

.track-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    flex-shrink: 0;
    background: var(--hero-accent);
    border: none;
    cursor: pointer;
    transition: background var(--hero-transition);
}

.track-btn:hover {
    background: var(--hero-accent-dark);
}

.track-btn:active {
    transform: scale(0.98);
}

.track-btn svg {
    width: 18px;
    height: 18px;
    color: var(--color-primary-contrast);
}

.track-help-wrapper {
    position: relative;
    margin-top: var(--hero-space-3);
}

.track-help-link {
    display: inline-block;
    font-size: 0.8125rem;
    color: var(--hero-text-muted);
    text-decoration: none;
    transition: color var(--hero-transition);
    cursor: pointer;
}

.track-help-link:hover {
    color: var(--hero-primary);
    text-decoration: underline;
}

.track-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--hero-card-bg);
    border: 1px solid var(--hero-border);
    border-radius: var(--hero-radius-lg);
    padding: var(--hero-space-4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--hero-transition),
        visibility var(--hero-transition),
        transform var(--hero-transition);
    pointer-events: none;
}

.track-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* =====================
   Track page (/track)
   ===================== */

.track-page {
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-6);
}

/* Make the search container span full viewport width on /track */
.track-form-fullbleed {
    width: 100%;
    margin: 0;
}

.track-form-fullbleed__inner {
    padding: 0;
}

.track-results {
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-4);
}

.track-order-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--hero-space-4);
    margin-bottom: var(--hero-space-4);
}

.track-order-number-label {
    margin: 0;
    color: var(--hero-text-muted);
    font-size: 0.8125rem;
}

.track-order-number {
    margin: 0;
    margin-top: var(--hero-space-1);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hero-text-primary);
    letter-spacing: -0.01em;
}

.track-subtitle {
    margin: 0;
    margin-top: var(--hero-space-1);
    color: var(--hero-text-secondary);
    font-size: 0.875rem;
}

.track-status-pill {
    padding: var(--hero-space-2) var(--hero-space-4);
    border-radius: var(--hero-radius-xl);
    background: var(--hero-primary-bg);
    color: var(--hero-primary);
    font-weight: 700;
    font-size: 0.875rem;
    line-height: 1.2;
    white-space: nowrap;
}

/* =====================
   Track details (kz-web style)
   Scoped under .track-detail
   ===================== */

.track-detail {
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-4);
}

.track-detail .page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--hero-space-4);
}

.track-detail .page-header__content {
    min-width: 0;
}

.track-detail .page-header__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hero-text-primary);
    letter-spacing: -0.01em;
}

.track-detail .badge {
    display: inline-flex;
    align-items: center;
    padding: var(--hero-space-1) var(--hero-space-3);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    border-radius: 9999px;
    white-space: nowrap;
}

.track-detail .badge--lg {
    padding: var(--hero-space-2) var(--hero-space-4);
    font-size: 0.875rem;
}

.track-detail .badge--primary {
    background: var(--hero-primary-bg);
    color: var(--hero-primary);
}

.track-detail .order-detail {
    display: grid;
    gap: var(--hero-space-4);
}

@media (min-width: 1024px) {
    .track-detail .order-detail {
        grid-template-columns: 1fr 360px;
        align-items: start;
    }
}

.track-detail .order-detail__main,
.track-detail .order-detail__sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-4);
}

.track-detail .card {
    background: var(--hero-card-bg);
    border-radius: var(--hero-radius-2xl);
    border: 1px solid var(--hero-border);
    overflow: hidden;
}

.track-detail .card__header {
    padding: var(--hero-space-4) var(--hero-space-4);
    border-bottom: 1px solid var(--hero-border);
}

@media (min-width: 768px) {
    .track-detail .card__header {
        padding: var(--hero-space-5) var(--hero-space-6);
    }
}

.track-detail .card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--hero-text-primary);
}

.track-detail .card__body {
    padding: var(--hero-space-4);
}

@media (min-width: 768px) {
    .track-detail .card__body {
        padding: var(--hero-space-6);
    }
}

.track-detail .info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--hero-space-4);
    padding: var(--hero-space-3) 0;
    border-bottom: 1px solid var(--hero-border);
}

.track-detail .info-row:first-child {
    padding-top: 0;
}

.track-detail .info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.track-detail .info-row__label {
    font-size: 0.875rem;
    color: var(--hero-text-muted);
    flex: 0 0 auto;
}

.track-detail .info-row__value {
    font-weight: 600;
    text-align: right;
    color: var(--hero-text-primary);
    min-width: 0;
}

.track-detail .route-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-4);
    padding-left: var(--hero-space-8);
}

.track-detail .route-visual__line {
    position: absolute;
    left: 16px;
    top: 24px;
    bottom: 24px;
    width: 2px;
    background: linear-gradient(to bottom,
            var(--hero-primary) 0%,
            var(--hero-primary) 50%,
            transparent 50%,
            transparent 100%);
    background-size: 2px 8px;
}

.track-detail .route-visual__point {
    position: relative;
}

.track-detail .route-visual__marker {
    position: absolute;
    left: calc(-1 * var(--hero-space-8) + 10px);
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 9999px;
    background: var(--hero-primary);
    box-shadow: var(--shadow-accent-focus);
}

.track-detail .route-visual__label {
    display: block;
    font-size: 0.75rem;
    color: var(--hero-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--hero-space-1);
}

.track-detail .route-visual__city {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--hero-text-primary);
}

.track-detail .status-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-2);
}

.track-detail .status-timeline__item {
    display: flex;
    align-items: center;
    gap: var(--hero-space-3);
    padding: var(--hero-space-2) 0;
    opacity: 0.5;
}

.track-detail .status-timeline__item--active {
    opacity: 1;
}

.track-detail .status-timeline__item--active~.status-timeline__item {
    opacity: 0.3;
}

.track-detail .status-timeline__marker {
    width: 12px;
    height: 12px;
    border-radius: 9999px;
    background: var(--hero-border);
    flex-shrink: 0;
}

.track-detail .status-timeline__item--active .status-timeline__marker {
    background: var(--hero-primary);
    box-shadow: var(--shadow-accent-focus);
}

.track-detail .status-timeline__name {
    font-size: 0.875rem;
    color: var(--hero-text-secondary);
}

.track-detail .status-timeline__item--active .status-timeline__name {
    color: var(--hero-text-primary);
    font-weight: 600;
}

.track-detail .empty-state {
    padding: var(--hero-space-4);
    border: 1px dashed var(--hero-border);
    border-radius: var(--hero-radius-lg);
    background: var(--hero-bg);
    color: var(--hero-text-muted);
    text-align: center;
}

.track-detail .empty-state--compact {
    padding: var(--hero-space-3);
}

.track-detail .empty-state p {
    margin: 0;
}

@media (max-width: 767px) {
    .track-order-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .track-status-pill {
        white-space: normal;
    }

    .track-detail .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.track-tooltip-content {
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-3);
}

.track-tooltip-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--hero-text-secondary);
}

.track-tooltip-example {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--hero-text-secondary);
}

.track-tooltip-example strong {
    color: var(--hero-text-primary);
    font-weight: 600;
}

.track-tooltip-sample {
    display: inline-block;
    margin-top: var(--hero-space-1);
    padding: var(--hero-space-1) var(--hero-space-2);
    background: var(--hero-primary-bg);
    color: var(--hero-primary-dark);
    border-radius: var(--hero-radius-sm);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.8125rem;
    font-weight: 500;
}

.track-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid var(--hero-border);
}

.track-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 21px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid var(--hero-card-bg);
}

.track-input.input-error {
    animation: shake 0.3s ease-in-out;
    border-color: #ef4444;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

.hero-card-calculator {
    background: var(--hero-card-bg);
}

.calc-header {
    margin-bottom: var(--hero-space-4);
}

.calc-header-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--hero-space-2);
}

.calc-header-top .hero-card-title {
    margin: 0;
}

.calc-schedule-link {
    font-size: 0.75rem;
    color: var(--hero-primary);
    text-decoration: none;
    transition: color var(--hero-transition);
}

.calc-schedule-link:hover {
    color: var(--hero-primary-dark);
    text-decoration: underline;
}

.calc-notice {
    display: inline-flex;
    align-items: center;
    gap: var(--hero-space-2);
    font-size: 0.75rem;
    font-weight: 500;
    color: #f59e0b;
}

.calc-form {
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-8);
}

.calc-layout {
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-5);
}

.calc-section {
    flex: 1;
}

.calc-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hero-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--hero-space-3);
}

.calc-cities {
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-3);
}

.calc-city-row {
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-2);
}

.calc-label {
    display: flex;
    align-items: center;
    gap: var(--hero-space-1);
    font-size: 0.75rem;
    color: var(--hero-text-secondary);
    min-height: 18px;
}

.calc-label-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--hero-primary);
}

.calc-select {
    width: 100%;
    height: 44px;
    padding: 0 var(--hero-space-4);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--hero-text-primary);
    background: var(--hero-card-bg);
    border: 1px solid var(--hero-border);
    border-radius: var(--hero-radius-xl);
    outline: none;
    cursor: pointer;
    transition:
        border-color var(--hero-transition),
        box-shadow var(--hero-transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.calc-select:focus {
    border-color: var(--hero-primary);
    box-shadow: var(--shadow-input-focus);
}

.calc-params {
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-3);
}

.calc-param-row {
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-2);
}

.calc-param-full {
    grid-column: 1 / -1;
}

.calc-input-with-unit {
    display: flex;
    align-items: center;
    height: 44px;
    border: 1px solid var(--hero-border);
    border-radius: var(--hero-radius-xl);
    position: relative;
    transition: border-color var(--hero-transition), box-shadow var(--hero-transition);
    box-sizing: border-box;
    background: var(--hero-card-bg);
    overflow: visible;
}

.calc-input-with-unit:focus-within {
    border-color: var(--hero-primary);
    box-shadow: var(--shadow-input-focus);
}

.calc-input-with-unit .calc-input {
    border: none !important;
    border-radius: 0 !important;
    flex: 1;
    height: 42px;
    padding: 0 var(--hero-space-4) !important;
    background: transparent !important;
    outline: none !important;
    font-size: 0.9375rem;
    color: var(--hero-text-primary);
    line-height: 1;
}

.calc-input-with-unit .calc-input:focus {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
}

.calc-input-unit {
    display: flex;
    align-items: center;
    padding: 0 var(--hero-space-3);
    background: var(--hero-bg);
    color: var(--hero-text-muted);
    font-size: 0.8125rem;
    border-left: 1px solid var(--hero-border);
    flex-shrink: 0;
}

/* Custom unit selector - minimal design */
.calc-custom-unit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--hero-space-3);
    background: transparent;
    border-left: 1px solid var(--hero-border);
    border-radius: 0;
    flex-shrink: 0;
    min-width: 50px;
    height: 42px;
    cursor: pointer;
    user-select: none;
    z-index: 1;
    outline: none;
}

.calc-custom-unit.active {
    z-index: 101;
}

.calc-custom-unit:focus {
    outline: none;
}

.calc-custom-unit-value {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--hero-text-muted);
    letter-spacing: 0.02em;
    padding-right: 12px;
    position: relative;
    transition: color var(--hero-transition);
    line-height: 1;
}

.calc-custom-unit-value::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 2.5px solid transparent;
    border-right: 2.5px solid transparent;
    border-top: 3.5px solid var(--hero-text-muted);
    transition: border-color var(--hero-transition), transform var(--hero-transition);
}

.calc-custom-unit:hover .calc-custom-unit-value {
    color: var(--hero-text-secondary);
}

.calc-custom-unit:hover .calc-custom-unit-value::after {
    border-top-color: var(--hero-text-secondary);
}

.calc-custom-unit.active .calc-custom-unit-value::after {
    transform: translateY(-50%) rotate(180deg);
}

.calc-custom-unit-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: -1px;
    background: var(--hero-card-bg);
    border: 1px solid var(--hero-border);
    border-radius: var(--hero-radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 52px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.calc-custom-unit.active .calc-custom-unit-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.calc-custom-unit-option {
    padding: var(--hero-space-2) var(--hero-space-3);
    font-size: 0.75rem;
    color: var(--hero-text-secondary);
    cursor: pointer;
    transition: all var(--hero-transition);
    text-align: center;
}

.calc-custom-unit-option:hover {
    background: var(--hero-bg);
    color: var(--hero-text-primary);
}

.calc-custom-unit-option:first-child {
    border-radius: var(--hero-radius-md) var(--hero-radius-md) 0 0;
}

.calc-custom-unit-option:last-child {
    border-radius: 0 0 var(--hero-radius-md) var(--hero-radius-md);
}

.calc-custom-unit-option:only-child {
    border-radius: var(--hero-radius-md);
}

.calc-dimensions {
    display: flex;
    align-items: center;
    height: 44px;
    border: 1px solid var(--hero-border);
    border-radius: var(--hero-radius-xl);
    position: relative;
    transition: border-color var(--hero-transition);
    box-sizing: border-box;
    background: var(--hero-card-bg);
    overflow: visible;
}

.calc-dimensions:has(.calc-dimension-input:focus) {
    border-color: var(--hero-primary);
}

.calc-dimension-field {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.calc-dimension-input {
    width: 100%;
    height: 42px;
    border: none !important;
    border-radius: 0;
    text-align: center;
    padding: 0 var(--hero-space-1) !important;
    background: transparent !important;
    font-size: 0.9375rem !important;
    color: var(--hero-text-primary) !important;
    outline: none !important;
    line-height: 1;
}

.calc-dimension-input::placeholder {
    color: var(--hero-text-muted);
    font-size: 0.875rem;
}

.calc-dimension-input:focus {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
}

.calc-dimension-input:focus-visible {
    outline: none !important;
}

.calc-dimension-separator {
    display: flex;
    align-items: center;
    padding: 0 var(--hero-space-1);
    color: var(--hero-text-muted);
    font-size: 0.875rem;
    font-weight: 400;
    background: transparent;
    flex-shrink: 0;
    user-select: none;
    line-height: 1;
}

.calc-dimensions .calc-custom-unit {
    border-left: 1px solid var(--hero-border);
}

.calc-input {
    width: 100%;
    height: 44px;
    padding: 0 var(--hero-space-4);
    font-size: 0.9375rem;
    font-family: inherit;
    line-height: 1.5;
    color: var(--hero-text-primary);
    background: var(--hero-card-bg);
    border: 1px solid var(--hero-border);
    border-radius: var(--hero-radius-xl);
    outline: none;
    transition:
        border-color var(--hero-transition),
        box-shadow var(--hero-transition);
    box-sizing: border-box;
}

.calc-input:focus-visible {
    outline: none;
}

.calc-input::placeholder {
    color: var(--hero-text-muted);
    font-size: 0.875rem;
}

.calc-input:focus {
    border-color: var(--hero-primary);
    box-shadow: var(--shadow-input-focus);
}

.calc-input.error {
    border-color: #ef4444;
}

.calc-input[type="number"]::-webkit-outer-spin-button,
.calc-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.calc-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.calc-select.error {
    border-color: #ef4444;
}

.calc-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hero-space-2);
    padding: var(--hero-space-5);
    background: var(--hero-primary-bg);
    border-radius: var(--hero-radius-xl);
    border: 1px solid rgba(35, 150, 127, 0.2);
    margin-top: var(--hero-space-4);
}

.calc-result-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hero-space-2);
}

.calc-result-label {
    font-size: 0.75rem;
    color: var(--hero-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.calc-result-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--hero-primary);
    letter-spacing: -0.02em;
}

.calc-result-timestamp {
    font-size: 0.8125rem;
    color: var(--hero-text-muted);
    margin-top: var(--hero-space-1);
}

.calc-error {
    display: flex;
    align-items: center;
    gap: var(--hero-space-2);
    padding: var(--hero-space-4);
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--hero-radius-lg);
    color: #991b1b;
    font-size: 0.875rem;
    margin-bottom: var(--hero-space-4);
}

.calc-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--hero-space-2);
    padding: var(--hero-space-4) var(--hero-space-5);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: var(--hero-radius-lg);
    margin-bottom: var(--hero-space-4);
    outline: none;
    min-height: 80px;
    animation: slideInResult 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: top;
}

@keyframes slideInResult {
    0% {
        opacity: 0;
        transform: translateY(-20px) scaleY(0.8);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    50% {
        opacity: 0.5;
        max-height: 200px;
    }

    100% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        max-height: 200px;
        padding-top: var(--hero-space-4);
        padding-bottom: var(--hero-space-4);
        margin-bottom: var(--hero-space-4);
    }
}

.calc-result-price-main {
    font-size: 1.75rem;
    /* slightly reduced */
    font-weight: 700;
    color: #15803d;
    letter-spacing: -0.02em;
    line-height: 1;
    animation: scaleInPrice 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
}

.calc-result-details {
    display: flex;
    align-items: center;
    gap: var(--hero-space-2);
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.6875rem;
    color: #16a34a;
    opacity: 0.85;
    text-align: center;
    animation: fadeInElement 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.5s backwards;
}

.calc-result-details span {
    white-space: nowrap;
}

@keyframes fadeInElement {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleInPrice {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile responsive styles for calc-result */
@media (max-width: 767px) {
    .calc-result-price-main {
        font-size: 1.6rem;
        /* slightly reduced on mobile */
    }

    .calc-result-details {
        font-size: 0.625rem;
    }
}

.calc-submit-btn {
    width: 100%;
    padding: var(--hero-space-3) var(--hero-space-4);
    background: var(--hero-accent);
    color: var(--color-primary-contrast);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--hero-radius-xl);
    cursor: pointer;
    box-shadow: var(--shadow-button);
    transition:
        background var(--hero-transition),
        transform var(--hero-transition),
        box-shadow var(--hero-transition);
}

.calc-submit-btn:hover {
    background: var(--hero-accent-dark);
}

.calc-submit-btn:active {
    transform: scale(0.99);
}

.hero-card-action-btn {
    align-self: flex-end;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hero-accent);
    border: none;
    border-radius: var(--hero-radius-xl);
    cursor: pointer;
    box-shadow: var(--shadow-button);
    transition:
        background var(--hero-transition),
        transform var(--hero-transition),
        box-shadow var(--hero-transition);
}

.hero-card-action-btn:hover {
    background: var(--hero-accent-dark);
}

.hero-card-action-btn:active {
    transform: translateY(0) scale(0.98);
}

.hero-card-action-btn svg {
    width: 20px;
    height: 20px;
    color: var(--color-primary-contrast);
}

.hero-card-action-btn-sm {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.hero-card-action-btn-sm svg {
    width: 16px;
    height: 16px;
}

.faq-links {
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-2);
    flex: 1;
}

.faq-link {
    display: flex;
    align-items: center;
    gap: var(--hero-space-3);
    padding: var(--hero-space-3);
    background: var(--hero-bg);
    border-radius: var(--hero-radius-lg);
    color: var(--hero-text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition:
        background var(--hero-transition),
        color var(--hero-transition);
}

.faq-link:hover {
    /* Use neutral gray on hover for help links */
    background: var(--color-gray-100);
    color: var(--color-gray-700);
}

.faq-link-icon {
    width: 18px;
    height: 18px;
    color: var(--hero-primary);
    flex-shrink: 0;
    transition: color var(--hero-transition);
}

@media (min-width: 768px) {
    .hero {
        padding: var(--hero-space-8) 0;
    }

    .hero-wrapper {
        padding: 0 var(--hero-space-6);
        gap: var(--hero-space-6);
    }

    .hero-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: var(--hero-space-8);
    }

    .hero-banner-content {
        gap: var(--hero-space-4);
        flex: 1;
        align-items: flex-start;
        text-align: left;
    }

    .hero-banner-title {
        font-size: 1.5rem;
    }

    .hero-cities {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: var(--hero-space-3);
        margin-top: var(--hero-space-1);
    }

    .hero-bidirectional {
        width: 28px;
        height: 28px;
    }

    .hero-banner-text {
        font-size: 1rem;
    }

    .hero-banner-image {
        flex: 0 0 auto;
        max-width: 450px;
        margin: 0;
    }

    .hero-banner-image img {
        width: 100%;
        height: auto;
        max-width: 450px;
    }

    .hero-cards {
        grid-template-columns: 1fr;
        gap: var(--hero-space-5);
    }

    .hero-card {
        min-height: 200px;
        padding: var(--hero-space-6);
    }

    .calc-layout {
        flex-direction: column;
        gap: var(--hero-space-5);
    }

    .calc-params {
        flex-direction: column;
        gap: var(--hero-space-3);
    }

    .calc-result {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--hero-space-3);
    }
}

@media (min-width: 1024px) {
    .hero-cards {
        display: grid;
        grid-template-columns: 2fr 1fr;
        grid-template-rows: auto 1fr;
        column-gap: var(--hero-space-4);
        row-gap: var(--hero-space-4);
        align-items: start;
    }

    .hero-card-calculator {
        grid-column: 1;
        grid-row: 1 / 3;
        order: 0;
        display: flex;
        flex-direction: column;
    }

    .hero-card-compact {
        grid-column: 2;
    }

    .hero-card-compact:nth-of-type(2) {
        grid-row: 1;
    }

    .hero-card-compact:nth-of-type(3) {
        grid-row: 2;
    }

    .hero-card-compact .hero-card-content {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .hero-card-help .hero-card-content {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .hero-card-help .faq-links {
        flex: 1;
        justify-content: space-between;
    }

    .hero-card {
        min-height: auto;
    }

    .hero-card-title {
        font-size: 1.1875rem;
    }

    .calc-layout {
        flex-direction: row;
        gap: var(--hero-space-6);
    }

    .calc-section {
        flex: 1;
    }

    .calc-cities {
        flex-direction: column;
        gap: var(--hero-space-3);
    }

    .calc-params {
        flex-direction: column;
        gap: var(--hero-space-3);
    }

    .calc-result {
        flex-direction: column;
    }
}

@media (min-width: 1200px) {
    .hero {
        padding: var(--hero-space-10) 0;
    }

    .hero-wrapper {
        max-width: 1280px;
        padding: 0 var(--hero-space-6);
        gap: var(--hero-space-8);
    }

    .hero-banner-title {
        font-size: 1.75rem;
    }

    .hero-bidirectional {
        width: 32px;
        height: 32px;
    }

    .hero-banner-text {
        font-size: 1.0625rem;
        max-width: 540px;
    }

    .hero-banner-image img {
        width: 100%;
        height: auto;
    }

    .hero-cards {
        gap: var(--hero-space-6);
    }

    .hero-card {
        padding: var(--hero-space-6);
    }

    .hero-card-calculator {
        padding: var(--hero-space-8);
    }

    .hero-card-title {
        font-size: 1.25rem;
    }

    .calc-layout {
        gap: var(--hero-space-12);
    }

    .calc-params {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Contact Banner */
.contact-banner {
    margin: var(--hero-space-12) auto;
    max-width: var(--max-width-container);
}

.contact-banner-content {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--hero-space-2);
    align-items: center;
    text-align: center;
    justify-content: center;
}

.contact-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--hero-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hero-primary);
    flex-shrink: 0;
}

.contact-banner-icon svg {
    width: 18px;
    height: 18px;
}

.contact-banner-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.contact-banner-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--hero-text-primary);
    margin: 0;
}

.contact-banner-description {
    font-size: 0.875rem;
    color: var(--hero-text-secondary);
    margin: var(--hero-space-1) 0 0 0;
    line-height: 1.4;
}

.contact-banner-actions {
    display: flex;
    gap: var(--hero-space-2);
    flex-wrap: wrap;
    justify-content: center;
}

.contact-banner-link {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--hero-primary);
    text-decoration: none;
    padding: var(--hero-space-1) 0;
}

.contact-banner-link:hover {
    text-decoration: underline;
}

/* Send/Receive Freight Page Styles */
.send-freight-section-title,
.receive-freight-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--hero-text-primary);
    margin-bottom: var(--hero-space-8);
    text-align: center;
    letter-spacing: -0.01em;
}

/* Stepper Container */
.stepper-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--hero-space-4);
    margin: 0 auto;
    max-width: var(--max-width-container);
}

.step-card {
    background: var(--hero-card-bg);
    border: 1px solid var(--hero-border);
    border-radius: var(--hero-radius-2xl);
    padding: var(--hero-space-6);
    transition: all var(--hero-transition);
    display: flex;
    flex-direction: column;
}

.step-card:hover {
    box-shadow: none;
}

.step-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--hero-space-4);
    margin-bottom: var(--hero-space-4);
}

/* Info Cards Section spacing */
.info-cards-section,
#info-cards-section {
    margin-top: var(--hero-space-8);
    margin-bottom: var(--hero-space-8);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--hero-primary-light);
    color: var(--hero-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    flex: 0 0 36px;
}

.step-head-left {
    display: flex;
    flex-direction: row;
    gap: var(--hero-space-3);
    align-items: center;
}

.step-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--hero-text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.step-card-content {
    padding-left: 0;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.step-description {
    font-size: 0.9375rem;
    color: var(--hero-text-secondary);
    margin: 0 0 var(--hero-space-4) 0;
    line-height: 1.6;
}

.step-checklist {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--hero-space-4) 0;
}

.step-checklist li {
    position: relative;
    padding-left: var(--hero-space-6);
    margin-bottom: var(--hero-space-2);
    font-size: 0.875rem;
    color: var(--hero-text-secondary);
    line-height: 1.6;
}

.step-checklist li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--hero-primary);
    font-weight: 700;
}

.step-alert {
    padding: var(--hero-space-2);
    border-radius: var(--hero-radius-sm);
    display: flex;
    gap: var(--hero-space-2);
    align-items: center;
    font-size: 0.9375rem;
}

.step-alert-critical {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: var(--hero-space-2);
}

.step-alert-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 0;
    opacity: 0.95;
}

.step-links {
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-1);
    align-items: flex-end;
    margin-left: auto;
}

.step-link {
    display: inline;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    color: var(--hero-primary);
    text-decoration: underline;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    transition: color var(--hero-transition);
}

.step-link:hover {
    color: var(--hero-primary-dark);
    text-decoration: underline;
}

.step-link-primary {
    color: var(--hero-primary);
    font-weight: 700;
}

.step-link-primary:hover {
    color: var(--hero-primary-dark);
}

/* Action buttons */
.step-actions {
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-3);
    margin-top: var(--hero-space-4);
    justify-content: flex-start;
    align-items: stretch;
    margin-left: 0;
    margin-top: auto;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: calc(var(--hero-space-3)) var(--hero-space-4);
    background: var(--background-light);
    border: 1px solid var(--hero-border);
    border-radius: var(--hero-radius-xl);
    color: var(--hero-text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: box-shadow 180ms var(--hero-transition-easing, ease), background-color 180ms var(--hero-transition-easing, ease), color 180ms var(--hero-transition-easing, ease);
    width: 100%;
    justify-content: center;
    will-change: box-shadow;
}

.action-button:hover {
    background: var(--color-gray-100);
    border-color: var(--hero-border);
    color: var(--hero-text-primary);
    transform: none;
    box-shadow: none;
    outline: none;
}

.action-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(55, 65, 81, 0.06);
    outline: none;
}

.action-button:active {
    transform: none;
    box-shadow: none;
}

.action-button--primary {
    background: var(--hero-primary);
    border-color: var(--hero-primary);
    color: var(--color-primary-contrast);
    font-weight: 700;
    border-radius: var(--hero-radius-xl);
    transition: box-shadow 180ms var(--hero-transition-easing, ease), background-color 180ms var(--hero-transition-easing, ease), color 180ms var(--hero-transition-easing, ease);
    will-change: box-shadow;
}

.action-button--primary:hover {
    background: var(--color-gray-800);
    border-color: var(--color-gray-800);
    color: var(--color-primary-contrast);
    transform: none;
    box-shadow: none;
}

.action-button--primary:focus-visible {
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
    outline: none;
}

.action-button--primary:active {
    transform: none;
    box-shadow: none;
}

.action-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Receive Section */
.receive-section {
    max-width: var(--max-width-container);
    margin: 0 auto;
}

.receive-section>.send-freight-section-title {
    text-align: left;
    margin-bottom: var(--hero-space-3);
}

.receive-inline {
    display: block;
    margin: 0;
    color: var(--hero-text-secondary);
    font-size: 0.95rem;
}

/* Receive feature */
.receive-feature {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--hero-space-6);
    align-items: center;
    margin-top: var(--hero-space-4);
}

.receive-feature-image svg {
    width: 100%;
    height: auto;
    display: block;
    color: var(--hero-primary);
}

.check-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--hero-space-4);
}

.check-list li {
    display: flex;
    gap: var(--hero-space-4);
    align-items: flex-start;
}

.check-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--hero-primary);
    color: var(--color-primary-contrast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.check-text {
    font-weight: 600;
    color: var(--hero-text-primary);
}

.check-desc {
    font-size: 0.95rem;
    color: var(--hero-text-secondary);
    margin-top: 4px;
}

.receive-cards {
    position: relative;
    min-height: 200px;
}

.receive-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--hero-space-10) var(--hero-space-4);
    color: var(--text-light);
}

.receive-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--hero-space-4);
}

.receive-item-card {
    background: var(--hero-card-bg);
    border: 1px solid var(--hero-border);
    border-radius: var(--hero-radius-xl);
    padding: var(--hero-space-5);
    display: flex;
    gap: var(--hero-space-4);
    align-items: flex-start;
    transition: all var(--hero-transition);
}

.receive-item-card:hover {
    box-shadow: none;
}

.receive-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--hero-radius-lg);
    background: var(--hero-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hero-primary);
    flex-shrink: 0;
}

.receive-item-icon svg {
    width: 24px;
    height: 24px;
}

.receive-item-content {
    flex: 1;
}

.receive-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--hero-text-primary);
    margin: 0 0 var(--hero-space-2) 0;
}

.receive-item-description {
    font-size: 0.875rem;
    color: var(--hero-text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Useful Links */
.useful-links-section {
    max-width: var(--max-width-container);
    margin: 0 auto;
}

.useful-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--hero-space-3);
}

.useful-link-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--hero-space-2);
    padding: var(--hero-space-3) var(--hero-space-4);
    background: var(--background-light);
    border: 1px solid var(--hero-border);
    border-radius: var(--radius-full);
    color: var(--hero-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--hero-transition);
    text-align: center;
    justify-content: center;
}

.useful-link-chip:hover {
    background: var(--hero-primary-light);
    border-color: var(--hero-primary);
    color: var(--hero-primary);
}

.useful-link-chip svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.final-cta {
    max-width: var(--max-width-container);
    margin: var(--hero-space-10) auto 0;
}

.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--hero-space-4);
    margin-top: var(--hero-space-6);
}

.info-card {
    background: var(--hero-card-bg);
    border: 1px solid var(--hero-border);
    border-radius: var(--hero-radius-xl);
    padding: var(--hero-space-5);
    display: flex;
    gap: var(--hero-space-4);
    align-items: flex-start;
    transition: all var(--hero-transition);
}

.info-card:hover {
    box-shadow: none;
}

.info-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--hero-radius-lg);
    background: var(--hero-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hero-primary);
    flex-shrink: 0;
}

.info-card-icon svg {
    width: 24px;
    height: 24px;
}

.info-card-content {
    flex: 1;
}

.info-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--hero-text-primary);
    margin: 0 0 var(--hero-space-2) 0;
}

.info-card-description {
    font-size: 0.875rem;
    color: var(--hero-text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Mobile: stack contact banner vertically for small screens */
@media (max-width: 480px) {
    .contact-banner-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .contact-banner-text {
        align-items: center;
    }

    /* Make phone number appear on its own line on small screens */
    .contact-banner-link {
        display: block;
        margin-top: 0.25rem;
    }

    .step-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .action-button {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .receive-feature {
        grid-template-columns: 1fr;
    }

    .receive-feature-image {
        order: -1;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .stepper-container {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--hero-space-5);
    }

    .useful-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: Horizontal Stepper */
@media (min-width: 1024px) {
    .stepper-container {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--hero-space-5);
    }

    .step-card-header {
        flex-direction: row;
        align-items: center;
    }

    .contact-banner-content {
        flex-direction: row;
        text-align: center;
        align-items: center;
        justify-content: center;
        gap: var(--hero-space-3);
    }

    .contact-banner-text {
        flex: none;
        max-width: 520px;
    }

    .contact-banner-actions {
        justify-content: center;
    }

    .receive-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    /* Desktop: show two info cards per row */
    .info-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--hero-space-5);
    }
}