* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f4f7fb;
    color: #07162f;
    font-family: Arial, Helvetica, sans-serif;
}

[hidden] {
    display: none !important;
}

button,
input,
select {
    font: inherit;
}

.site-header {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #d9e1ec;
    display: flex;
    justify-content: space-between;
    min-height: 112px;
    padding: 10px 40px;
}

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

.brand-logo {
    height: 92px;
    object-fit: contain;
    width: 168px;
}

.brand strong,
.brand span {
    display: block;
}

.brand span,
.hero p,
.catalog-toolbar p,
.property-body p,
.property-location,
dd {
    color: #4d5c70;
}

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

.inactive-link {
    color: #748197;
    cursor: not-allowed;
    font-weight: 700;
}

.login-button,
.owner-link {
    background: transparent;
    border: 0;
    color: #0b66f0;
    cursor: pointer;
    font-weight: 700;
    padding: 0;
    text-decoration: none;
}

main {
    margin: 0 auto;
    max-width: 1260px;
    padding: 36px 28px 56px;
}

.hero {
    align-items: end;
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 520px);
    margin-bottom: 34px;
}

.hero-copy h1 {
    font-size: 44px;
    line-height: 1.08;
    margin: 8px 0 14px;
    max-width: 640px;
}

.hero-copy p {
    font-size: 18px;
    line-height: 1.5;
    margin: 0;
    max-width: 680px;
}

.eyebrow {
    color: #ff6b18 !important;
    font-size: 13px !important;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.search-panel {
    background: #ffffff;
    border: 1px solid #d9e1ec;
    border-radius: 8px;
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 1fr;
    padding: 18px;
}

label {
    color: #263650;
    display: grid;
    font-size: 13px;
    font-weight: 700;
    gap: 6px;
}

input,
select {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    min-height: 42px;
    padding: 0 12px;
}

.primary-button,
.secondary-button {
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
}

.primary-button {
    background: #0b66f0;
    border: 1px solid #0b66f0;
    color: #ffffff;
    font-weight: 700;
}

.secondary-button {
    background: #ffffff;
    border: 1px solid #0b66f0;
    color: #0b66f0;
}

.search-panel .primary-button {
    grid-column: span 2;
}

.catalog-toolbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.catalog-toolbar h2 {
    font-size: 28px;
    margin: 0 0 4px;
}

.catalog-toolbar p {
    margin: 0;
}

.message,
.empty-state {
    background: #fff4d6;
    border: 1px solid #f5cd6b;
    border-radius: 8px;
    color: #5f3f00;
    padding: 16px;
}

.catalog-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

.property-card {
    background: #ffffff;
    border: 1px solid #d9e1ec;
    border-radius: 8px;
    display: grid;
    overflow: hidden;
}

.property-image {
    aspect-ratio: 16 / 10;
    background: #dfe7f2;
    overflow: hidden;
}

.property-image img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.property-image-empty,
.detail-image-empty {
    align-items: center;
    color: #607086;
    display: flex;
    justify-content: center;
}

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

.property-location {
    font-size: 13px;
    margin: 0 0 6px;
}

.property-body h3 {
    font-size: 19px;
    margin: 0 0 6px;
}

.property-body p {
    margin: 0;
}

.property-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.property-meta span {
    background: #eef3f9;
    border-radius: 999px;
    color: #263650;
    font-size: 13px;
    padding: 6px 10px;
}

.property-footer {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.property-footer strong {
    font-size: 20px;
}

.property-footer small {
    color: #607086;
    font-size: 12px;
}

.spinner {
    animation: spin 0.8s linear infinite;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    height: 16px;
    width: 16px;
}

.modal-open {
    overflow: hidden;
}

.modal-shell {
    align-items: center;
    background: rgba(7, 22, 47, 0.62);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: fixed;
    z-index: 10;
}

.modal-shell.is-open {
    display: flex;
}

.modal-card,
.login-card {
    background: #ffffff;
    border-radius: 8px;
    max-height: 92vh;
    overflow: auto;
    padding: 22px;
    position: relative;
}

.modal-card {
    max-width: 1120px;
    width: min(1120px, 100%);
}

.login-card {
    max-width: 460px;
    width: min(460px, 100%);
}

.login-card h2 {
    font-size: 28px;
    margin: 0 32px 8px 0;
}

.login-card p {
    color: #4d5c70;
    line-height: 1.45;
    margin: 0 0 18px;
}

.login-form {
    display: grid;
    gap: 14px;
}

.icon-button {
    background: transparent;
    border: 0;
    color: #607086;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    position: absolute;
    right: 18px;
    top: 14px;
}

.detail-layout {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(300px, 1.15fr) minmax(300px, 0.85fr);
}

.detail-gallery {
    display: grid;
    gap: 12px;
}

.detail-main-image,
.detail-image-empty {
    aspect-ratio: 16 / 11;
    background: #dfe7f2;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.detail-main-image img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.gallery-arrow {
    align-items: center;
    background: rgba(7, 22, 47, 0.72);
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    font-size: 28px;
    height: 44px;
    justify-content: center;
    line-height: 1;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    z-index: 1;
}

.gallery-arrow-left {
    left: 14px;
}

.gallery-arrow-right {
    right: 14px;
}

.detail-thumbs {
    display: grid;
    gap: 8px;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, 58px);
    min-height: 124px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.detail-thumb {
    background: #dfe7f2;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    height: 58px;
    overflow: hidden;
    padding: 0;
    width: 84px;
}

.detail-thumb.is-selected {
    border-color: #0b66f0;
}

.detail-thumb img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.detail-info {
    display: grid;
    gap: 16px;
    padding-right: 18px;
}

.detail-info h2 {
    font-size: 30px;
    margin: 0;
}

.detail-price {
    color: #0b66f0;
    font-size: 24px;
}

dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

dl div {
    border-bottom: 1px solid #e6edf5;
    display: grid;
    gap: 4px;
    padding-bottom: 10px;
}

dt {
    color: #263650;
    font-size: 13px;
    font-weight: 700;
}

dd {
    margin: 0;
}

.detail-info section h3 {
    font-size: 16px;
    margin: 0 0 6px;
}

.detail-info section p {
    color: #4d5c70;
    line-height: 1.45;
    margin: 0;
}

.detail-loading {
    align-items: center;
    color: #263650;
    display: flex;
    gap: 12px;
    min-height: 260px;
    justify-content: center;
}

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

@media (max-width: 820px) {
    .catalog-toolbar,
    .property-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .site-header {
        align-items: flex-start;
        gap: 8px;
        min-height: auto;
        padding: 12px 12px 46px;
        position: relative;
    }

    .brand-logo {
        height: 72px;
        width: 132px;
    }

    .header-actions {
        align-items: flex-end;
        gap: 8px;
        justify-content: flex-end;
        position: absolute;
        right: 12px;
        top: 12px;
    }

    .inactive-link,
    .login-button {
        font-size: 13px;
        line-height: 1.2;
        white-space: nowrap;
    }

    main {
        padding: 24px 16px 40px;
    }

    .hero,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .hero-copy h1 {
        font-size: 34px;
    }

    .search-panel {
        grid-template-columns: 1fr;
    }

    .search-panel .primary-button {
        grid-column: auto;
    }
}
