:root {
    --background: #081423;
    --background-soft: #0d1b2d;
    --background-deep: #050d18;
    --surface: rgba(13, 27, 45, 0.74);
    --surface-elevated: rgba(24, 39, 63, 0.82);
    --surface-card: rgba(15, 29, 47, 0.88);
    --foreground: #f4f7fb;
    --muted: #9fb0c7;
    --muted-strong: #c4cfdf;
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.18);
    --accent: #2fd5ba;
    --accent-strong: #47d6da;
    --accent-fg: #03121a;
    --badge-ml: rgba(92, 94, 255, 0.92);
    --badge-co: rgba(47, 213, 186, 0.92);
    --warning: #ff8e7a;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.28);
    --shadow-deep: 0 24px 80px rgba(1, 8, 18, 0.45);
    --glow: 0 0 0 1px rgba(47, 213, 186, 0.16), 0 0 28px rgba(47, 213, 186, 0.18);
    --hero-overlay:
        linear-gradient(90deg, rgba(4, 13, 25, 0.92) 0%, rgba(6, 19, 34, 0.85) 42%, rgba(8, 20, 35, 0.72) 100%),
        radial-gradient(circle at 80% 10%, rgba(47, 213, 186, 0.14), transparent 28%),
        radial-gradient(circle at 18% 18%, rgba(73, 116, 255, 0.15), transparent 22%),
        linear-gradient(180deg, rgba(4, 10, 18, 0.3), rgba(4, 10, 18, 0.8));
    --hero-pattern:
        linear-gradient(125deg, rgba(255, 255, 255, 0.05), transparent 34%),
        radial-gradient(circle at 22% 35%, rgba(255, 255, 255, 0.05), transparent 20%),
        linear-gradient(115deg, #10233c, #06101d 55%, #071321);
}

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

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Inter", system-ui, sans-serif;
    background: var(--background-deep);
    color: var(--foreground);
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-family: "Space Grotesk", system-ui, sans-serif;
    letter-spacing: -0.03em;
}

p,
ul {
    margin: 0;
}

svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-shell {
    position: relative;
    min-height: 100vh;
    overflow-x: clip;
    background:
        radial-gradient(circle at top right, rgba(47, 213, 186, 0.12), transparent 25%),
        radial-gradient(circle at left center, rgba(73, 116, 255, 0.12), transparent 24%),
        linear-gradient(180deg, #071321 0%, #081423 100%);
}

.hero-shell,
.results-shell {
    position: relative;
    min-height: 100vh;
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    background: var(--hero-overlay), var(--hero-pattern);
}

.hero-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.015) 0,
            rgba(255, 255, 255, 0.015) 1px,
            transparent 1px,
            transparent 72px
        );
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.06));
}

.hero-backdrop-compact {
    height: 28rem;
    min-height: 0;
}

.hero-content,
.results-layout {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 3rem 0 4rem;
}

.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
    align-items: center;
    gap: 2.5rem;
    min-height: 100vh;
}

.hero-content-home-simple {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(760px, calc(100% - 2rem));
    min-height: 100vh;
    padding: 2.5rem 0;
}

.results-layout {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.hero-content-results {
    min-height: auto;
    padding: 0;
    align-items: center;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.brand-column {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    justify-content: center;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 1rem;
    background: linear-gradient(145deg, rgba(47, 213, 186, 0.95) 0%, rgba(27, 164, 199, 0.98) 100%);
    box-shadow: 0 10px 30px rgba(47, 213, 186, 0.2);
}

.brand-mark {
    width: 1.45rem;
    height: 1.45rem;
    color: white;
}

.brand-text {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--foreground);
}

.brand-text span {
    color: var(--accent);
}

.section-kicker {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted-strong);
}

.hero-copy-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero-copy-panel {
    max-width: 40rem;
}

.hero-copy-panel h1 {
    max-width: 12ch;
    font-size: clamp(3rem, 7vw, 5.35rem);
    line-height: 0.92;
}

.hero-copy-panel h1 span {
    color: var(--accent);
}

.hero-description {
    max-width: 36rem;
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--muted-strong);
}

.form-column {
    display: flex;
    justify-content: flex-end;
}

.form-column-centered {
    width: 100%;
    justify-content: center;
}

.search-surface,
.results-board {
    border-radius: 1.75rem;
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-deep);
}

.search-surface {
    width: min(100%, 590px);
    padding: 1.6rem;
}

.compact-surface {
    padding: 1.35rem;
    background: rgba(11, 23, 39, 0.72);
}

.results-filter-surface {
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 1.05rem 1.2rem;
    border-radius: 1.1rem;
}

.results-filter-header {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.85rem;
    margin-bottom: 0.7rem;
}

.results-filter-header h2 {
    font-size: 1.14rem;
}

.mini-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    margin-bottom: 1.35rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #7f91ad;
    letter-spacing: 0.08em;
}

.step.is-active {
    color: var(--accent);
}

.step-dot {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
}

.step.is-active .step-dot {
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 0 18px rgba(47, 213, 186, 0.35);
}

.step-line {
    width: 3rem;
    height: 1px;
    background: rgba(255, 255, 255, 0.14);
}

.search-intro {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.2rem;
}

.search-intro h2 {
    font-size: clamp(1.45rem, 4vw, 2.15rem);
}

.search-intro p {
    color: var(--muted);
    line-height: 1.55;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.search-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.results-filter-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.results-filter-form .search-grid {
    gap: 0.8rem;
}

.results-filter-form .search-actions {
    margin-top: 0.15rem;
}

.results-filter-form .field label {
    margin-bottom: 0.28rem;
    font-size: 0.7rem;
}

.results-filter-form .field input {
    height: 2.72rem;
    border-radius: 0.78rem;
    padding: 0 0.8rem;
    font-size: 0.95rem;
}

.field label,
.summary-field span {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted-strong);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.field input {
    width: 100%;
    height: 3.2rem;
    padding: 0 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.94);
    font: inherit;
    color: #1c2430;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.field input::placeholder {
    color: #7b8492;
}

.field input:focus {
    border-color: rgba(47, 213, 186, 0.55);
    box-shadow: 0 0 0 3px rgba(47, 213, 186, 0.16);
}

.search-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.btn-search,
.btn-secondary,
.btn-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: 0.95rem;
    font-family: inherit;
    font-weight: 700;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-search {
    width: 100%;
    height: 3.35rem;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: var(--accent-fg);
    box-shadow: 0 10px 28px rgba(47, 213, 186, 0.26);
    cursor: pointer;
}

.btn-search:hover {
    transform: translateY(-1px);
}

.btn-search:disabled {
    cursor: wait;
}

.btn-search svg,
.btn-secondary svg,
.btn-view svg {
    width: 1rem;
    height: 1rem;
}

.btn-search.is-loading .search-icon,
.btn-search.is-loading [data-idle-label] {
    display: none;
}

.button-loader,
.button-label-loading {
    display: none;
}

.btn-search.is-loading .button-loader,
.btn-search.is-loading .button-label-loading {
    display: inline-flex;
}

.button-loader {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(3, 18, 26, 0.22);
    border-top-color: var(--accent-fg);
    border-radius: 999px;
    animation: spin 0.8s linear infinite;
}

.btn-secondary {
    min-width: 10rem;
    height: 3.35rem;
    padding: 0 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: var(--foreground);
}

.compact-secondary {
    min-width: 8.8rem;
}

.btn-secondary:hover,
.btn-view:hover {
    transform: translateY(-1px);
    border-color: rgba(47, 213, 186, 0.28);
    background: rgba(47, 213, 186, 0.12);
}

.results-board {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.source-warning {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 184, 77, 0.34);
    border-left: 4px solid rgba(255, 184, 77, 0.95);
    background:
        linear-gradient(90deg, rgba(255, 184, 77, 0.16) 0%, rgba(255, 184, 77, 0.06) 100%);
    color: var(--foreground);
    box-shadow: var(--shadow-soft);
}

.source-warning-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: rgba(255, 184, 77, 0.18);
    color: #ffd27b;
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
}

.source-warning-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.source-warning strong {
    font-size: 0.96rem;
    line-height: 1.2;
}

.source-warning span {
    font-size: 0.88rem;
    color: var(--muted-strong);
}

.source-warning-debug {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    margin-top: 0.35rem;
    font-size: 0.79rem;
    color: rgba(233, 239, 244, 0.84);
}

.source-warning-debug span {
    color: rgba(233, 239, 244, 0.84);
}

.source-warning-debug strong {
    font-size: 0.78rem;
    color: #ffe1a5;
}

.source-warning-debug-url {
    flex-basis: 100%;
    word-break: break-word;
}

.results-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.results-count {
    margin-top: 0.15rem;
    font-size: 1.45rem;
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 700;
}

.results-count strong {
    color: var(--accent);
}

.info-card {
    padding: 1rem 1.15rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
}

.info-card h2 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.info-card p {
    color: var(--muted);
}

.info-card-warning {
    border-color: rgba(255, 142, 122, 0.25);
}

.results-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.car-card {
    overflow: hidden;
    border-radius: 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--surface-card);
    box-shadow: var(--shadow-soft);
    min-height: 100%;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.car-card:hover {
    transform: translateY(-3px);
    border-color: rgba(47, 213, 186, 0.18);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

.image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
        #112235;
}

.image-wrap img,
.image-placeholder {
    width: 100%;
    height: 100%;
}

.image-wrap img {
    object-fit: cover;
    transition: transform 0.45s;
}

.car-card:hover img {
    transform: scale(1.04);
}

.image-placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
}

.badge {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: white;
    backdrop-filter: blur(10px);
}

.badge-ml {
    background: var(--badge-ml);
}

.badge-co {
    background: var(--badge-co);
}

.content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem;
}

.card-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--foreground);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price {
    font-size: 1.6rem;
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 700;
    color: var(--accent);
}

.meta,
.detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1rem;
    color: var(--muted-strong);
    font-size: 0.85rem;
}

.meta strong,
.detail-row strong {
    color: var(--foreground);
}

.btn-view {
    width: 100%;
    height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.03);
    color: var(--foreground);
}

.summary-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.3rem;
    border-radius: 1.3rem;
    border: 1px solid rgba(47, 213, 186, 0.16);
    background:
        radial-gradient(circle at top right, rgba(47, 213, 186, 0.08), transparent 25%),
        linear-gradient(180deg, rgba(18, 35, 57, 0.96), rgba(10, 21, 35, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), var(--shadow-soft);
}

.summary-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.summary-header h2 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.summary-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.summary-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    min-height: 8.2rem;
    padding: 1rem 1.05rem;
    border-radius: 1.05rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
}

.summary-block-accent {
    background: rgba(47, 213, 186, 0.08);
    border-color: rgba(47, 213, 186, 0.16);
}

.summary-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-strong);
}

.summary-value {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-size: clamp(2rem, 4vw, 2.9rem);
    font-weight: 700;
    line-height: 0.95;
}

.summary-value-accent {
    color: var(--accent);
}

.summary-controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.65rem;
}

.summary-field {
    margin: 0;
}

.summary-field input {
    height: 4.45rem;
    padding: 0 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: #162230;
    font-size: 1.65rem;
    font-weight: 700;
    text-align: center;
}

.summary-helper {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

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

@media (min-width: 720px) {
    .search-grid {
        grid-template-columns: 1fr 1fr;
    }

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

    .results-filter-form .search-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .results-filter-form .search-actions {
        justify-content: flex-start;
    }

    .results-filter-form .btn-search {
        width: auto;
        min-width: 11rem;
        height: 2.85rem;
        padding: 0 1.2rem;
        font-size: 0.92rem;
    }

    .results-filter-form .btn-secondary {
        height: 2.85rem;
        min-width: 7.75rem;
        font-size: 0.9rem;
    }
}

@media (min-width: 980px) {
    .summary-metrics {
        grid-template-columns: minmax(0, 1fr) 220px minmax(0, 1fr);
        align-items: stretch;
    }
}

@media (min-width: 1100px) {
    .results-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .hero-content {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-top: 2rem;
    }

    .form-column {
        justify-content: stretch;
    }

    .search-surface {
        width: 100%;
    }

    .hero-copy-panel h1 {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .hero-content,
    .results-layout {
        width: min(100% - 1rem, 1180px);
        padding-top: 1.25rem;
        padding-bottom: 2.5rem;
    }

    .brand-badge {
        width: 2.8rem;
        height: 2.8rem;
    }

    .brand-text {
        font-size: 1.65rem;
    }

    .hero-copy-panel h1 {
        font-size: clamp(2.35rem, 12vw, 3.35rem);
    }

    .search-surface,
    .results-board {
        padding: 1rem;
        border-radius: 1.2rem;
    }

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

    .btn-secondary {
        width: 100%;
    }

    .results-filter-header {
        align-items: flex-start;
    }

    .card-header-row,
    .summary-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
