:root {
  --bg: #07100f;
  --panel: rgba(255,255,255,.08);
  --panel-strong: rgba(255,255,255,.13);
  --text: #eefaf8;
  --muted: #a8beb9;
  --line: rgba(255,255,255,.14);
  --accent: #47d6b6;
  --accent-2: #c7a862;
  --danger: #ff7676;
  --ok: #7af0a2;
  --shadow: 0 22px 80px rgba(0,0,0,.28);
  --nav-bg: rgba(7,16,15,.78);
  --field-bg: rgba(0,0,0,.24);
  --band: rgba(71,214,182,.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 15% 0%, rgba(71,214,182,.16), transparent 30%),
    linear-gradient(135deg, #07100f 0%, #0c1815 45%, #10110c 100%);
  color: var(--text);
}
body[data-theme="light"] {
  --bg: #f6faf8;
  --panel: rgba(255,255,255,.82);
  --panel-strong: rgba(255,255,255,.94);
  --text: #0d1d1a;
  --muted: #55706a;
  --line: rgba(13,29,26,.13);
  --danger: #b42318;
  --ok: #087443;
  --shadow: 0 18px 60px rgba(21,53,48,.12);
  --nav-bg: rgba(255,255,255,.82);
  --field-bg: rgba(255,255,255,.9);
  --band: rgba(71,214,182,.1);
  background:
    linear-gradient(90deg, rgba(13,29,26,.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(13,29,26,.04) 1px, transparent 1px),
    linear-gradient(135deg, #f7fbfa 0%, #eef7f4 52%, #fffaf0 100%);
  background-size: 42px 42px, 42px 42px, auto;
}
body[data-theme="dark"] {
  background:
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.025) 1px, transparent 1px),
    radial-gradient(circle at 15% 0%, rgba(71,214,182,.16), transparent 30%),
    linear-gradient(135deg, #07100f 0%, #0c1815 45%, #10110c 100%);
  background-size: 48px 48px, 48px 48px, auto, auto;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand, .nav nav, .hero-actions, .footer { display: flex; align-items: center; gap: 16px; }
.brand { font-weight: 800; }
.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.nav nav { flex-wrap: wrap; justify-content: flex-end; color: var(--muted); font-size: 14px; }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
}
.lang-switch a { padding: 6px 8px; }
.lang-switch a.active { background: var(--accent); color: #04110e; }
.theme-toggle {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  background: var(--panel);
}
.button, button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255,255,255,.07);
  padding: 12px 16px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
}
.button.primary, button.primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, white)); color: #04110e; border: 0; box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 24%, transparent); }
.button.ghost { padding: 9px 13px; }
.button.small { min-height: 36px; padding: 9px 12px; font-size: 14px; }
.hero {
  min-height: 86vh;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  align-items: center;
  gap: clamp(28px, 6vw, 90px);
  padding: clamp(70px, 9vw, 120px) clamp(18px, 6vw, 88px) 48px;
}
.hero-copy {
  position: relative;
}
.hero-copy::before {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  margin-bottom: 22px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.hero h1, .profile-hero h1, .auth h1, .dashboard h1 {
  font-size: clamp(44px, 7vw, 92px);
  line-height: .94;
  margin: 0 0 24px;
  letter-spacing: 0;
}
.lead { color: #d5e7e2; font-size: clamp(18px, 2.2vw, 24px); max-width: 760px; line-height: 1.55; }
.eyebrow { color: var(--accent-2); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; }
.hero-panel, .glass-panel, .info-panel, .feed-box, .form-card, .table-card, .doctor-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero-panel {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  overflow: hidden;
  position: relative;
}
.pulse {
  position: absolute;
  inset: 30px;
  border: 1px solid rgba(71,214,182,.25);
  background: repeating-linear-gradient(90deg, transparent 0 22px, rgba(71,214,182,.08) 23px 24px);
}
.hero-panel strong { font-size: 28px; max-width: 360px; z-index: 1; }
.hero-panel span { color: var(--accent); z-index: 1; margin-bottom: 10px; }
.stats, .section, .split, .contact, .dashboard, .profile-grid, .profile-hero {
  padding: 54px clamp(18px, 6vw, 88px);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  padding-top: 1px;
  padding-bottom: 1px;
}
body[data-theme="dark"] .stats div { background: #0a1513; }
body[data-theme="light"] .stats div { background: rgba(255,255,255,.78); }
.stats div { padding: 28px; }
.stats strong { display: block; color: var(--accent); font-size: 42px; }
.stats span, p, li, small { color: var(--muted); line-height: 1.6; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 24px; }
h2 { font-size: clamp(28px, 3.4vw, 48px); line-height: 1.05; margin: 0; }
h3 { margin: 0 0 10px; font-size: 23px; }
.doctor-grid, .feed-grid, .profile-grid, .portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.services-band {
  background: linear-gradient(135deg, var(--band), transparent);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.doctor-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.doctor-card, .feed-box, .info-panel, .form-card, .table-card, .glass-panel { padding: 24px; border-radius: var(--radius); }
.doctor-card { display: flex; flex-direction: column; gap: 12px; }
.doctor-card-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.compact-links { margin: 0; }
.avatar {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  background: #d9fff6;
  color: #07100f;
  font-size: 28px;
  font-weight: 900;
}
.person-photo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
  margin-right: 10px;
  vertical-align: middle;
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.doctor-portrait {
  width: min(320px, 38vw);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.profile-photo-preview {
  width: 140px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.split, .contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
}
.concierge { background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.recommendation {
  padding: 16px;
  border: 1px solid rgba(71,214,182,.35);
  background: rgba(71,214,182,.08);
}
.follow-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -8px 0 20px;
}
.form-card { display: grid; gap: 14px; }
input, select, textarea {
  width: 100%;
  color: var(--text);
  background: var(--field-bg);
  border: 1px solid var(--line);
  padding: 13px 14px;
  font: inherit;
  border-radius: 4px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 2px;
}
input[type="checkbox"] { width: auto; }
.check { display: inline-flex; align-items: center; gap: 8px; }
.inline-form { display: flex; gap: 10px; align-items: center; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.permission-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
textarea { min-height: 116px; resize: vertical; }
label { color: var(--muted); font-weight: 700; font-size: 13px; }
.profile-hero { min-height: 58vh; display: flex; align-items: center; background: linear-gradient(120deg, rgba(71,214,182,.14), transparent); }
.info-panel ul { padding-left: 18px; }
.slot-list { display: flex; flex-wrap: wrap; gap: 10px; }
.slot, .status {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.07);
  padding: 10px 12px;
}
.status.scheduled { color: var(--ok); }
.status.cancelled { color: var(--danger); }
.auth-wrap { min-height: 78vh; display: grid; place-items: center; padding: 32px 18px; }
.auth { width: min(460px, 100%); }
.hint { font-size: 13px; margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 14px 10px; vertical-align: top; text-align: left; }
th { color: var(--accent-2); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.link-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--danger);
}
.flash-wrap { position: fixed; top: 78px; right: 18px; z-index: 50; display: grid; gap: 8px; }
.flash { padding: 12px 14px; background: var(--panel-strong); border: 1px solid var(--line); box-shadow: var(--shadow); }
.flash.error { border-color: var(--danger); }
.flash.success { border-color: var(--ok); }
.footer { justify-content: space-between; padding: 28px clamp(18px, 6vw, 88px); border-top: 1px solid var(--line); color: var(--muted); }
.footer div:last-child { display: grid; gap: 6px; text-align: right; }
.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  font-size: 13px;
}
.legal-page {
  display: grid;
  gap: 18px;
}
.legal-page h2 {
  font-size: clamp(22px, 2.4vw, 34px);
}
.legal-page a {
  color: var(--accent);
  font-weight: 800;
}
.product-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px clamp(18px, 6vw, 88px);
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.22);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.narrow { max-width: 940px; margin: 0 auto; }
@media (max-width: 900px) {
  .hero, .split, .contact, .doctor-grid, .feed-grid, .profile-grid, .portal-grid, .stats, .service-grid {
    grid-template-columns: 1fr;
  }
  .hero { min-height: auto; padding-top: 46px; }
  .nav, .section-head, .footer { align-items: flex-start; flex-direction: column; }
  .footer div:last-child { text-align: left; }
  th, td { min-width: 150px; }
  .table-card { overflow-x: auto; }
  .settings-grid { grid-template-columns: 1fr; }
}
