/* CareNest website. Self-hosted, no third-party fonts or scripts. Works left-to-right and right-to-left. */

:root {
    --bg: #F4F7F7;
    --surface: #FFFFFF;
    --surface-2: #EDF3F2;
    --text: #10302D;
    --muted: #4F6361;
    --primary: #0E7C74;
    --primary-strong: #0B5F59;
    --primary-soft: #E2F3F1;
    --on-primary: #FFFFFF;
    --accent: #8A1538;
    --accent-soft: #F8E7EC;
    --border: #D3DFDE;
    --warn-bg: #FFF4D6;
    --warn-text: #5C4300;
    --ok-bg: #E1F5E9;
    --ok-text: #14532D;
    --bad-bg: #FDE7E7;
    --bad-text: #7A1212;
    --focus: #0A58CA;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(16, 48, 45, .06), 0 8px 24px rgba(16, 48, 45, .06);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0C1716;
        --surface: #13211F;
        --surface-2: #182A28;
        --text: #E4EFEE;
        --muted: #A3B8B5;
        --primary: #4FC4B8;
        --primary-strong: #7AD8CE;
        --primary-soft: #183330;
        --on-primary: #06201D;
        --accent: #F0839E;
        --accent-soft: #3A1823;
        --border: #264541;
        --warn-bg: #3D3000;
        --warn-text: #FFE08A;
        --ok-bg: #12351F;
        --ok-text: #A5E8BF;
        --bad-bg: #3F1616;
        --bad-text: #FFB4B4;
        --focus: #8AB4F8;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    font-size: 17px;
}

[lang="ar"] body { line-height: 1.9; }

img, svg { max-width: 100%; }
a { color: var(--primary-strong); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    inset-inline-start: 12px;
    top: -60px;
    z-index: 100;
    background: var(--primary);
    color: var(--on-primary);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding-inline: 16px; }

/* ---- header ---- */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .container { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 21px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-size: 24px; line-height: 1; }
.main-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-inline-start: auto; }
.main-nav a { padding: 8px 12px; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 500; font-size: 16px; }
.main-nav a:hover { background: var(--primary-soft); }
.main-nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-strong); font-weight: 700; }
.main-nav .lang-switch { border: 1px solid var(--border); font-weight: 600; }

/* ---- buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; min-height: 46px;
    border-radius: 999px; border: 2px solid var(--primary);
    background: var(--primary); color: var(--on-primary);
    font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn-secondary { background: transparent; color: var(--primary-strong); }
.btn-secondary:hover { background: var(--primary-soft); color: var(--primary-strong); }
.btn-danger { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger:hover { background: #6F0F2C; border-color: #6F0F2C; }
.btn-small { padding: 6px 14px; min-height: 36px; font-size: 15px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- hero ---- */
.hero { background: linear-gradient(160deg, var(--primary-soft), var(--bg) 70%); border-bottom: 1px solid var(--border); }
.hero .container { display: grid; gap: 32px; padding-block: 48px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .03em; margin: 0 0 8px; font-size: 15px; }
.hero h1 { font-size: clamp(32px, 6vw, 52px); line-height: 1.15; margin: 0 0 16px; }
.lead { font-size: 19px; color: var(--muted); margin: 0; max-width: 56ch; }
.hero-art { justify-self: center; width: min(280px, 70%); }
@media (min-width: 820px) { .hero .container { grid-template-columns: 1.2fr .8fr; padding-block: 72px; } }
.page-hero { padding-block: 40px 8px; }
.page-hero h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.2; margin: 0 0 10px; }

/* ---- sections ---- */
.section { padding-block: 44px; }
.section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.section h2 { font-size: clamp(24px, 4vw, 32px); line-height: 1.25; margin: 0 0 12px; }
.section-intro { color: var(--muted); max-width: 62ch; margin: 0 0 28px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin: 12px 0 6px; font-size: 19px; }
.card p { margin: 0; color: var(--muted); }
.card .icon { width: 30px; height: 30px; color: var(--primary); }
.card-accent .icon { color: var(--accent); }

.steps { counter-reset: step; display: grid; gap: 16px; padding: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 10px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
.steps h3 { margin: 0 0 6px; font-size: 18px; }
.steps p { margin: 0; color: var(--muted); }

/* ---- plans ---- */
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: stretch; }
.plan { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.plan.featured { border: 2px solid var(--primary); }
.plan h3 { margin: 0; font-size: 22px; }
.plan .price { font-size: 30px; font-weight: 700; margin: 8px 0 0; }
.plan .price small { font-size: 15px; font-weight: 500; color: var(--muted); }
.plan .trial { color: var(--accent); font-weight: 600; margin: 2px 0 14px; font-size: 15px; min-height: 1.6em; }
.plan .includes { font-size: 15px; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; }
.ticks .icon { width: 20px; height: 20px; margin-top: 4px; color: var(--primary); }

/* ---- notices, badges ---- */
.notice { border-radius: 12px; padding: 14px 18px; margin: 20px 0; border: 1px solid var(--border); background: var(--surface-2); }
.notice > :first-child { margin-top: 0; }
.notice > :last-child { margin-bottom: 0; }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.notice.ok { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.notice.bad { background: var(--bad-bg); color: var(--bad-text); border-color: transparent; }
.notice.warn a, .notice.ok a, .notice.bad a { color: inherit; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-strong); font-size: 14px; font-weight: 600; }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.badge.bad { background: var(--bad-bg); color: var(--bad-text); }
.badge.ok { background: var(--ok-bg); color: var(--ok-text); }
mark.unset { background: #FFE14D; color: #000; padding: 1px 6px; border-radius: 4px; font-weight: 700; outline: 2px dashed #B00020; }

/* ---- long text (legal pages) ---- */
.prose { max-width: 74ch; }
.prose h2 { font-size: 24px; line-height: 1.3; margin: 40px 0 10px; scroll-margin-top: 16px; }
.prose h3 { font-size: 19px; margin: 24px 0 6px; }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-inline-start: 24px; }
.prose li { margin: 4px 0; }
.legal-meta { color: var(--muted); margin: 0 0 18px; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 20px; margin: 18px 0 8px; max-width: 74ch; }
.toc strong { display: block; margin-bottom: 4px; }
.toc ol { margin: 0; padding-inline-start: 22px; columns: 2 260px; }
.toc li { margin: 2px 0; }
.related { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--border); max-width: 74ch; }
.related ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }

.table-wrap { overflow-x: auto; margin: 14px 0; }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; font-size: 15.5px; }
table.data th, table.data td { padding: 10px 14px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--border); }
table.data thead th { background: var(--surface-2); font-weight: 700; }
table.data tr:last-child td { border-bottom: 0; }
table.data code, .prose code, code.inline { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .92em; direction: ltr; unicode-bidi: isolate; }
.hash { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; word-break: break-all; direction: ltr; unicode-bidi: isolate; background: var(--surface-2); padding: 10px 12px; border-radius: 10px; display: block; font-size: 14px; }

/* ---- FAQ ---- */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq .answer { padding: 12px 18px 16px; }
.faq .answer > :first-child { margin-top: 0; }
.faq .answer > :last-child { margin-bottom: 0; }

/* ---- forms ---- */
.form { max-width: 460px; }
.form-wide { max-width: 760px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: 15px; margin-top: 4px; }
.field .error { color: var(--bad-text); background: var(--bad-bg); font-size: 15px; margin-top: 6px; padding: 4px 10px; border-radius: 8px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
    width: 100%; padding: 11px 14px; min-height: 46px;
    border: 2px solid var(--border); border-radius: 10px;
    background: var(--surface); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 3px solid var(--focus); outline-offset: 1px; }
textarea { min-height: 140px; resize: vertical; }
textarea.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; line-height: 1.5; min-height: 420px; direction: ltr; text-align: left; }
.check { display: flex; align-items: flex-start; gap: 10px; }
.check input { width: 22px; height: 22px; margin-top: 4px; accent-color: var(--primary); flex: none; }
.inline-form { display: inline; }

/* ---- footer ---- */
.site-footer { margin-top: 56px; border-top: 1px solid var(--border); background: var(--surface); padding-block: 36px 28px; font-size: 15.5px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-grid h2 { font-size: 16px; margin: 0 0 8px; color: var(--muted); font-weight: 700; letter-spacing: .02em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.footer-grid a { color: var(--text); }
.footer-note { margin: 28px 0 0; color: var(--muted); max-width: 80ch; }
.footer-copy { margin: 8px 0 0; color: var(--muted); }

/* ---- phone art ---- */
.phone-body { fill: var(--surface); stroke: var(--text); stroke-width: 3; }
.phone-card { fill: var(--primary-soft); }
.phone-line { fill: var(--border); }
.phone-dot { fill: var(--primary); }
.phone-dot-accent { fill: var(--accent); }

/* ---- account portal and admin ---- */
.portal-bar { background: var(--primary-strong); color: #fff; }
.portal-bar .container { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding-block: 10px; }
.portal-bar a, .portal-bar button.link { color: #fff; }
.portal-bar nav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-inline-start: auto; align-items: center; }
.portal-bar nav a { text-decoration: none; padding: 4px 6px; border-radius: 6px; }
.portal-bar nav a:hover, .portal-bar nav a[aria-current="page"] { background: rgba(255, 255, 255, .18); }
.admin-bar { background: #3A1823; }
.portal-main { padding-block: 28px 12px; }
.portal-main h1 { font-size: 28px; margin: 0 0 6px; }
button.link { background: none; border: 0; padding: 4px 6px; font: inherit; cursor: pointer; text-decoration: underline; color: var(--primary-strong); }
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 18px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 28px; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 15px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 14px 0; }
.toolbar .field { margin: 0; }
.pager { display: flex; gap: 10px; align-items: center; margin: 14px 0; }
.diff { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13.5px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; direction: ltr; text-align: left; }
.diff div { padding: 0 12px; white-space: pre-wrap; word-break: break-word; }
.diff .add { background: var(--ok-bg); color: var(--ok-text); }
.diff .del { background: var(--bad-bg); color: var(--bad-text); }
.flash { margin: 14px 0; }
.muted { color: var(--muted); }
.mt { margin-top: 24px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

[dir="rtl"] .icon-flip { transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
    .site-header, .site-footer, .skip-link, .related, .toc { display: none; }
    body { background: #fff; color: #000; font-size: 12pt; }
}

[lang="ar"] .plan .price { font-size: 24px; line-height: 1.5; }
.portal-bar .brand { color: #fff; font-size: 18px; }
.portal-bar .brand-mark { background: rgba(255, 255, 255, .2); color: #fff; }
