/**
 * نظام إدارة العقارات — ألوان كاكاو فاتح، Grid + Flexbox
 */
:root {
    --cocoa-50: #faf6f0;
    --cocoa-100: #f0e6d8;
    --cocoa-200: #e4d4bc;
    --cocoa-300: #d4b896;
    --cocoa-400: #c4a57a;
    --cocoa-500: #a08055;
    --cocoa-700: #6b5238;
    --cocoa-900: #3d2e1f;
    --white: #fffdf9;
    --text: #2c2419;
    --muted: #6b5c4d;
    --danger: #b54a3c;
    --success: #3d7a4a;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(61, 46, 31, 0.08);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--cocoa-50) 0%, var(--cocoa-100) 100%);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: var(--cocoa-700);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.container {
    width: min(1120px, 100% - 2rem);
    margin-inline: auto;
}

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--cocoa-200);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    flex-wrap: wrap;
}

.logo {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--cocoa-900);
    text-decoration: none;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.main-nav a {
    font-size: 0.95rem;
}

.badge {
    display: inline-block;
    min-width: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.75rem;
    background: var(--danger);
    color: #fff;
    border-radius: 999px;
    margin-inline-start: 0.25rem;
    vertical-align: middle;
}

.main-content {
    padding: 2rem 0 3rem;
}

/* هيرو الصفحة الرئيسية — خلفية صورة + تظليل للقراءة */
main.main-content.container > .home-hero--bleed:first-child {
    width: 100vw;
    max-width: 100vw;
    margin-inline: calc(50% - 50vw);
    margin-block-start: -2rem;
    margin-block-end: 0;
}

.home-hero--bleed {
    position: relative;
    min-height: min(56vh, 560px);
    display: flex;
    align-items: center;
    overflow: hidden;
    border-block-end: 1px solid rgba(61, 46, 31, 0.2);
    box-shadow: 0 12px 40px rgba(61, 46, 31, 0.15);
}

.home-hero__media {
    position: absolute;
    inset: 0;
    background-color: var(--cocoa-700);
    background-image: url("../images/hero-bg.jpg");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transform: scale(1.02);
}

.home-hero__shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        135deg,
        rgba(45, 35, 25, 0.82) 0%,
        rgba(61, 46, 31, 0.55) 45%,
        rgba(107, 82, 56, 0.45) 100%
    );
}

.home-hero__inner {
    position: relative;
    z-index: 2;
    padding-block: 3rem 3.25rem;
    padding-inline: 0;
}

.home-hero__title {
    margin: 0 0 0.65rem;
    font-size: clamp(1.65rem, 4vw, 2.25rem);
    font-weight: 800;
    color: #fffef8;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
    line-height: 1.25;
}

.home-hero__lead {
    margin: 0 0 1.5rem;
    max-width: 38rem;
    font-size: 1.05rem;
    color: rgba(255, 254, 248, 0.92);
    line-height: 1.65;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
}

.home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
}

.home-hero__btn {
    text-decoration: none;
    border-radius: 999px;
    padding: 0.6rem 1.35rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.home-hero__btn--primary {
    background: linear-gradient(180deg, #f5e6d0, #e4d0b4);
    color: #3d2e1f;
    border: 1px solid #c4a57a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.home-hero__btn--primary:hover {
    filter: brightness(1.06);
    text-decoration: none;
}

.home-hero__btn--outline {
    background: rgba(255, 255, 255, 0.12);
    color: #fffef8;
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.home-hero__btn--outline:hover {
    background: rgba(255, 255, 255, 0.22);
    text-decoration: none;
}

#browse-properties {
    scroll-margin-top: 5.5rem;
}

html {
    scroll-behavior: smooth;
}

/* بنرات التسجيل — ألوان كاكاو / برونز دافئة */
.promo-strip--register {
    background: linear-gradient(105deg, #5c4330 0%, #7a5c42 38%, #9d7b55 100%);
    color: #fffef8;
    border-bottom: 1px solid rgba(45, 35, 25, 0.35);
    box-shadow: 0 6px 20px rgba(61, 46, 31, 0.12);
}

.promo-strip__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    padding: 0.85rem 0;
}

.promo-strip__text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: min(52ch, 100%);
}

.promo-strip__text strong {
    color: #ffe8c4;
    font-weight: 700;
}

.promo-strip__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.promo-strip__btn {
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.promo-strip__btn--primary {
    background: linear-gradient(180deg, #f5e6d0, #e4d0b4);
    color: #3d2e1f;
    border-color: #c4a57a;
    font-weight: 700;
}

.promo-strip__btn--primary:hover {
    filter: brightness(1.06);
    text-decoration: none;
}

.promo-strip__btn--ghost {
    background: rgba(255, 255, 255, 0.1);
    color: #fffef8;
    border-color: rgba(255, 255, 255, 0.35);
}

.promo-strip__btn--ghost:hover {
    background: rgba(255, 255, 255, 0.18);
    text-decoration: none;
}

.promo-banner--home {
    margin-bottom: 2rem;
    padding: 1.35rem 1.5rem;
    border-radius: var(--radius);
    background: linear-gradient(145deg, #efe4d6 0%, #e8d9c4 45%, #dcc6a8 100%);
    border: 1px solid var(--cocoa-300);
    box-shadow: 0 10px 32px rgba(107, 82, 56, 0.14);
    position: relative;
    overflow: hidden;
}

.promo-banner--home::before {
    content: "";
    position: absolute;
    inset-inline-end: -20%;
    inset-block-start: -40%;
    width: 45%;
    height: 180%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.35) 0%, transparent 68%);
    pointer-events: none;
}

.promo-banner__content {
    position: relative;
    z-index: 1;
}

.promo-banner__title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
    color: var(--cocoa-900);
}

.promo-banner__desc {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 56ch;
}

.promo-banner__cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.promo-banner__btn-main {
    background: linear-gradient(135deg, #8b6f4e, #6b5238);
    color: #fffef8;
    border: 1px solid #5a4330;
    font-weight: 700;
    padding: 0.6rem 1.35rem;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(61, 46, 31, 0.2);
}

.promo-banner__btn-main:hover {
    filter: brightness(1.08);
    text-decoration: none;
}

.promo-banner__hint {
    font-size: 0.85rem;
    color: var(--cocoa-700);
    opacity: 0.9;
}

/* Alerts */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}
.alert-success {
    background: #e8f4ea;
    border-color: #b8d9be;
    color: #1e4d28;
}
.alert-error {
    background: #fce8e6;
    border-color: #f0c4c0;
    color: #7a2a22;
}

/* Typography */
h1,
h2,
h3 {
    color: var(--cocoa-900);
    margin-top: 0;
}

.page-title {
    margin-bottom: 1.5rem;
}

/* أقسام الصفحة الرئيسية */
.home-section {
    margin-bottom: 2.5rem;
    padding: 1.25rem 1.25rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--cocoa-200);
    box-shadow: var(--shadow);
}

.home-section-title {
    font-size: 1.35rem;
    margin: 0 0 0.35rem;
    color: var(--cocoa-900);
}

.home-section-title--browse {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.home-section-lead {
    margin: 0 0 1.25rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.properties-grid--featured .property-card {
    border-color: var(--cocoa-300);
    box-shadow: 0 10px 28px rgba(160, 128, 85, 0.12);
}

.properties-grid--latest {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    max-width: 100%;
}

@media (min-width: 900px) {
    .properties-grid--latest {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--cocoa-300);
    background: var(--white);
    color: var(--cocoa-900);
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
}
.btn:hover {
    background: var(--cocoa-100);
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--cocoa-300), var(--cocoa-400));
    border-color: var(--cocoa-400);
    color: var(--cocoa-900);
    font-weight: 600;
}
.btn-primary:hover {
    filter: brightness(1.05);
}
.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
}
.btn-danger {
    border-color: #e0a099;
    background: #fdecea;
    color: #8c2d22;
}

/* Forms */
.form-grid {
    display: grid;
    gap: 1rem;
    max-width: 520px;
}
.form-grid.wide {
    max-width: 720px;
}
label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.9rem;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--cocoa-200);
    border-radius: var(--radius);
    background: var(--white);
    font: inherit;
}
textarea {
    min-height: 120px;
    resize: vertical;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

/* Filters bar */
.filters-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    align-items: end;
    padding: 1.25rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.75rem;
    border: 1px solid var(--cocoa-200);
}

/* Property cards grid */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.property-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--cocoa-200);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.property-card .thumb {
    aspect-ratio: 4/3;
    background: var(--cocoa-100);
    overflow: hidden;
}
.property-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.property-card .body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.property-card h3 {
    font-size: 1.05rem;
    margin: 0 0 0.35rem;
}
.property-card .meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}
.property-card .price {
    font-weight: 800;
    color: var(--cocoa-700);
    margin-top: auto;
}
.tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--cocoa-100);
    color: var(--cocoa-700);
}
.tag-featured {
    background: linear-gradient(135deg, #fff4d6, #ffe0a3);
    color: #7a5a10;
    font-weight: 700;
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
}
.pagination a,
.pagination span {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--cocoa-200);
    background: var(--white);
}
.pagination .current {
    background: var(--cocoa-200);
    font-weight: 700;
}

/* Property detail */
.property-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 900px) {
    .property-detail {
        grid-template-columns: 1.1fr 0.9fr;
    }
}

.slider {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--cocoa-100);
    border: 1px solid var(--cocoa-200);
}
.slider-main {
    aspect-ratio: 16/10;
    display: flex;
    flex-direction: row;
    transition: transform 0.35s ease;
    width: 100%;
}
.slider-main img {
    min-width: 100%;
    flex-shrink: 0;
    object-fit: cover;
}
.slider-thumbs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    flex-wrap: wrap;
}
.slider-thumbs button {
    border: 2px solid transparent;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    width: 64px;
    height: 48px;
}
.slider-thumbs button.active {
    border-color: var(--cocoa-500);
}
.slider-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.slider-nav {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}
.slider-nav button {
    pointer-events: auto;
    margin: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 1.2rem;
}

.detail-panel {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--cocoa-200);
    box-shadow: var(--shadow);
}

.stars {
    color: #c9a227;
    letter-spacing: 2px;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--cocoa-200);
    box-shadow: var(--shadow);
}
table {
    width: 100%;
    border-collapse: collapse;
}
th,
td {
    padding: 0.65rem 0.85rem;
    text-align: right;
    border-bottom: 1px solid var(--cocoa-100);
}
th {
    background: var(--cocoa-100);
    font-weight: 700;
    font-size: 0.9rem;
}

/* Dashboard stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--cocoa-200);
    box-shadow: var(--shadow);
}
.stat-card .num {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--cocoa-700);
}

/* Messages */
.thread-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.thread-item {
    background: var(--white);
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--cocoa-200);
}
.thread-item.unread {
    border-color: var(--cocoa-400);
    background: #fffefb;
}

/* Footer */
.site-footer {
    margin-top: auto;
    padding: 1.5rem 0;
    border-top: 1px solid var(--cocoa-200);
    background: var(--white);
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.map-embed {
    width: 100%;
    height: 260px;
    border: 0;
    border-radius: var(--radius);
    margin-top: 0.75rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
    background: var(--white);
    border-radius: var(--radius);
    border: 1px dashed var(--cocoa-300);
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
