:root {
    --primary: #1d70f7;
    --primary-dark: #0f4ccc;
    --accent: #f97316;
    --surface: #ffffff;
    --surface-muted: #f4f6fb;
    --background: #f7f9fc;
    --text: #111827;
    --text-muted: #4b5563;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --success: #22c55e;
    --danger: #ef4444;
}

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

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

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

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.layout-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    color: var(--text);
    font-size: 1.1rem;
}

.brand-badge {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 700;
    border-radius: 12px;
    letter-spacing: 0.05em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-weight: 600;
}

.main-nav a {
    position: relative;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.35rem;
    height: 2px;
    background: var(--primary);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus {
    color: var(--text);
}

.main-nav a:hover::after,
.main-nav a:focus::after {
    transform: scaleX(1);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    background: var(--surface);
    color: var(--text);
    transition: box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.button.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 12px 24px -16px var(--primary);
}

.button.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 28px -20px var(--primary);
}

.button.ghost {
    background: rgba(29, 112, 247, 0.12);
    color: var(--primary-dark);
}

.button.ghost:hover {
    background: rgba(29, 112, 247, 0.18);
}

.button.block {
    width: 100%;
}

.hero {
    padding: 4rem 0 3rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    align-items: stretch;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(29, 112, 247, 0.12);
    color: var(--primary-dark);
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin: 0 0 1.25rem;
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin: 0 0 1.75rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.hero-intro {
    max-width: 760px;
    margin: 0 auto 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero-intro h1 {
    margin: 0;
}

.hero-search {
    background: linear-gradient(180deg, rgba(29, 112, 247, 0.08), rgba(255, 255, 255, 0));
    padding-bottom: 3rem;
}

.search-slab {
    background: var(--surface);
    padding: 2.2rem 2.6rem;
    border-radius: 36px;
    border: 1px solid rgba(17, 24, 39, 0.05);
    box-shadow: 0 35px 70px -45px rgba(15, 76, 204, 0.4);
    position: relative;
    overflow: hidden;
}

.search-slab::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 120% at 0% 0%, rgba(29, 112, 247, 0.12), transparent 60%);
    pointer-events: none;
}

.search-headline {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.75rem;
}

.search-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(29, 112, 247, 0.12);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.85rem;
}

.search-headline p {
    margin: 0;
    color: var(--text-muted);
}

.search-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: end;
    z-index: 1;
}

.search-field {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.search-field label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-9 { grid-column: span 9; }
.span-12 { grid-column: span 12; }

.input-wrap {
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 16px;
    padding: 0.4rem 1rem;
    background: var(--surface);
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.search-control {
    width: 100%;
    padding: 0.8rem 0;
    border: none;
    background: transparent;
    font-size: 1rem;
}

.search-control:focus {
    outline: none;
}

.input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(29, 112, 247, 0.18);
}

.search-select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--primary) 50%),
        linear-gradient(135deg, var(--primary) 50%, transparent 50%);
    background-position:
        calc(100% - 16px) calc(50% - 5px),
        calc(100% - 12px) calc(50% - 5px);
    background-size: 12px 12px;
    background-repeat: no-repeat;
}

.split-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
}

.split-divider {
    font-weight: 600;
    color: var(--text-muted);
}

.search-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.25rem;
}

.advanced-link {
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(29, 112, 247, 0.45);
}

.advanced-link:hover {
    text-decoration-color: rgba(29, 112, 247, 0.9);
}

.section {
    padding: 3.5rem 0;
}

.section.muted {
    background: var(--surface-muted);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    margin: 0 0 0.6rem;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.section-header p {
    margin: 0;
    color: var(--text-muted);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.step-card {
    background: var(--surface);
    border-radius: 18px;
    padding: 1.5rem;
    border: 1px solid rgba(17, 24, 39, 0.06);
    box-shadow: 0 16px 28px -24px rgba(17, 24, 39, 0.4);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(29, 112, 247, 0.12);
    color: var(--primary-dark);
    font-weight: 700;
}

.filters {
    display: inline-flex;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.filter {
    border: none;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.filter:hover {
    color: var(--text);
}

.filter.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 12px 20px -16px var(--primary);
}

.promoted {
    background: var(--surface-muted);
}

.promoted-grid {
    display: grid;
    gap: 1.75rem;
}

.promoted-card {
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid rgba(17, 24, 39, 0.06);
    box-shadow: 0 30px 60px -45px rgba(15, 76, 204, 0.4);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr);
    overflow: hidden;
}

.promoted-image {
    background: linear-gradient(135deg, rgba(29, 112, 247, 0.2), rgba(15, 76, 204, 0.45));
    display: grid;
    place-items: center;
    min-height: 260px;
}

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

.badge.featured {
    background: rgba(249, 115, 22, 0.12);
    color: var(--accent);
}

.promoted-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.categories {
    background: var(--surface);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--surface-muted);
    border-radius: 20px;
    padding: 1.75rem;
    border: 1px solid rgba(17, 24, 39, 0.05);
    box-shadow: 0 20px 36px -32px rgba(17, 24, 39, 0.25);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.category-icon {
    font-size: 2rem;
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
}

.listing-card {
    background: var(--surface);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 32px 50px -45px rgba(17, 24, 39, 0.5);
    border: 1px solid rgba(17, 24, 39, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 40px 60px -50px rgba(17, 24, 39, 0.6);
}

.listing-media {
    position: relative;
    min-height: 180px;
    background: linear-gradient(135deg, rgba(29, 112, 247, 0.25), rgba(15, 76, 204, 0.45));
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-placeholder {
    display: inline-flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
}

.badge-available {
    color: var(--success);
}

.badge-sold,
.badge-archived,
.badge-closed {
    color: var(--danger);
}

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

.listing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.listing-header h3 {
    margin: 0;
    font-size: 1.15rem;
}

.listing-price {
    font-weight: 700;
    color: var(--primary-dark);
}

.listing-content p {
    margin: 0;
    color: var(--text-muted);
}

.listing-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.listing-actions {
    display: flex;
    gap: 0.75rem;
}

.auction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.auction-card {
    background: var(--surface);
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 18px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 18px 30px -28px rgba(17, 24, 39, 0.4);
}

.auction-date {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(15, 76, 204, 0.12);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.85rem;
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 3rem 0;
}

.flash-messages {
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: #fff;
}

.flash-success {
    background: rgba(34, 197, 94, 0.9);
}

.flash-danger {
    background: rgba(239, 68, 68, 0.9);
}

.flash-info {
    background: rgba(29, 112, 247, 0.9);
}

.form-wrapper {
    background: var(--surface);
    padding: 2.5rem;
    max-width: 420px;
    margin: 2.5rem auto;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 18px;
    box-shadow: 0 26px 48px -40px rgba(17, 24, 39, 0.5);
}

.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

label {
    font-weight: 600;
}

.input {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--surface);
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 112, 247, 0.18);
}

.error {
    color: var(--danger);
    font-size: 0.85rem;
}

.footer {
    background: #0f172a;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    padding: 3rem 1.5rem;
}

.footer h3,
.footer h4 {
    margin: 0 0 1rem;
    color: #fff;
}

.footer p,
.footer a {
    margin: 0.2rem 0;
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.2rem 0;
    font-size: 0.9rem;
}

@media (max-width: 1200px) {
    .search-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .span-9 {
        grid-column: span 6;
    }

    .span-5,
    .span-4,
    .span-3 {
        grid-column: span 3;
    }

    .span-12 {
        grid-column: span 6;
    }
}

@media (max-width: 1024px) {
    .main-nav {
        gap: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        align-self: stretch;
        justify-content: space-between;
        width: 100%;
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 0.75rem 0;
    }

    .main-nav {
        display: none;
    }

    .hero {
        padding: 3rem 0 2rem;
    }

    .search-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .span-9,
    .span-5,
    .span-4,
    .span-3,
    .span-12 {
        grid-column: span 1;
    }

    .listing-actions {
        flex-direction: column;
    }
}
