:root {
    --primary: #1FA6A0;
    --primary-dark: #176F7A;
    --secondary: #D6247E;
    --purple: #4B3F8F;
    --orange: #F5821F;
    --ink: #2b2540;
    --muted: #665f7d;
    --bg: #ffffff;
    --bg-soft: #f6f5fb;
    --border: #e7e3f2;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(75, 63, 143, .10);
    --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; max-width: 100%; overflow-x: hidden; }
input[type="tel"] { direction: rtl; text-align: right; }
body {
    margin: 0;
    max-width: 100%;
    overflow-x: hidden;
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.8;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0 0 .6em; font-weight: 700; }
p { margin: 0 0 1em; color: var(--muted); }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.section { padding: 64px 0; }
.section-alt { background: var(--bg-soft); }

.section-head { text-align: center; max-width: 760px; margin: 0 auto 40px; }
.section-head h2 { font-size: 28px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 999px;
    font-weight: 700;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    font-family: inherit;
    font-size: 15px;
    white-space: nowrap;
}
.btn-primary { background: var(--secondary); color: #fff; }
.btn-primary:hover { background: #b81c69; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(214,36,126,.35); }
.btn-dark { background: var(--primary); color: #fff; }
.btn-dark:hover { background: var(--primary-dark); }
.btn-block { width: 100%; justify-content: center; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 20px; }
.logo {
    display: flex; align-items: center; white-space: nowrap;
}
.logo-img { height: 64px; width: auto; display: block; }
.main-nav ul { display: flex; gap: 26px; }
.main-nav a { font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--primary); border-color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
    display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); display: block; }

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    min-height: 760px;
    display: flex;
    align-items: center;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, var(--purple), var(--primary));
}
.hero-slider { position: absolute; inset: 0; z-index: 0; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.hero-slide.active { opacity: 1; }
.hero-slide-bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center 30%; background-repeat: no-repeat;
}
/* Desktop never uses this layer - .hero-slide-bg above already covers the whole
   box without much crop, so the sharp foreground stays hidden. */
.hero-slide-fg { display: none; }
/* Dedicated mobile slider - only rendered when the admin uploaded mobile-specific
   images (already cropped to a phone-friendly ratio), so it just needs a plain
   cover fill, no blur trick. Hidden by default; the @media block below swaps it in. */
.hero-slider-m { display: none; position: absolute; inset: 0; z-index: 0; }
.hero-slide-m {
    position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease;
    background-size: cover; background-position: center; background-repeat: no-repeat;
}
.hero-slide-m.active { opacity: 1; }
.hero-slider-overlay {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(135deg, rgba(75,63,143,.55), rgba(31,166,160,.32));
}
.hero-content { position: relative; z-index: 2; width: 100%; padding: 90px 0 70px; }
.hero h1 { font-size: 38px; line-height: 1.35; max-width: 820px; margin: 0 auto .4em; color: #fff; }
.hero-subtitle { font-size: 18px; opacity: .92; margin-bottom: 34px; color: #fff; }
.hero-form {
    background: rgba(255,255,255,.16);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 18px; padding: 26px; max-width: 640px;
    margin: 0 auto; box-shadow: var(--shadow); text-align: right;
}
.hero-form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.hero-form input {
    width: 100%; padding: 12px 14px; border: 1px solid rgba(255,255,255,.4); border-radius: 10px;
    font-family: inherit; font-size: 15px; background: rgba(255,255,255,.92); color: var(--ink); margin-bottom: 12px;
}
.hero-form input::placeholder { color: var(--muted); }
.hero-form-row input { margin-bottom: 0; }
.hero-form input:focus { outline: 2px solid #fff; background: #fff; }
.hero-form .btn { margin-top: 4px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 600; text-align: right; }
.alert-success { background: #e4f7ee; color: #157a4a; }
.alert-error { background: #fdeceb; color: #b23127; }

/* Stats */
.stats-bar { background: #fff; border-bottom: 1px solid var(--border); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 40px 0; text-align: center; }
.stats-grid > * { min-width: 0; }
.stat-icon { color: var(--primary); margin-bottom: 10px; display: flex; justify-content: center; }
.stat-icon svg { width: 26px; height: 26px; }
.stat-number { font-size: 34px; font-weight: 900; color: var(--primary-dark); }
.stat-label { color: var(--muted); font-size: 14.5px; }

/* Icon box grids */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.grid-4 > *, .grid-5 > * { min-width: 0; }
.icon-box {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 26px 18px; text-align: center; box-shadow: var(--shadow);
    transition: transform .2s ease;
}
.icon-box:hover { transform: translateY(-6px); }
.icon-circle {
    width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px;
    background: var(--bg-soft); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.icon-box-title { font-size: 16.5px; color: var(--ink); margin-bottom: 6px; }
.icon-box p { margin: 0; font-size: 14px; }

/* Read-more / clamp for long text in cards */
.clamp-text {
    display: -webkit-box;
    -webkit-line-clamp: var(--clamp-lines, 3);
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.clamp-text.expanded {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}
.read-more-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 0;
    background: none;
    border: none;
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.read-more-btn:hover { text-decoration: underline; }

/* Specialties: desktop keeps the original 3-cards-side-by-side layout (all visible).
   Mobile only (see @media 900px below) switches to tabs so the 3 stay side by side there too. */
.specialty-tabs { display: none; }
.specialty-panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.specialty-panels > * { min-width: 0; }
.specialty-panel {
    display: block;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 26px 22px; text-align: center; box-shadow: var(--shadow);
}
.specialty-panel-icon { margin: 0 auto 14px; }
.specialty-list { text-align: center; margin-top: 16px; }
.specialty-list li { padding: 14px 0; border-top: 1px solid var(--border); }
.specialty-list li:first-child { border-top: none; }
.specialty-list h4 { margin: 0 0 4px; font-size: 15px; color: var(--primary-dark); }
.specialty-list p { margin: 0; font-size: 13.5px; }

.specialty-tab {
    position: relative;
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: #fff; border: 1.5px solid var(--border); border-radius: 14px;
    padding: 14px 8px 18px; text-align: center; cursor: pointer; font-family: inherit;
    transition: border-color .15s ease, background .15s ease;
}
.specialty-tab-icon { color: var(--primary); display: flex; }
.specialty-tab-icon svg { width: 24px; height: 24px; }
.specialty-tab-title { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.specialty-tab.active { border-color: var(--primary); background: var(--bg-soft); }
.specialty-tab.active .specialty-tab-title { color: var(--primary-dark); }
/* small connector arrow linking the selected tab to the panel below it */
.specialty-tab.active::after {
    content: ''; position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%);
    width: 14px; height: 14px; background: var(--bg-soft); border-left: 1.5px solid var(--primary); border-bottom: 1.5px solid var(--primary);
    border-radius: 0 0 0 3px; transform: translateX(-50%) rotate(-45deg);
}

/* nudges the visitor toward tapping a specialty on first view */
.specialty-tabs-hint {
    display: none;
    text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 16px;
    animation: specialty-hint-pulse 1.8s ease-in-out 2;
}
@keyframes specialty-hint-pulse {
    0%, 100% { opacity: .7; }
    50% { opacity: 1; }
}

@media (max-width: 900px) {
    .specialty-tabs { display: flex; gap: 10px; margin-bottom: 10px; }
    .specialty-tabs-hint { display: block; }
    .specialty-panels { display: block; }
    .specialty-panel { display: none; padding: 10px 22px; }
    .specialty-panel.active { display: block; }
}

/* Team */
.team-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; text-align: center; box-shadow: var(--shadow);
    transition: transform .2s ease;
}
.team-card:hover { transform: translateY(-6px); }
.team-photo {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
    border-radius: 999px; margin: 0 auto 14px; max-width: 160px;
}
.team-title { color: var(--secondary); font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.team-bio p { margin: 0 0 .5em; font-size: 14px; color: var(--muted); }
.team-bio p:last-child { margin-bottom: 0; }

/* About + testimonials */
.about-testimonials-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; }
.about-testimonials-grid > div { min-width: 0; }
.about-testimonials-grid h2 { font-size: 24px; }
.why-us-box {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 26px 24px; box-shadow: var(--shadow); margin-bottom: 30px;
}
.why-us-title { font-size: 19px; color: var(--primary-dark); margin: 0 0 6px; }
.why-us-list li {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 16px 0; border-top: 1px solid var(--border);
}
.why-us-list li:first-child { border-top: none; }
.why-us-icon {
    flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
    background: var(--bg-soft); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
}
.why-us-text { display: flex; flex-direction: column; gap: 3px; }
.why-us-text strong { color: var(--ink); font-size: 15.5px; }
.why-us-text span { color: var(--muted); font-size: 13.5px; line-height: 1.7; }

/* Scroll row (testimonials) */
.scroll-row {
    display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px;
}
.scroll-row::-webkit-scrollbar { height: 8px; }
.scroll-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.testimonial-card {
    scroll-snap-align: start;
    flex: 0 0 300px;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; box-shadow: var(--shadow);
}
.stars { color: var(--orange); font-size: 15px; margin-bottom: 10px; letter-spacing: 2px; }
.testimonial-card h4 { margin: 12px 0 0; font-size: 15px; color: var(--primary-dark); }
.testimonial-text p { margin: 0 0 .5em; font-size: 14px; color: var(--muted); }
.testimonial-text p:last-child { margin-bottom: 0; }

/* Process steps */
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.steps-grid > * { min-width: 0; }
.step-card {
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; text-align: center;
}
.step-icon { color: var(--primary); margin-bottom: 10px; display: flex; justify-content: center; }
.step-card h3 { font-size: 17px; color: var(--primary-dark); }
.step-card p { font-size: 14px; margin: 0; }

/* Footer */
.site-footer { background: var(--purple); color: #e3dff5; padding: 56px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.2fr; gap: 36px; padding-bottom: 40px; }
.footer-grid > * { min-width: 0; }
.footer-col h3 { color: #fff; font-size: 16px; }
.footer-col p { color: #e3dff5; }
.footer-links li, .footer-contacts li { margin-bottom: 10px; }
.footer-links a:hover { text-decoration: underline; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.footer-social a {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; background: rgba(255,255,255,.12); border-radius: 50%;
    color: #fff; transition: background .15s ease, transform .15s ease;
}
.footer-social a:hover { background: rgba(255,255,255,.25); transform: translateY(-2px); }
.footer-social a svg { width: 18px; height: 18px; }
.footer-contacts a { text-decoration: underline; text-decoration-color: rgba(255,255,255,.35); }
.footer-map { margin-top: 14px; border-radius: 12px; overflow: hidden; }
.footer-map iframe { width: 100%; height: 160px; border: 0; display: block; filter: grayscale(.2) contrast(1.05); }
.hp-field { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }
.footer-mini-form input, .footer-mini-form select {
    width: 100%; padding: 10px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px;
    font-family: inherit; font-size: 14px; background: rgba(255,255,255,.08); color: #fff; margin-bottom: 10px;
}
.footer-mini-form input::placeholder { color: rgba(255,255,255,.6); }
.footer-mini-form select { cursor: pointer; }
.footer-mini-form select option { color: var(--ink); }
.footer-privacy { border-top: 1px solid rgba(255,255,255,.15); padding: 18px 0; font-size: 12.5px; opacity: .85; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); padding: 18px 0; text-align: center; font-size: 13.5px; }

/* WhatsApp float button */
.wa-float {
    position: fixed; bottom: 22px; left: 22px; z-index: 200;
    width: 56px; height: 56px; border-radius: 50%; background: #25D366; color: #fff;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.25);
    border: none; padding: 0; cursor: pointer; font-family: inherit;
}

/* Contact popup (header CTA opens this instead of linking straight to WhatsApp) */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 300;
    background: rgba(20,15,40,.55); align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    position: relative; width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto;
    background: var(--purple); color: #fff; border-radius: 18px; padding: 30px 26px;
    box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.modal-box h3 { color: #fff; margin: 0 0 6px; font-size: 19px; }
.modal-hint { color: rgba(255,255,255,.75); font-size: 13px; margin: 0 0 18px; }
.modal-close {
    position: absolute; top: 14px; left: 14px; width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 20px; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: inherit;
}
.modal-close:hover { background: rgba(255,255,255,.28); }

/* Responsive */
@media (max-width: 1000px) {
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .about-testimonials-grid { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { gap: 10px; padding: 28px 0; }
    .stat-number { font-size: 22px; }
    .stat-label { font-size: 11.5px; line-height: 1.3; }
    .stat-icon svg { width: 20px; height: 20px; }
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-form-row { flex-direction: column; }
    .hero { min-height: 480px; }
    /* This landscape photo doesn't match a narrow phone box: "cover" alone would zoom
       in and crop most of its width away, "contain" alone leaves empty bars. So the
       background layer is blurred + scaled up to fill edge-to-edge with no crop-free
       zone left visible, and the full uncropped photo sits sharp on top of it as a
       separate sibling layer - filter on .hero-slide-bg must not reach .hero-slide-fg,
       which it would if the sharp layer were nested inside the blurred one. */
    .hero-slide-bg { background-position: center center; filter: blur(18px); transform: scale(1.15); }
    .hero-slide-fg {
        display: block; position: absolute; inset: 0;
        background-size: contain; background-position: center; background-repeat: no-repeat;
    }
    /* If the admin uploaded dedicated mobile images, they replace the blur trick above
       entirely - they're already cropped correctly, so a plain cover fill is enough. */
    .hero-slider.has-mobile-override { display: none; }
    .hero-slider-m { display: block; }
}
@media (max-width: 960px) {
    .main-nav { position: fixed; inset: 68px 0 auto 0; background: #fff; padding: 16px 20px; box-shadow: 0 12px 20px rgba(0,0,0,.08); transform: translateY(-130%); transition: transform .25s ease; z-index: 99; }
    .main-nav.open { transform: translateY(0); }
    .main-nav ul { flex-direction: column; gap: 4px; }
    .main-nav a { display: block; padding: 10px 0; color: var(--ink); }
    .nav-toggle { display: flex; }
    .logo-img { height: 54px; }
    .header-inner { gap: 10px; }
    .header-actions { gap: 8px; }
    .header-actions .btn { padding: 9px 14px; font-size: 12.5px; }
}
@media (max-width: 380px) {
    .logo-img { height: 32px; }
    .header-actions .btn { padding: 8px 10px; font-size: 11.5px; }
}
@media (max-width: 720px) {
    .hero h1 { font-size: 27px; }
    .hero-content { padding: 60px 0 40px; }
    .hero-subtitle { font-size: 15px; margin-bottom: 24px; }
    .grid-5 { grid-template-columns: 1fr 1fr; }
    .steps-grid { gap: 14px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .site-footer { padding-top: 36px; }
    .footer-map iframe { height: 120px; }
    .footer-social { gap: 8px; }
    .footer-social a { width: 32px; height: 32px; }
    .section { padding: 44px 0; }
    .section-head { margin-bottom: 26px; }
    .section-head h2 { font-size: 22px; }
    .grid-4, .grid-5 { gap: 14px; }
    .icon-box { padding: 18px 12px; }
    .icon-circle { width: 46px; height: 46px; }
    .team-card { padding: 12px; }
    .specialty-tabs { gap: 6px; }
    .specialty-tab { padding: 10px 4px; border-radius: 12px; }
    .specialty-tab-icon svg { width: 20px; height: 20px; }
    .specialty-tab-title { font-size: 11.5px; }
    .specialty-panel { padding: 8px 16px; }
    .why-us-box { padding: 18px 16px; }
    .step-card { padding: 18px; }
    .testimonial-card { padding: 16px; }
}

@media (max-width: 480px) {
    .hero { min-height: 400px; }
    .hero h1 { font-size: 22px; }
    .hero-content { padding: 44px 0 30px; }
    .hero-form { padding: 16px; border-radius: 14px; }
}
