/* =====================================================================
   HaqMeher — visual identity
   Palette: deep emerald (mithaq/covenant) + antique gold (mahr/dower)
   on a warm parchment ground. Display face Amiri (Naskh-inspired,
   dual Arabic/Latin) for headings; Inter for body; IBM Plex Mono for
   meta/data (ages, dates, plan prices).
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

/* Future-language font imports — uncomment the ones actually needed once
   real translated content exists for that language. Left out by default
   so English-only visitors (100% of traffic today) don't pay the load
   cost for scripts nobody is using yet. All from Google's Noto family,
   chosen specifically for full Devanagari/Urdu/Bengali/Malayalam/Telugu
   coverage with a consistent design language across scripts.
   Hindi:      @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;600;700&display=swap');
   Urdu:       @import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu:wght@400;600;700&display=swap');
   Bengali:    @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;600;700&display=swap');
   Malayalam:  @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Malayalam:wght@400;600;700&display=swap');
   Telugu:     @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Telugu:wght@400;600;700&display=swap'); */

:root {
    --ink:        #1C2B27;
    --emerald:    #0F4C3A;
    --emerald-dk: #0A362A;
    --gold:       #B8873D;
    --gold-lt:    #E4C583;
    --sage:       #6B8F87;
    --paper:      #FBF7EF;
    --paper-dim:  #F2EBDB;
    --white:      #FFFFFF;
    --error:      #A8563E;
    --line:       rgba(28,43,39,0.12);

    --font-display: 'Amiri', 'Georgia', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    /* Reserved for future translated pages - safe to reference now, the
       fallback (system UI fonts) renders fine until the imports above
       are uncommented for a given language. */
    --font-hindi: 'Noto Sans Devanagari', 'Inter', sans-serif;
    --font-urdu: 'Noto Nastaliq Urdu', 'Amiri', serif;
    --font-bengali: 'Noto Sans Bengali', 'Inter', sans-serif;
    --font-malayalam: 'Noto Sans Malayalam', 'Inter', sans-serif;
    --font-telugu: 'Noto Sans Telugu', 'Inter', sans-serif;

    --radius: 4px;
    --shadow-card: 0 2px 14px rgba(15,76,58,0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--emerald-dk);
    line-height: 1.2;
    margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1em; }

a { color: var(--emerald); text-decoration: none; }
a:hover { color: var(--gold); }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    display: block;
    margin-bottom: 0.6em;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------------- Arch motif — the site's signature element ----------
   Every card / photo frame / section divider borrows the mihrab arch
   silhouette: a semicircular crown over a rectangular body. This ties
   the "covenant" theme visually through the whole site. ---------------- */
.arch-frame {
    position: relative;
    border-radius: 120px 120px var(--radius) var(--radius);
    border: 1px solid var(--line);
    background: var(--white);
    overflow: hidden;
}

.arch-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 48px 0;
    color: var(--gold);
}
.arch-divider svg { width: 56px; height: 28px; }
.arch-divider::before, .arch-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
    align-self: center;
}
.arch-divider svg { margin: 0 18px; }

/* ---------------- Header / nav ---------------- */
.site-header {
    background: var(--emerald-dk);
    border-bottom: 3px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    max-width: 1140px;
    margin: 0 auto;
}
.logo {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--paper);
    display: flex;
    align-items: baseline;
    gap: 0;
}
.logo span { color: var(--gold-lt); }
.logo-mark { width: 30px; height: 30px; align-self: center; flex-shrink: 0; margin-right: 8px; }
.nav-links { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.nav-links a { color: var(--paper); font-weight: 500; font-size: 0.94rem; }
.nav-links a:hover { color: var(--gold-lt); }
.nav-toggle { display: none; }

.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 11px 22px;
    border-radius: var(--radius);
    border: 1.5px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--emerald-dk); }
.btn-gold:hover { background: var(--gold-lt); color: var(--emerald-dk); }
.btn-outline { background: transparent; border-color: var(--gold); color: var(--gold-lt); }
.btn-outline:hover { background: var(--gold); color: var(--emerald-dk); }
.btn-emerald { background: var(--emerald); color: var(--paper); }
.btn-emerald:hover { background: var(--emerald-dk); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-danger { background: var(--error); color: var(--white); }
.btn-danger:hover { opacity: 0.88; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------------- Hero ---------------- */
.hero {
    background: linear-gradient(180deg, var(--emerald-dk) 0%, var(--emerald) 100%);
    color: var(--paper);
    padding: 90px 0 70px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 15% 30%, rgba(184,135,61,0.10) 0, transparent 45%),
                       radial-gradient(circle at 85% 70%, rgba(184,135,61,0.08) 0, transparent 40%);
}
.hero-inner { position: relative; z-index: 1; max-width: 680px; }
.hero h1 { color: var(--paper); }
.hero .lede { font-size: 1.15rem; color: var(--gold-lt); max-width: 560px; }
.hero-cta { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-quote {
    margin-top: 46px;
    padding-left: 20px;
    border-left: 2px solid var(--gold);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--gold-lt);
    max-width: 560px;
}

/* ---------------- Sections ---------------- */
.section { padding: 72px 0; }
.section-alt { background: var(--paper-dim); }
.section-head { max-width: 640px; margin-bottom: 42px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }

.feature-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow-card);
}
.feature-card .num {
    font-family: var(--font-mono);
    color: var(--gold);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}
.feature-card h3 { margin-top: 10px; }
.feature-card p { color: #445048; font-size: 0.95rem; margin-bottom: 0; }

/* ---------------- Steps (how it works) ---------------- */
.steps { counter-reset: step; }
.step {
    display: flex;
    gap: 20px;
    padding: 22px 0;
    border-top: 1px solid var(--line);
}
.step:first-child { border-top: none; }
.step-num {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--gold);
    min-width: 46px;
}
.step h4 { margin-bottom: 4px; color: var(--emerald-dk); }
.step p { color: #445048; margin-bottom: 0; font-size: 0.95rem; }

/* ---------------- Forms ---------------- */
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 34px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 18px; }
.form-group.full { grid-column: 1 / -1; }
label {
    display: block;
    font-weight: 600;
    font-size: 0.86rem;
    margin-bottom: 6px;
    color: var(--emerald-dk);
}
label .req { color: var(--error); }
.hint { font-size: 0.78rem; color: #7A8580; margin-top: 4px; }

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=tel],
select, textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--paper);
    color: var(--ink);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--white);
}
textarea { resize: vertical; min-height: 96px; }

fieldset { border: none; padding: 0; margin: 0 0 30px; }
legend {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--emerald-dk);
    padding: 0 0 10px;
    border-bottom: 2px solid var(--gold-lt);
    width: 100%;
    margin-bottom: 20px;
}

.radio-row, .checkbox-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.radio-row label, .checkbox-row label { margin: 0; font-weight: 500; }

/* ---------------- Progress steps for multi-step form ---------------- */
.progress-track { display: flex; margin-bottom: 40px; }
.progress-step {
    flex: 1;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #9AA6A0;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--line);
    letter-spacing: 0.05em;
}
.progress-step.active { color: var(--emerald-dk); border-color: var(--gold); font-weight: 600; }
.progress-step.done { color: var(--emerald); border-color: var(--sage); }

/* ---------------- Alerts ---------------- */
.alert {
    padding: 13px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.92rem;
    border: 1px solid transparent;
}
.alert-error { background: #FBEAE4; border-color: #E9C3B3; color: var(--error); }
.alert-success { background: #E9F2ED; border-color: #BFDBCB; color: var(--emerald-dk); }
.alert-info { background: #F1EFE3; border-color: var(--gold-lt); color: #6B5324; }

/* ---------------- Profile cards (browse grid) ---------------- */
.profile-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 90px 90px var(--radius) var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.profile-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(15,76,58,0.14); }
.profile-photo-wrap {
    aspect-ratio: 1 / 1;
    background: var(--paper-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.profile-photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-wrap.blurred img { filter: blur(14px) brightness(0.9); }
.photo-placeholder {
    font-family: var(--font-display);
    font-size: 2.4rem;
    color: var(--sage);
}
.lock-badge {
    position: absolute;
    bottom: 10px; right: 10px;
    background: rgba(15,76,58,0.85);
    color: var(--gold-lt);
    font-size: 0.7rem;
    padding: 4px 9px;
    border-radius: 12px;
    font-family: var(--font-mono);
}
.profile-body { padding: 16px 20px 20px; text-align: center; }
.profile-body h4 { margin-bottom: 2px; }
.profile-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--sage); margin-bottom: 10px; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; }
.tag {
    font-size: 0.72rem;
    background: var(--paper-dim);
    color: var(--emerald-dk);
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid var(--line);
}

/* ---------------- Filters sidebar ---------------- */
.browse-layout { display: grid; grid-template-columns: 260px 1fr; gap: 30px; align-items: start; }
.filter-card { position: sticky; top: 90px; }
.filter-card h3 { font-size: 1.05rem; }

/* ---------------- Pricing ---------------- */
.pricing-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 26px;
    text-align: center;
    position: relative;
}
.pricing-card.featured { border: 2px solid var(--gold); box-shadow: 0 8px 30px rgba(184,135,61,0.18); }
.pricing-badge {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    background: var(--gold); color: var(--emerald-dk);
    font-family: var(--font-mono); font-size: 0.7rem; padding: 4px 14px; border-radius: 12px;
}
.price { font-family: var(--font-display); font-size: 2.4rem; color: var(--emerald-dk); margin: 14px 0 4px; }
.price span { font-size: 0.95rem; font-family: var(--font-mono); color: var(--sage); }
.plan-features { list-style: none; padding: 0; margin: 20px 0; text-align: left; font-size: 0.9rem; }
.plan-features li { padding: 7px 0; border-top: 1px solid var(--line); }
.plan-features li:first-child { border-top: none; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--emerald-dk); color: var(--gold-lt); padding: 50px 0 26px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 34px; }

/* ---------------- Browse Profiles By directory (SEO internal linking) ---------------- */
.directory-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 26px; }
.directory-grid h4 { font-size: 0.9rem; color: var(--emerald-dk); margin-bottom: 10px; }
.directory-grid .footer-links a { color: #445048; }
.directory-grid .footer-links a:hover { color: var(--gold); }
.directory-grid .footer-links li { margin-bottom: 6px; font-size: 0.85rem; }
.site-footer h4 { color: var(--paper); font-size: 0.95rem; margin-bottom: 14px; }
.site-footer a { color: var(--gold-lt); font-size: 0.88rem; }
.site-footer a:hover { color: var(--paper); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-bottom {
    border-top: 1px solid rgba(228,197,131,0.2);
    padding-top: 20px;
    font-size: 0.8rem;
    color: rgba(228,197,131,0.7);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------------- Dashboard ---------------- */
.dash-layout { display: grid; grid-template-columns: 230px 1fr; gap: 30px; align-items: start; }
.dash-nav { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: sticky; top: 90px; }
.dash-nav a { display: block; padding: 13px 18px; color: var(--ink); font-size: 0.92rem; border-bottom: 1px solid var(--line); }
.dash-nav a:last-child { border-bottom: none; }
.dash-nav a:hover, .dash-nav a.active { background: var(--paper-dim); color: var(--emerald-dk); font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 30px; }
.stat-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-box .n { font-family: var(--font-display); font-size: 1.8rem; color: var(--emerald-dk); }
.stat-box .l { font-size: 0.78rem; color: var(--sage); font-family: var(--font-mono); }

table.list-table { width: 100%; border-collapse: collapse; background: var(--white); }
table.list-table th, table.list-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.9rem; }
table.list-table th { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sage); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.72rem; font-weight: 600; }
.badge-pending { background: #F1EFE3; color: #6B5324; }
.badge-accepted { background: #E9F2ED; color: var(--emerald-dk); }
.badge-declined { background: #FBEAE4; color: var(--error); }

/* ---------------- View profile page ---------------- */
.profile-header { display: grid; grid-template-columns: 240px 1fr; gap: 30px; margin-bottom: 30px; }
.profile-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 30px; }
.detail-row { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.detail-row .k { color: var(--sage); font-size: 0.85rem; }
.detail-row .v { font-weight: 600; text-align: right; }

/* ---------------- Islamic guidance callout ---------------- */
.guidance-box {
    background: var(--paper-dim);
    border-left: 4px solid var(--gold);
    padding: 20px 24px;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.92rem;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .browse-layout, .dash-layout { grid-template-columns: 1fr; }
    .filter-card, .dash-nav { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .directory-grid { grid-template-columns: 1fr 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .profile-header { grid-template-columns: 1fr; }
    .profile-detail-grid { grid-template-columns: 1fr; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--emerald-dk);
        flex-direction: column;
        padding: 18px 24px;
        border-top: 1px solid rgba(228,197,131,0.2);
    }
    .nav-links.open { display: flex; }
    .nav-toggle {
        display: block;
        background: none; border: none;
        color: var(--paper);
        font-size: 1.5rem;
        cursor: pointer;
    }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* ---------------- Language switcher ---------------- */
.lang-switcher { position: relative; }
.lang-switcher-toggle {
    background: none;
    border: 1px solid rgba(228,197,131,0.4);
    color: var(--gold-lt);
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: var(--radius);
    cursor: pointer;
}
.lang-switcher-toggle:hover { border-color: var(--gold); }
.lang-switcher-menu {
    display: none;
    position: absolute;
    top: 100%; right: 0;
    margin-top: 6px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    min-width: 220px;
    z-index: 200;
    overflow: hidden;
}
.lang-switcher-menu.open { display: block; }
.lang-option {
    display: block;
    padding: 10px 16px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--line);
}
.lang-option:last-child { border-bottom: none; }
.lang-option-active { color: var(--emerald-dk); font-weight: 600; background: var(--paper-dim); }
.lang-option-soon { color: #9AA6A0; cursor: default; }
@media (max-width: 860px) {
    .lang-switcher { margin-top: 12px; }
    .lang-switcher-menu { position: static; margin-top: 8px; box-shadow: none; border: 1px solid var(--line); }
}

/* ---------------- RTL scaffolding (for Urdu, once live) ----------------
   Applies automatically wherever <html dir="rtl"> is set - see
   includes/header.php, which sets this from SUPPORTED_LANGUAGES. No page
   currently sets dir="rtl" since Urdu isn't active yet, so none of this
   affects the live English site - it's here so turning Urdu on later is
   a content task, not a fresh layout-engineering task. */
[dir="rtl"] body { direction: rtl; }
[dir="rtl"] .nav-wrap { flex-direction: row-reverse; }
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .hero-quote { border-left: none; border-right: 2px solid var(--gold); padding-left: 0; padding-right: 20px; }
[dir="rtl"] .detail-row { flex-direction: row-reverse; }
[dir="rtl"] .step { flex-direction: row-reverse; }
[dir="rtl"] .arch-frame { border-radius: var(--radius) var(--radius) 120px 120px; }
[dir="rtl"] .lang-switcher-menu { right: auto; left: 0; }
[dir="rtl"] .form-group label .req { margin-right: 4px; margin-left: 0; }
