/* ─── موقع المخبر — هوية سمارت لاب ─────────────────────────── */
:root {
    --brand: #0097a7;
    --brand-dark: color-mix(in srgb, var(--brand) 82%, #000);
    --brand-soft: color-mix(in srgb, var(--brand) 9%, #fff);
    --navy: #31394d;
    --ink: #1f2533;
    --muted: #5f6b7d;
    --line: #e3e8ee;
    --bg: #ffffff;
    --bg-alt: #f5f8fa;
    --danger: #c0392b;
    --danger-soft: #fdecea;
    --ok: #1e8e5a;
    --ok-soft: #e7f6ee;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(31, 37, 51, .06), 0 8px 24px rgba(31, 37, 51, .06);
    --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.75;
    color: var(--ink);
    background: var(--bg);
}
img { max-width: 100%; height: auto; }
a { color: var(--brand-dark); }
h1, h2, h3 { color: var(--navy); line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.plain { list-style: none; margin: 0; padding: 0; }
.center { text-align: center; }

.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { inset-inline-start: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, #fff); outline-offset: 2px; }

/* ─── أزرار ─── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    min-height: 44px; padding: .55em 1.3em;
    border: 1.5px solid transparent; border-radius: 10px;
    font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { border-color: var(--line); color: var(--navy); background: #fff; }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--brand-soft); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--navy); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 34px; padding: .3em .9em; font-size: .9rem; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ─── الترويسة ─── */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); min-width: 0; }
.brand-logo { width: 46px; height: 46px; object-fit: contain; }
.brand-mark {
    flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--navy)); color: #fff; font-weight: 700; font-size: 1.35rem;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-text strong { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--muted); font-size: .78rem; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) { padding: .5em .8em; border-radius: 8px; color: var(--navy); text-decoration: none; font-weight: 500; }
.site-nav a:not(.btn):hover, .site-nav a.active { color: var(--brand-dark); background: var(--brand-soft); }
.nav-cta { margin-inline-start: 8px; }
.nav-toggle, .nav-burger { display: none; }

@media (max-width: 860px) {
    .nav-burger { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; flex: none; }
    .nav-burger span, .nav-burger span::before, .nav-burger span::after { content: ""; display: block; width: 22px; height: 2px; background: var(--navy); border-radius: 2px; position: relative; }
    .nav-burger span::before { position: absolute; top: -7px; }
    .nav-burger span::after { position: absolute; top: 7px; }
    .site-nav {
        display: none; position: absolute; inset-inline: 0; top: 100%;
        flex-direction: column; align-items: stretch; padding: 12px 16px 18px;
        background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    }
    .nav-toggle:checked ~ .site-nav { display: flex; }
    .nav-cta { margin: 8px 0 0; }
}

/* ─── أقسام ─── */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.eyebrow { display: inline-block; color: var(--brand-dark); font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.page-head { padding: 48px 0 32px; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.page-head p { color: var(--muted); max-width: 640px; margin: 0; }

.hero { position: relative; overflow: hidden; padding: 72px 0 80px; background:
    radial-gradient(900px 400px at 85% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    linear-gradient(180deg, var(--brand-soft), #fff); }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
.hero .lead { font-size: 1.12rem; color: var(--muted); max-width: 34em; }
.hero .actions { margin-top: 24px; }
.hero-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.hero-card h2 { font-size: 1.2rem; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } .hero { padding: 48px 0 56px; } }

.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; }
.steps li::before {
    content: counter(step); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand-dark); font-weight: 700;
}
.steps strong { display: block; color: var(--navy); }
.steps span { color: var(--muted); font-size: .93rem; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }
.service-card { border-top: 3px solid var(--brand); }
.service-card p { color: var(--muted); font-size: .95rem; }

.article-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.article-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.article-card h3 { color: var(--navy); }
.article-card p { color: var(--muted); font-size: .95rem; flex: 1; }
.meta { color: var(--muted); font-size: .85rem; }

.info-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.info-strip .card h3 { font-size: 1rem; color: var(--brand-dark); }

.cta-band { background: var(--navy); color: #fff; border-radius: 20px; padding: 36px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin: 0 0 .25em; }
.cta-band p { margin: 0; color: rgba(255,255,255,.8); }

/* ─── لماذا تختارنا ─── */
/* أربع بطاقات: صف واحد على الشاشات الواسعة، ثم 2×2، ثم عمود على الهاتف */
.why-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.why-card { border-top: 3px solid transparent; border-image: linear-gradient(90deg, var(--brand), var(--navy)) 1; }
.why-card h3 { margin-bottom: .4em; }
.why-card p { color: var(--muted); font-size: .95rem; margin: 0; }
.why-icon {
    display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px;
    border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark);
}
.why-icon svg { width: 24px; height: 24px; }

/* ─── الإشراف الطبي ─── */
.supervisor-card { display: flex; align-items: center; }
.supervisor-avatar {
    flex: none; display: grid; place-items: center; width: 72px; height: 72px; margin-inline-end: 20px;
    border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--navy)); color: #fff;
}
.supervisor-avatar svg { width: 36px; height: 36px; }
.supervisor-card h2 { font-size: 1.25rem; margin: 2px 0 .4em; }
.credentials { list-style: none; margin: 0; padding: 0; }
.credentials li { position: relative; padding-inline-start: 18px; color: var(--muted); font-size: .95rem; line-height: 1.9; }
.credentials li::before { content: ""; position: absolute; inset-inline-start: 0; top: .75em; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
@media (max-width: 560px) {
    .supervisor-card { flex-direction: column; text-align: center; }
    .supervisor-avatar { margin: 0 0 14px; }
    .credentials li { padding-inline-start: 0; }
    .credentials li::before { display: none; }
}
.footer-supervisor { color: #fff; font-weight: 500; }

/* ─── شريط الأجهزة ─── */
.section-sub { margin: 6px 0 0; color: var(--muted); max-width: 60ch; }
.devices { border-block: 1px solid var(--line); background: linear-gradient(180deg, var(--brand-soft), #fff); }
.device-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.device-card {
    margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.device-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(49, 57, 77, .12); }
.device-photo {
    display: grid; place-items: center; aspect-ratio: 4 / 3; background: #fff;
    border-block-end: 1px solid var(--line);
}
.device-photo img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
/* ريثما تُرفع الصورة: أيقونة بدل مربع فارغ */
.device-photo svg { width: 54px; height: 54px; color: var(--brand); opacity: .45; }
.device-card figcaption { padding: 14px 16px; }
.device-card strong { display: block; color: var(--navy); font-size: 1.02rem; }
.device-card span { display: block; margin-top: 4px; color: var(--muted); font-size: .88rem; line-height: 1.7; }

/* ─── اتصال سريع: زر الهاتف في الترويسة وواتساب العائم ─── */
.header-call { display: none; }
@media (max-width: 860px) {
    .header-call {
        display: grid; place-items: center; width: 42px; height: 42px; flex: none;
        margin-inline-start: auto; margin-inline-end: 6px;
        border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark);
    }
}
/* الهاتف الضيق: الاسم الإنكليزي يُخفى والعربي يصغر قليلاً كي لا يُقتطع */
@media (max-width: 480px) {
    .brand-text small { display: none; }
    .brand-text strong { font-size: .92rem; }
    .brand-mark, .brand-logo { width: 38px; height: 38px; }
    .brand { margin-inline-end: 4px; }
    .header-row { min-height: 62px; }
}
.wa-float {
    position: fixed; inset-block-end: 18px; inset-inline-start: 18px; z-index: 30;
    display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
    background: #25d366; color: #fff; box-shadow: 0 6px 18px rgba(37, 211, 102, .4);
    transition: transform .15s;
}
.wa-float:hover { transform: scale(1.06); }
.wa-float svg { width: 30px; height: 30px; }
@media print { .wa-float, .header-call { display: none; } }

/* ─── طمأنة المريض ─── */
.assurance {
    display: flex; align-items: center; justify-content: center;
    max-width: 480px; margin: 0 auto 18px; padding: 10px 16px;
    border-radius: 10px; background: var(--ok-soft); color: var(--ok);
    font-size: .92rem; font-weight: 500; text-align: center;
}
.assurance svg { flex: none; margin-inline-end: 8px; }

/* ─── أسئلة شائعة ─── */
.faq-item {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    margin-bottom: 10px; overflow: hidden;
}
.faq-item summary {
    cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--navy);
    list-style: none; position: relative; padding-inline-end: 44px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+"; position: absolute; inset-inline-end: 18px; top: 50%; transform: translateY(-50%);
    width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand-dark); font-size: 1.1rem; line-height: 1;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item summary:hover { color: var(--brand-dark); }
.faq-item p { margin: 0; padding: 0 20px 18px; color: var(--muted); line-height: 1.9; }

/* ─── اتصل بنا ─── */
.contact-actions { margin-top: 22px; }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1da851; }
.contact-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.contact-card { display: flex; align-items: flex-start; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.contact-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.contact-card h3 { font-size: 1rem; margin-bottom: .2em; }
.contact-card p { color: var(--muted); margin: 0 0 .2em; }
.contact-icon {
    flex: none; display: grid; place-items: center; width: 40px; height: 40px;
    margin-inline-end: 12px; border-radius: 10px;
    background: var(--brand-soft); color: var(--brand-dark);
}
.contact-icon--wa { background: #e7f9ee; color: #1da851; }
.contact-icon--sm { width: 30px; height: 30px; margin-inline-end: 8px; }
.map-wrap { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); }
.map-wrap iframe { display: block; width: 100%; height: 340px; border: 0; }

.hours-card h2 { display: flex; align-items: center; font-size: 1.1rem; }
.hours-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.hours-table th, .hours-table td { padding: 9px 4px; border-bottom: 1px solid var(--line); text-align: start; font-weight: 500; }
.hours-table th { color: var(--muted); white-space: nowrap; }
.hours-table td { color: var(--navy); text-align: end; }
.hours-table tr:last-child th, .hours-table tr:last-child td { border-bottom: 0; }
.hours-table .is-today th, .hours-table .is-today td { color: var(--brand-dark); font-weight: 700; }
.today-tag { display: inline-block; margin-inline-start: 6px; padding: 0 .5em; border-radius: 999px; background: var(--brand); color: #fff; font-size: .7rem; font-weight: 600; vertical-align: middle; }
.hours-table .closed { color: var(--muted); font-weight: 500; }

/* ─── المقال ─── */
.prose { font-size: 1.06rem; }
.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose li { margin-bottom: .35em; }
.prose blockquote { margin: 1.5em 0; padding: 14px 18px; background: var(--brand-soft); border-inline-start: 4px solid var(--brand); border-radius: 8px; }
.prose blockquote p { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .97rem; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 12px; border: 1px solid var(--line); text-align: start; }
.prose th { background: var(--bg-alt); color: var(--navy); }
.prose code { background: var(--bg-alt); padding: .1em .35em; border-radius: 4px; }
.disclaimer { margin-top: 32px; padding: 14px 18px; border-radius: 10px; background: var(--bg-alt); color: var(--muted); font-size: .9rem; }

/* ─── النماذج ─── */
.form-card { max-width: 480px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.field .hint { display: block; color: var(--muted); font-size: .86rem; margin-top: 5px; }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number],
.field input[type=url], .field input[type=file], .field textarea, .field select {
    width: 100%; min-height: 46px; padding: .55em .85em;
    border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
    font: 1rem/1.5 var(--font); color: var(--ink);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.code-input { letter-spacing: .18em; font-weight: 600; text-transform: uppercase; text-align: center; font-size: 1.15rem !important; }
.is-invalid { border-color: var(--danger) !important; }
.error { color: var(--danger); font-size: .9rem; margin-top: 6px; }
.check { display: flex; align-items: center; gap: 8px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: .95rem; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-info { background: var(--brand-soft); color: var(--navy); }

.lock-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; color: var(--muted); font-size: .86rem; }
.lock-note svg { flex: none; margin-top: 3px; color: var(--brand); }

/* ─── صفحة النتيجة ─── */
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.result-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.result-meta div { background: var(--bg-alt); border-radius: 10px; padding: 12px 14px; }
.result-meta dt { color: var(--muted); font-size: .82rem; }
.result-meta dd { margin: 0; font-weight: 600; color: var(--navy); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: .2em .8em; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-muted { background: var(--bg-alt); color: var(--muted); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.pdf-frame { width: 100%; height: 78vh; min-height: 520px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-alt); }
@media (max-width: 760px) { .pdf-frame { display: none; } }
.mobile-only { display: none; }
@media (max-width: 760px) {
    .mobile-only { display: block; }
    /* الهاتف: الأزرار العلوية تُخفى لصالح الزرين الكبيرين، والبيانات في عمود واحد */
    .result-head .actions { display: none; }
    .result-meta { grid-template-columns: 1fr 1fr; }
    .report-mobile { display: grid; gap: 10px; padding: 18px 0 4px; text-align: center; }
    .report-mobile .btn { min-height: 52px; font-size: 1.05rem; }
    .report-mobile p { margin: 4px 0 0; font-size: .9rem; }
}

/* ─── التذييل ─── */
.site-footer { background: var(--navy); color: rgba(255,255,255,.78); margin-top: 0; padding-top: 48px; font-size: .95rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; padding-bottom: 36px; }
.footer-title { color: #fff; font-size: 1.05rem; margin-bottom: .6em; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 18px; padding-bottom: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; }
.powered strong { color: #7fd6df; }

/* ─── ترقيم الصفحات ─── */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; color: var(--navy); }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .disabled { color: var(--line); }
