/* ==========================================================================
   ريم بنت عبدالعزيز القحطاني - وسيطة ومستشارة عقارية معتمدة
   Architecture: Modern Bento-Grid UI (No Dark Mode)
   Palette: Emerald Forest, Apricot Coral, Milk White, Warm Sand
   ========================================================================== */

:root {
    --r-bg: #F7FAF8;
    --r-surface: #FFFFFF;
    --r-surface-soft: #EEF5F1;
    
    --r-emerald: #0D5C46;        /* Fresh Royal Emerald Forest */
    --r-emerald-light: #167A5E;
    --r-emerald-subtle: #E2EFE9;
    
    --r-coral: #E76F51;          /* Warm Apricot Coral */
    --r-coral-hover: #D45B3E;
    --r-coral-light: #FDF1EE;
    
    --r-text-main: #1A2621;
    --r-text-muted: #53635B;
    
    --r-border: #E0ECE5;
    --r-border-light: #EDF4F0;
    
    --font-heading: 'Alexandria', sans-serif;
    --font-body: 'Tajawal', sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --shadow-tile: 0 4px 18px rgba(13, 92, 70, 0.05);
    --shadow-hover: 0 12px 30px rgba(13, 92, 70, 0.1);
    
    --transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    background-color: var(--r-bg);
    color: var(--r-text-main);
    font-family: var(--font-body);
    line-height: 1.65;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    direction: rtl;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--r-emerald);
    line-height: 1.35;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

.text-emerald { color: var(--r-emerald) !important; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.btn-emerald {
    background-color: var(--r-emerald);
    color: #FFFFFF;
}

.btn-emerald:hover {
    background-color: var(--r-emerald-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(13, 92, 70, 0.25);
}

.btn-coral {
    background-color: var(--r-coral);
    color: #FFFFFF;
}

.btn-coral:hover {
    background-color: var(--r-coral-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(231, 111, 81, 0.25);
}

.btn-emerald-round {
    background-color: var(--r-emerald);
    color: #FFFFFF;
    border-radius: 30px;
    padding: 0.6rem 1.4rem;
    font-size: 0.88rem;
}

.btn-emerald-round:hover {
    background-color: var(--r-emerald-light);
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 0.95rem 1.8rem;
    font-size: 1rem;
}

.btn-block { width: 100%; }

/* Header */
.reem-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--r-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.85rem 0;
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.reem-avatar-badge {
    position: relative;
    width: 44px;
    height: 44px;
}

.nav-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--r-emerald);
}

.active-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #25D366;
    border: 2px solid #FFFFFF;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.broker-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--r-emerald);
}

.broker-fal {
    font-size: 0.72rem;
    color: var(--r-text-muted);
}

.broker-fal strong { color: var(--r-coral); }

.bento-nav {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--r-text-muted);
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--r-emerald);
    font-weight: 700;
}

/* Credential Banner */
.credential-banner {
    background-color: var(--r-emerald-subtle);
    border-bottom: 1px solid var(--r-border);
    padding: 0.5rem 0;
    font-size: 0.8rem;
    color: var(--r-emerald);
}

.cred-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-weight: 600;
}

.cred-flex i { color: var(--r-coral); }

/* Main Bento Grid Hub */
.bento-container {
    padding: 3.5rem 0 5rem;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

/* Common Tile Styles */
.bento-tile {
    background-color: var(--r-surface);
    border: 1px solid var(--r-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-tile);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.bento-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--r-emerald-light);
}

.tile-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-color: var(--r-coral-light);
    color: var(--r-coral);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.tile-icon-head {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: var(--r-emerald-subtle);
    color: var(--r-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Specific Bento Tile Sizes & Styles */
/* Tile 1: Hero (8 cols) */
.tile-hero {
    grid-column: span 8;
    background: linear-gradient(135deg, #FFFFFF 0%, var(--r-surface-soft) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tile-hero-title {
    font-size: 2.35rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.highlight-coral { color: var(--r-coral); }

.tile-hero-desc {
    font-size: 1.05rem;
    color: var(--r-text-muted);
    max-width: 600px;
    margin-bottom: 1.75rem;
    line-height: 1.75;
}

.quick-reem-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--r-border);
}

.q-stat strong {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    color: var(--r-emerald);
    display: block;
    line-height: 1.1;
}

.q-stat span {
    font-size: 0.78rem;
    color: var(--r-text-muted);
}

.tile-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Tile 2: Portrait (4 cols) */
.tile-portrait {
    grid-column: span 4;
    padding: 0;
    overflow: hidden;
}

.portrait-card-inner {
    height: 100%;
    position: relative;
    min-height: 380px;
}

.bento-reem-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portrait-overlay-badge {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    left: 1.25rem;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid var(--r-border);
    display: flex;
    flex-direction: column;
}

.p-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--r-emerald);
}

.p-title {
    font-size: 0.78rem;
    color: var(--r-text-muted);
}

.p-fal {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--r-coral);
    margin-top: 0.2rem;
}

/* Tile 3: Matcher (5 cols) */
.tile-matcher {
    grid-column: span 5;
    display: flex;
    flex-direction: column;
}

.tile-matcher h3 {
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
}

.matcher-hint {
    font-size: 0.88rem;
    color: var(--r-text-muted);
    margin-bottom: 1.25rem;
}

.bento-select, .bento-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--r-border);
    border-radius: var(--radius-sm);
    background-color: var(--r-bg);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--r-text-main);
    transition: var(--transition);
}

.bento-select:focus, .bento-input:focus {
    outline: none;
    border-color: var(--r-emerald);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(13, 92, 70, 0.1);
}

.matcher-result {
    background-color: var(--r-surface-soft);
    border: 1px solid var(--r-border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-top: 1.25rem;
}

.mr-label {
    font-size: 0.75rem;
    color: var(--r-text-muted);
}

.mr-hoods {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--r-emerald);
    display: block;
    margin: 0.3rem 0;
}

.mr-note {
    font-size: 0.8rem;
    color: var(--r-text-muted);
    margin-bottom: 0;
}

/* Tile 4: Calculator (7 cols) */
.tile-calculator {
    grid-column: span 7;
}

.calc-top h3 {
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
}

.calc-row-bento {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.calc-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--r-emerald);
    margin-bottom: 0.35rem;
}

.calc-bento-results {
    background-color: var(--r-surface-soft);
    border: 1px solid var(--r-border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.res-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: var(--r-text-muted);
}

.res-item strong {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--r-text-main);
}

/* Tiles 5 & 6: Properties (6 cols each) */
.tile-property {
    grid-column: span 6;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.tile-img-box {
    height: 220px;
    position: relative;
    overflow: hidden;
}

.tile-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tile-property:hover .tile-img-box img {
    transform: scale(1.05);
}

.bento-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: #FFFFFF;
    color: var(--r-emerald);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--r-border);
}

.tile-prop-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.prop-sub-meta {
    font-size: 0.78rem;
    color: var(--r-text-muted);
    margin-bottom: 0.3rem;
}

.prop-sub-meta i { color: var(--r-coral); }

.tile-prop-content h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.prop-brief {
    font-size: 0.88rem;
    color: var(--r-text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.prop-price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--r-border);
}

.p-cost {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--r-emerald);
}

.p-cost small {
    font-size: 0.75rem;
    color: var(--r-coral);
}

/* Tile 7: Interior & Assurance (4 cols) */
.tile-interior {
    grid-column: span 4;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.interior-wrap {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.interior-wrap img {
    height: 160px;
    width: 100%;
    object-fit: cover;
}

.interior-text {
    padding: 1.5rem;
}

.interior-text h4 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.interior-text p {
    font-size: 0.85rem;
    color: var(--r-text-muted);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Tile 8: List Property Form (8 cols) */
.tile-list-form {
    grid-column: span 8;
}

.tile-list-form h3 {
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
}

.list-hint {
    font-size: 0.88rem;
    color: var(--r-text-muted);
    margin-bottom: 1.5rem;
}

.reem-mini-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row-reem {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Tile 9: Reviews (6 cols) */
.tile-reviews {
    grid-column: span 6;
}

.tile-reviews h3 {
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
}

.review-quote-box {
    background-color: var(--r-surface-soft);
    border: 1px solid var(--r-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
}

.stars {
    color: #F4A261;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.quote-body {
    font-size: 0.95rem;
    color: var(--r-text-main);
    line-height: 1.75;
    margin-bottom: 1rem;
}

.quote-author strong {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    display: block;
    color: var(--r-emerald);
}

.quote-author span {
    font-size: 0.75rem;
    color: var(--r-text-muted);
}

/* Tile 10: WhatsApp Hub (6 cols) */
.tile-wa-hub {
    grid-column: span 6;
    background: linear-gradient(135deg, var(--r-emerald) 0%, #083E2F 100%);
    color: #FFFFFF;
}

.wa-hub-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.wa-icon-large {
    font-size: 2.2rem;
    color: #25D366;
}

.wa-hub-inner h3 {
    color: #FFFFFF;
    font-size: 1.3rem;
}

.wa-hub-inner p {
    color: #D2E4DC;
    font-size: 0.92rem;
    margin-bottom: 0.5rem;
}

/* Footer */
.reem-footer {
    background-color: #FFFFFF;
    border-top: 1px solid var(--r-border);
    padding: 3rem 0;
}

.footer-reem-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.f-brand-box .f-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--r-emerald);
}

.f-brand-box p {
    font-size: 0.8rem;
    color: var(--r-text-muted);
    margin: 0.2rem 0;
}

.f-fal {
    font-size: 0.78rem;
    color: var(--r-coral);
}

.f-links-box {
    display: flex;
    gap: 1.5rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.f-links-box a:hover { color: var(--r-emerald); }

.f-copy {
    font-size: 0.8rem;
    color: var(--r-text-muted);
}

/* Toasts */
.reem-toast-box {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.reem-toast {
    background-color: var(--r-emerald);
    color: #FFFFFF;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    border-right: 4px solid var(--r-coral);
    animation: toastPop 0.3s ease;
}

@keyframes toastPop {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.mobile-toggle {
    display: none;
    background: var(--r-surface-soft);
    border: 1px solid var(--r-border);
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    color: var(--r-emerald);
    font-size: 1.25rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.mobile-toggle:active {
    background-color: var(--r-coral-subtle);
    color: var(--r-coral);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Responsive Bento Grid & Mobile Layout */
@media (max-width: 992px) {
    .tile-hero, .tile-portrait, .tile-matcher, .tile-calculator, .tile-property, .tile-interior, .tile-list-form, .tile-reviews, .tile-wa-hub {
        grid-column: span 12 !important;
    }

    .bento-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #FFFFFF;
        border-bottom: 1px solid var(--r-border);
        flex-direction: column;
        padding: 1.25rem 1.5rem;
        gap: 0.85rem;
        box-shadow: 0 15px 35px rgba(26, 60, 52, 0.12);
        max-height: 80vh;
        overflow-y: auto;
        z-index: 999;
    }

    .bento-nav.active {
        display: flex;
    }

    .mobile-toggle {
        display: flex;
    }

    .portrait-card-inner {
        min-height: 300px;
    }
}

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

    .credential-banner {
        padding: 0.4rem 0;
        font-size: 0.75rem;
    }

    .cred-flex {
        justify-content: center;
        gap: 0.4rem;
    }

    .cred-flex span:not(:first-child):not(:last-child) {
        display: none;
    }

    .bento-tile {
        padding: 1.5rem 1.25rem;
    }

    .tile-hero-title {
        font-size: clamp(1.65rem, 5.5vw, 2.15rem);
        line-height: 1.35;
    }

    .tile-hero-desc {
        font-size: 0.95rem;
    }

    .calc-row-bento, .form-row-reem {
        grid-template-columns: 1fr;
    }

    .quick-reem-stats {
        flex-direction: column;
        gap: 0.75rem;
    }

    .footer-reem-wrap {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .f-links-box {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .floating-reem-wa {
        bottom: 1.25rem;
        left: 1.25rem;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .reem-toast-box {
        right: 1rem;
        left: 1rem;
        top: 1rem;
    }

    .reem-toast {
        width: 100%;
        font-size: 0.88rem;
        padding: 0.85rem 1.15rem;
    }
}

@media (max-width: 480px) {
    .btn-nav-cta {
        display: none;
    }

    .broker-name {
        font-size: 0.95rem;
    }

    .broker-fal {
        font-size: 0.72rem;
    }

    .nav-avatar {
        width: 38px;
        height: 38px;
    }
}
