/* Dr Virtual Care — shared styles (plain CSS, no build step) */

:root {
  --bg: #f6f5f1;
  --card: #fffefb;
  --ink: #10241f;
  --muted: #5b6b66;
  --border: #dbe0dc;
  --primary: #0e6e42;
  --primary-ink: #073821;
  --primary-fg: #f7fdf9;
  --accent: #e8623f;
  --success: #1f7a4d;
  --success-bg: #e4f3ea;
  --warning: #a5670a;
  --warning-bg: #fbf0dc;
  --danger: #b3261e;
  --danger-bg: #fbe6e4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 36, 31, 0.06), 0 8px 24px -12px rgba(16, 36, 31, 0.18);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1512;
    --card: #12211c;
    --ink: #eef3ef;
    --muted: #9db3ac;
    --border: #24352e;
    --primary: #4fbb8a;
    --primary-ink: #07160f;
    --primary-fg: #07160f;
    --accent: #f2825f;
    --success: #57c98d;
    --success-bg: #113224;
    --warning: #e0ac4f;
    --warning-bg: #33270f;
    --danger: #e0837c;
    --danger-bg: #34140f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Public Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3, h4 {
  font-family: 'Fraunces', ui-serif, Georgia, serif;
  line-height: 1.15;
  margin: 0 0 .4em;
}
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.tabular { font-variant-numeric: tabular-nums; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .55em 1.1em; border-radius: 8px; border: 1px solid transparent;
  font-size: .95em; font-weight: 600; cursor: pointer; background: none;
  font-family: inherit; text-decoration: none; line-height: 1.3;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { filter: brightness(0.94); }
.btn-outline { border-color: var(--border); color: var(--ink); background: var(--card); }
.btn-outline:hover { border-color: var(--primary); }
.btn-ghost { color: var(--muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .35em .75em; font-size: .85em; }
.btn-lg { padding: .75em 1.4em; font-size: 1.05em; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Forms */
label { display: block; font-size: .85em; font-weight: 600; margin-bottom: .35em; }
.field { margin-bottom: 1.1em; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=tel], select, textarea {
  width: 100%; padding: .55em .7em; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--ink); font: inherit; font-size: .95em;
}
textarea { resize: vertical; min-height: 5em; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.hint { font-size: .8em; color: var(--muted); margin-top: .3em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* Cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }

/* Badges / status pills */
.badge {
  display: inline-flex; align-items: center; gap: .3em; padding: .2em .65em;
  border-radius: 999px; font-size: .78em; font-weight: 600; background: var(--border);
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: var(--border); color: var(--muted); }

/* Alerts / flash */
.alert { padding: .8em 1em; border-radius: 8px; margin-bottom: 1.2em; font-size: .92em; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error { background: var(--danger-bg); color: var(--danger); }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: .92em; }
th, td { text-align: left; padding: .65em .5em; border-bottom: 1px solid var(--border); }
th { font-size: .78em; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap table { border: none; }
.table-wrap .card { border: none; border-radius: 0; }

/* ===================== Marketing site ===================== */
.nav {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: .5em; font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.05em; }
.brand-mark { width: 32px; height: 32px; display: block; object-fit: contain; flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 24px; font-size: .92em; }
.nav-links a { color: var(--muted); }
.nav-actions { display: flex; gap: 8px; align-items: center; }

.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4em; background: var(--border); color: var(--muted);
  padding: .3em .8em; border-radius: 999px; font-size: .78em; font-weight: 600; margin-bottom: 1.2em;
}
.hero h1 { font-size: 2.6em; letter-spacing: -0.01em; }
.hero-sub { font-size: 1.1em; color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 1.6em; }

.section { padding: 56px 0; }
.section-alt { background: color-mix(in srgb, var(--border) 40%, var(--bg)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: 1.8em; margin-bottom: .3em; }
.section-lede { color: var(--muted); max-width: 34em; }
.center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

.reasons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 40px; }
@media (max-width: 780px) { .reasons { grid-template-columns: 1fr; } }
.icon-tile {
  width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.2em; margin-bottom: .8em;
}

.feature-groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-top: 40px; }
@media (max-width: 900px) { .feature-groups { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-groups { grid-template-columns: 1fr; } }
.feature-groups h4 { font-family: inherit; font-size: .78em; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .8em; }
.feature-groups ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6em; }
.feature-groups li { display: flex; gap: .5em; align-items: flex-start; font-size: .93em; }
.feature-groups li::before { content: '✓'; color: var(--primary); font-weight: 700; }

.pricing-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; max-width: 1020px; margin: 40px auto 0; }
@media (max-width: 900px) { .pricing-grid { grid-template-columns: 1fr 1fr; max-width: 720px; } }
@media (max-width: 640px) { .pricing-grid { grid-template-columns: 1fr; } }
.plan-card { position: relative; }
.plan-card.featured { border-color: var(--primary); box-shadow: 0 16px 40px -20px color-mix(in srgb, var(--primary) 50%, transparent); }
.plan-name { display: flex; align-items: center; justify-content: space-between; }
.plan-price { font-size: 2em; font-weight: 700; margin: .5em 0; font-family: 'Fraunces', serif; }
.plan-price small { font-size: .4em; font-weight: 500; color: var(--muted); }
.plan-list { list-style: none; margin: 1em 0; padding: 0; display: flex; flex-direction: column; gap: .5em; font-size: .92em; }
.plan-list li::before { content: '✓ '; color: var(--primary); font-weight: 700; }

.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin-top: .6em; color: var(--muted); }

footer.site-footer { border-top: 1px solid var(--border); padding: 40px 0; }
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; font-size: .9em; color: var(--muted); }

/* ===================== App shell ===================== */
.app-shell { display: flex; min-height: 100vh; }
.app-topbar {
  position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px;
}
.app-body { display: flex; flex: 1; min-width: 0; }
.app-sidebar { width: 210px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 12px; }
.app-sidebar a {
  display: flex; align-items: center; gap: .6em; padding: .55em .7em; border-radius: 8px;
  color: var(--muted); font-size: .92em; font-weight: 500;
}
.app-sidebar a.active { background: var(--primary); color: var(--primary-fg); }
.app-sidebar a:hover:not(.active) { background: var(--border); text-decoration: none; }
.app-main { flex: 1; min-width: 0; padding: 24px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-head h1 { font-size: 1.5em; }

.clinic-select { padding: .4em .6em; border-radius: 8px; border: 1px solid var(--border); background: var(--card); font-size: .88em; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.avatar {
  width: 36px; height: 36px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85em; flex-shrink: 0;
}
.stat-tile { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--card); }
.stat-tile .stat-label { font-size: .82em; color: var(--muted); }
.stat-tile .stat-value { font-size: 1.4em; font-weight: 700; margin-top: .2em; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; max-width: 480px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.rx-pad { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .85em; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--card); }
.rx-pad hr { border: none; border-top: 1px dashed var(--border); margin: .8em 0; }

@media (max-width: 780px) {
  .app-sidebar { display: none; }
  .app-main { padding: 16px; }
}

/* ===================== Language switcher (public pages) ===================== */
.lang-switcher { display: inline-block; }
.lang-switcher select {
  padding: .35em .6em; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--ink); font-size: .82em; font-family: inherit; cursor: pointer;
}
.nav-lang { margin-left: 12px; }
body.rtl .nav-lang { margin-left: 0; margin-right: 12px; }

/* ===================== RTL (Arabic) ===================== */
body.rtl { font-family: 'Noto Kufi Arabic', 'Public Sans', sans-serif; }
body.rtl h1, body.rtl h2, body.rtl h3, body.rtl .brand, body.rtl .plan-price { font-family: 'Noto Kufi Arabic', 'Fraunces', serif; }
/* A few spots use hardcoded left/right instead of logical properties, so flip them by hand. */
body.rtl .plan-card { text-align: right; }
body.rtl .footer-grid > div:last-child { text-align: left; }
body.rtl .hero-actions, body.rtl .chip-row { justify-content: flex-start; }
