:root {
  --primary: #0F3D3E;
  --secondary: #1E7A73;
  --accent: #C9A24A;
  --surface: #F7F5F0;
  --text: #1F2233;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { background: var(--surface); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Noto Sans Arabic", "Segoe UI", system-ui, sans-serif;
  background: var(--surface);
  color: var(--text);
  line-height: 1.7;
}
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1rem 1.5rem;
  background: var(--primary); color: #fff;
}
.site-header .brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.site-header nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-header nav a { color: #e9f1f0; text-decoration: none; font-size: .95rem; }
.site-header nav a.cta { background: var(--accent); color: #1b1b1b; padding: .35rem .8rem; border-radius: 999px; }
main { flex: 1 0 auto; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
h1 { font-size: 1.8rem; margin: 0 0 1rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 .75rem; }
.hero { background: #fff; border-radius: var(--radius); padding: 2rem; box-shadow: 0 2px 18px rgba(15,61,62,.08); }
.hero h1 { font-size: 2rem; }
.btn { display: inline-block; margin-inline-end: .6rem; margin-top: 1rem; padding: .6rem 1.2rem; border-radius: 999px; text-decoration: none; }
.btn.primary { background: var(--secondary); color: #fff; }
.btn.ghost { border: 1px solid var(--secondary); color: var(--secondary); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { background: #fff; border-radius: var(--radius); padding: 1rem 1.15rem; text-decoration: none; color: inherit; box-shadow: 0 1px 10px rgba(15,61,62,.06); }
.card h3 { margin: 0 0 .25rem; font-size: 1.05rem; color: var(--primary); }
.muted { color: #6b7280; font-size: .9rem; margin: 0; }
.empty { color: #6b7280; }
.filters { display: flex; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters input, .filters select { padding: .55rem .8rem; border: 1px solid #d7d7d7; border-radius: 10px; font: inherit; min-width: 0; flex: 1 1 180px; }
.faq { list-style: none; padding: 0; }
.faq li { background: #fff; border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; }
.error { background: #fff3f2; border: 1px solid #f0c0bb; border-radius: var(--radius); padding: 1rem; }
.site-footer { margin-top: 3rem; padding: 1.5rem; background: var(--primary); color: #dbe7e6; font-size: .9rem; }
.site-footer .demo-note { margin-top: .75rem; color: var(--accent); }
.slots { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.slot { background: var(--secondary); color: #fff; padding: .35rem .8rem; border-radius: 999px; text-decoration: none; font-size: .9rem; }
.day { margin-bottom: 1.25rem; }
.branch-card { margin-bottom: 1rem; }
.profile { background: #fff; border-radius: var(--radius); padding: 1.5rem; }

/* forms */
.card.form { display: grid; gap: 14px; }
.card.form label { display: grid; gap: 6px; font-size: 15px; }
.card.form input, .card.form textarea, .card.form select { width: 100%; max-width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--line, #d8dee6); border-radius: 10px; font: inherit; background: #fff; }
.card.form > * { min-width: 0; }
.card.form input:focus, .card.form textarea:focus { outline: 2px solid var(--brand, #0e7c86); outline-offset: 1px; }
.hint { font-size: 13px; color: #5b6773; margin: 0; }
.form-error { color: #b42318; font-size: 14px; margin: 0; min-height: 1em; }
.confirm .code-box { display: flex; gap: 24px; flex-wrap: wrap; margin: 18px 0; padding: 16px; background: #f5f8fa; border-radius: 12px; }
.confirm .code-box > div { display: grid; gap: 4px; }
.confirm .code { font-size: 26px; letter-spacing: 4px; direction: ltr; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

/* lists, tables, grids */
.small { font-size: 13px; }
.center { text-align: center; }
.price-table { width: 100%; border-collapse: collapse; }
.price-table th, .price-table td { text-align: right; padding: 10px 8px; border-bottom: 1px solid #e6eaef; vertical-align: top; }
.price-table th { font-size: 13px; color: #5b6773; font-weight: 600; }
.grid { display: grid; gap: 14px; }
.grid > *, .two-col > * { min-width: 0; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid.cards .card { display: grid; gap: 6px; justify-items: center; }
.grid.cards .logo { width: 100%; max-width: 160px; height: auto; border-radius: 8px; }
.grid.gallery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.gallery figure { margin: 0; background: #fff; border-radius: 12px; overflow: hidden; }
.grid.gallery img { width: 100%; height: 160px; object-fit: cover; display: block; }
.grid.gallery figcaption { padding: 8px 10px; font-size: 13px; color: #5b6773; }
article.card .cover { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
details summary { cursor: pointer; font-weight: 600; }
.faq-item { padding: 12px 0; border-bottom: 1px solid #e6eaef; }
.faq-item:last-child { border-bottom: 0; }
.two-col { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .two-col { grid-template-columns: 1.4fr 1fr; } }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.form-ok { color: #1e7a73; font-size: 14px; margin: 0; min-height: 1em; }

/* hero with banner image (screen 1) */
.hero.has-media { display: grid; grid-template-columns: 1.05fr .95fr; gap: 1.5rem; align-items: center; }
.hero-media img { width: 100%; display: block; border-radius: calc(var(--radius) - 4px); }
@media (max-width: 760px) { .hero.has-media { grid-template-columns: 1fr; } }

/* banner strip (screen 1) */
.banner-strip { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 1.5rem; }
.banner-card { display: flex; gap: .8rem; align-items: center; background: #fff; border-radius: var(--radius); padding: .75rem; text-decoration: none; color: inherit; box-shadow: 0 1px 10px rgba(15,61,62,.06); }
.banner-card img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.banner-card h3 { margin: 0; font-size: .98rem; color: var(--primary); }

/* doctor photos with a graceful fallback when photo_url is empty */
.doctor-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 10px; background: #eef2f1; margin-bottom: .6rem; }
.photo-fallback { display: flex; align-items: center; justify-content: center; font-size: 1.7rem; font-weight: 700; color: var(--secondary); }
.doctor-photo.is-broken { display: none; }
.profile-with-photo { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; align-items: start; }
.profile-photo { width: 220px; height: 220px; object-fit: cover; border-radius: var(--radius); background: #eef2f1; }
@media (max-width: 620px) { .profile-with-photo { grid-template-columns: 1fr; } .profile-photo { width: 100%; height: auto; aspect-ratio: 1 / 1; } }
