:root {
    --bg: #f4f7fb;
    --bg-alt: #eaf1f8;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --line: #dbe5f0;
    --text: #17324d;
    --muted: #68809b;
    --brand: #256fbe;
    --brand-dark: #174f8f;
    --accent: #f07a1a;
    --accent-dark: #d96509;
    --success: #0e9f6e;
    --danger: #c0392b;
    --shadow: 0 24px 60px rgba(23, 50, 77, 0.12);
    --shadow-soft: 0 12px 30px rgba(23, 50, 77, 0.08);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Outfit", sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(34, 111, 190, 0.12), transparent 280px),
        linear-gradient(180deg, #f8fbfe 0%, #edf3f9 100%);
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }

.page-shell {
    width: min(1200px, calc(100vw - 24px));
    margin: 0 auto;
    padding: 14px 0 64px;
}

.site-header,
.search-shell,
.property-card,
.auth-card,
.form-shell,
.detail-hero,
.dashboard-hero,
.table-wrap,
.flash,
.stats article,
.empty-state,
.hero-spotlight,
.spotlight-card {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.site-header {
    position: sticky;
    top: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 999px;
    margin-bottom: 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand strong,
h1, h2, h3 {
    font-family: "Space Grotesk", sans-serif;
}

.brand small,
.site-nav a:not(.button),
.section-heading p,
.hero-copy p,
.pitch p,
.location,
.property-body p,
.flash,
label span,
input,
textarea,
select,
td small,
.empty-state p,
.spotlight-card span {
    color: var(--muted);
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: white;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand), var(--accent));
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.button,
button {
    border: 0;
    cursor: pointer;
    font: inherit;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.button,
button,
input,
select,
textarea {
    border-radius: 14px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    font-weight: 600;
}

.button.primary,
.search-submit,
.badge {
    color: white;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    box-shadow: 0 14px 28px rgba(240, 122, 26, 0.24);
}

.button.ghost {
    color: var(--brand);
    background: #eef5fd;
}

.hero-banner {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 22px;
    padding: 34px 34px 92px;
    border-radius: 34px;
    background:
        linear-gradient(135deg, rgba(19, 76, 133, 0.96), rgba(37, 111, 190, 0.9)),
        radial-gradient(circle at right top, rgba(255,255,255,0.18), transparent 35%);
    color: white;
}

.hero-banner::after {
    content: "";
    position: absolute;
    inset: auto -120px -130px auto;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.hero-copy,
.hero-copy p,
.hero-copy .eyebrow {
    position: relative;
    z-index: 1;
    color: rgba(255,255,255,0.92);
}

.hero-copy h1,
.detail-panel h1,
.dashboard-hero h1 {
    font-size: clamp(2rem, 5.2vw, 4.4rem);
    line-height: 1.02;
    margin: 10px 0 16px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.hero-actions .button.ghost {
    background: rgba(255,255,255,0.14);
    color: white;
}

.hero-spotlight {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    align-self: end;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.18);
    box-shadow: none;
}

.spotlight-card {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.16);
    box-shadow: none;
}

.spotlight-card strong,
.spotlight-card span {
    display: block;
    color: white;
}

.spotlight-card span {
    opacity: .82;
    margin-top: 6px;
}

.search-shell {
    position: relative;
    z-index: 3;
    margin: -56px 14px 24px;
    border-radius: 30px;
    padding: 22px;
}

.commercial-search,
.grid-form,
.property-form {
    display: grid;
    gap: 16px;
}

.search-top,
.search-main-grid {
    display: grid;
    gap: 14px;
}

.search-top {
    grid-template-columns: 1.2fr 1fr;
    align-items: end;
}

.search-main-grid {
    grid-template-columns: 1fr 1fr 1fr auto;
    align-items: end;
}

.search-field,
.search-pill-group,
label {
    display: grid;
    gap: 8px;
}

.password-hint {
    color: var(--muted);
    font-size: .94rem;
}

.search-label,
.eyebrow {
    display: inline-block;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: .76rem;
    color: var(--brand);
    font-weight: 700;
}

.segmented-control {
    display: flex;
    gap: 8px;
    padding: 6px;
    border-radius: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.segmented-control label {
    flex: 1;
    margin: 0;
}

.segmented-control input {
    display: none;
}

.segmented-control span {
    display: block;
    padding: 12px 10px;
    text-align: center;
    font-weight: 700;
    color: var(--brand-dark);
    border-radius: 12px;
    transition: .2s ease;
}

.segmented-control .active span {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: white;
}

.segmented-control .active-soft span {
    background: #eef5fd;
}

.form-shell,
.auth-card,
.detail-hero,
.table-wrap,
.empty-state {
    border-radius: 28px;
    padding: 24px;
}

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

.wide { grid-column: 1 / -1; }

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    background: white;
    min-height: 52px;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

.search-submit {
    min-width: 142px;
    min-height: 52px;
}

.stats,
.property-grid,
.plans-grid {
    display: grid;
    gap: 16px;
}

.stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 0 30px;
}

.commercial-stats {
    margin-top: 8px;
}

.admin-stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stats article {
    padding: 20px;
    border-radius: 22px;
}

.stats strong {
    display: block;
    font-size: 1.8rem;
    font-family: "Space Grotesk", sans-serif;
}

.section-heading {
    margin: 24px 0 16px;
}

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

.plans-section {
    margin-top: 36px;
}

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

.plan-card {
    padding: 26px;
    border-radius: 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.plan-card-highlight {
    background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
    border-top: 5px solid var(--brand);
}

.plan-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.plan-header h3 {
    margin: 8px 0 0;
    font-size: 1.9rem;
}

.plan-tag {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eaf2fd;
    color: var(--brand);
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.plan-tag.soft {
    background: #fff1e6;
    color: var(--accent-dark);
}

.plan-copy {
    color: var(--muted);
    margin: 0 0 18px;
}

.plan-features {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0 0 22px;
    list-style: none;
}

.plan-features li {
    position: relative;
    padding-left: 24px;
    color: var(--text);
}

.plan-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--accent));
}

.plan-features.compact {
    margin-bottom: 0;
}

.property-card {
    overflow: hidden;
    border-radius: 24px;
    transform: translateY(18px);
    opacity: 0;
    animation: rise .7s ease forwards;
}

.property-thumb {
    position: relative;
    aspect-ratio: 16 / 11;
    overflow: hidden;
}

.property-thumb img,
.detail-media img {
    height: 100%;
    object-fit: cover;
}

.property-fallback {
    height: 100%;
    background:
        linear-gradient(135deg, rgba(37, 111, 190, 0.9), rgba(240, 122, 26, 0.72)),
        repeating-linear-gradient(45deg, rgba(255,255,255,.08), rgba(255,255,255,.08) 14px, transparent 14px, transparent 28px);
}

.property-fallback.large {
    min-height: 420px;
}

.badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
}

.property-body {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.price {
    font-size: 1.4rem;
    font-family: "Space Grotesk", sans-serif;
}

.price.huge {
    font-size: 2.5rem;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: .94rem;
}

.auth-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.auth-card.single {
    grid-template-columns: 1fr;
    max-width: 760px;
    margin: 0 auto;
}

.pitch {
    padding: 8px;
}

.detail-hero {
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    gap: 24px;
}

.detail-media {
    border-radius: 24px;
    overflow: hidden;
}

.detail-panel {
    display: grid;
    gap: 16px;
}

.contact-box {
    display: grid;
    gap: 6px;
    padding: 18px;
    border-radius: 20px;
    background: #eef5fd;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    border-radius: 26px;
    margin-bottom: 18px;
}

.listing-table {
    width: 100%;
    border-collapse: collapse;
}

.listing-table th,
.listing-table td {
    text-align: left;
    padding: 16px 12px;
    border-bottom: 1px solid #e6edf4;
}

.actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-form button {
    color: var(--brand);
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.upload-preview {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    background: var(--surface-soft);
    border: 1px dashed rgba(37, 111, 190, 0.32);
}

.upload-preview img {
    max-width: 320px;
    border-radius: 16px;
    aspect-ratio: 16 / 11;
    object-fit: cover;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.checkbox-field input {
    width: auto;
    min-height: 0;
    margin: 0;
}

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

.gallery-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.detail-gallery {
    margin-top: 20px;
}

.flash {
    padding: 14px 18px;
    margin-bottom: 18px;
    border-radius: 16px;
}

.success {
    border-left: 4px solid var(--success);
}

.error,
.inline-error {
    border-left: 4px solid var(--danger);
    color: #7f1d1d;
}

.text-link {
    display: inline-block;
    color: var(--brand);
}

.empty-state {
    text-align: center;
    max-width: 720px;
    margin: 40px auto;
}

.wide-card {
    max-width: none;
    margin: 0;
    grid-column: 1 / -1;
}

.reveal:nth-child(2) { animation-delay: .08s; }
.reveal:nth-child(3) { animation-delay: .16s; }
.reveal:nth-child(4) { animation-delay: .24s; }
.reveal:nth-child(5) { animation-delay: .32s; }
.reveal:nth-child(6) { animation-delay: .4s; }

@keyframes rise {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 1100px) {
    .search-main-grid,
    .property-grid,
    .plans-grid,
    .gallery-grid,
    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-submit {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .site-header,
    .auth-card,
    .detail-hero,
    .dashboard-hero,
    .hero-banner,
    .search-top,
    .search-main-grid,
    .stats,
    .property-grid,
    .plans-grid,
    .property-form,
    .gallery-grid,
    .admin-stats {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .site-header {
        border-radius: 26px;
        padding: 16px;
    }

    .site-nav {
        width: 100%;
    }

    .site-nav .button,
    .site-nav a {
        width: 100%;
        justify-content: center;
    }

    .hero-banner {
        padding: 24px 18px 86px;
        gap: 18px;
    }

    .hero-copy h1,
    .detail-panel h1,
    .dashboard-hero h1 {
        font-size: clamp(1.8rem, 9vw, 2.6rem);
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .search-shell {
        margin: -62px 0 20px;
        padding: 16px;
        border-radius: 24px;
    }

    .segmented-control {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .checkbox-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .listing-table,
    .listing-table thead,
    .listing-table tbody,
    .listing-table tr,
    .listing-table td,
    .listing-table th {
        display: block;
    }

    .listing-table thead {
        display: none;
    }

    .listing-table tr {
        padding: 14px 0;
        border-bottom: 1px solid #e6edf4;
    }

    .listing-table td {
        padding: 8px 0;
        border: 0;
    }
}
