:root {
  --black: #11110f;
  --black-2: #1b1a17;
  --red: #c8262e;
  --red-dark: #9e1c24;
  --leaf-900: #092517;
  --leaf-800: #10351f;
  --leaf-700: #174b2b;
  --leaf-600: #1f6b3c;
  --leaf-500: #2f8f52;
  --leaf-100: #e9f7eb;
  --leaf-050: #f4fbf5;
  --gold: #e7b94a;
  --text: #171916;
  --muted: #637063;
  --card: rgba(255, 255, 255, 0.9);
  --border: rgba(23, 75, 43, 0.16);
  --shadow: 0 24px 70px rgba(9, 37, 23, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(200, 38, 46, 0.12), transparent 32rem),
    radial-gradient(circle at 85% 8%, rgba(47, 143, 82, 0.18), transparent 30rem),
    linear-gradient(180deg, #f7faf6 0%, #eef6ee 45%, #fbfbf8 100%);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }
.app-shell { min-height: 100vh; }

.hero {
  position: relative;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(135deg, rgba(12, 12, 10, 0.96), rgba(27, 26, 23, 0.92)),
    url("data:image/svg+xml,%3Csvg width='180' height='180' viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.07'%3E%3Cpath d='M91 12c20 18 25 40 14 65 22-10 42-6 61 14-27 4-45 16-55 39-15-20-34-28-59-24 18-20 24-41 17-67 9 6 16 7 22-27Z'/%3E%3C/g%3E%3C/svg%3E");
  border-bottom-left-radius: 44px;
  border-bottom-right-radius: 44px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% -10%;
  height: 260px;
  background: radial-gradient(ellipse at center, rgba(200, 38, 46, 0.24), transparent 70%);
  pointer-events: none;
}

.nav-bar, .hero-grid, main { width: min(var(--max), calc(100% - 36px)); margin: 0 auto; }
.nav-bar {
  position: relative;
  z-index: 2;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; gap: 12px; align-items: center; min-width: 230px; }
.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.12);
}
.brand strong { display: block; line-height: 1.1; letter-spacing: -0.02em; }
.brand small { display: block; margin-top: 2px; color: rgba(255,255,255,.7); }

.nav-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; }
.nav-link, .language-select, .nav-status {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  color: rgba(255,255,255,.92);
  font-size: .88rem;
  backdrop-filter: blur(10px);
}
.language-select { color: white; cursor: pointer; }
.language-select option { color: var(--text); }
.nav-status.live { background: rgba(117,209,126,.16); }
.nav-status.demo { background: rgba(255,197,92,.16); }
.nav-status.paid { background: rgba(200,38,46,.22); }

.hero-grid {
  position: relative;
  z-index: 1;
  padding: 56px 0 82px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .72fr);
  gap: 44px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero .eyebrow { color: #ff858b; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 18px;
  font-size: clamp(2.45rem, 6vw, 5.3rem);
  line-height: .95;
  letter-spacing: -.065em;
  max-width: 920px;
}
h2 { margin-bottom: 12px; font-size: clamp(1.7rem, 3vw, 2.65rem); line-height: 1.05; letter-spacing: -.04em; }
h3 { margin-bottom: 10px; letter-spacing: -.02em; }
.hero-text { max-width: 770px; font-size: 1.08rem; line-height: 1.7; color: rgba(255,255,255,.82); }
.hero-actions, .form-actions, .pricing-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.button {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 850;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, opacity 160ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.button.primary { color: white; background: linear-gradient(135deg, var(--red), var(--red-dark)); box-shadow: 0 16px 34px rgba(156, 28, 36, .28); }
.hero .button.primary { color: white; background: linear-gradient(135deg, #f33b45, #a91f27); }
.button.ghost { color: inherit; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.24); }
.panel .button.ghost, .results .button.ghost { color: var(--black); background: white; border: 1px solid var(--border); }
.button.secondary { color: var(--black); background: #fff1f2; border: 1px solid rgba(200,38,46,.16); }
.button.big { min-height: 52px; padding-inline: 24px; }

.doctor-card {
  position: relative;
  min-height: 395px;
  padding: 34px;
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.08));
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 30px 80px rgba(0,0,0,.34);
  overflow: hidden;
  backdrop-filter: blur(14px);
}
.doctor-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.10);
  pointer-events: none;
}
.doctor-logo { width: 92px; height: 92px; border-radius: 50%; box-shadow: 0 18px 40px rgba(0,0,0,.36); margin-bottom: 26px; }
.doctor-card h2 { font-size: 2.2rem; }
.doctor-card p { color: rgba(255,255,255,.78); line-height: 1.7; }
.doctor-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.doctor-pills span, .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
  color: var(--black);
  background: white;
  border: 1px solid rgba(0,0,0,.06);
}
.pulse {
  width: 160px;
  height: 160px;
  position: absolute;
  right: -40px;
  top: -40px;
  border-radius: 50%;
  background: rgba(200,38,46,.26);
  box-shadow: 0 0 0 28px rgba(200,38,46,.08), 0 0 0 58px rgba(200,38,46,.04);
}

main { padding: 34px 0 72px; }
.panel, .results {
  margin-top: 26px;
  padding: clamp(22px, 4vw, 38px);
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.section-heading { max-width: 860px; margin-bottom: 24px; }
.section-heading p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }
.section-heading.compact { margin: 34px 0 18px; }
.muted { color: var(--muted); line-height: 1.7; }

.pricing-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(17,17,15,.96), rgba(36,35,31,.92));
  color: white;
  overflow: hidden;
  position: relative;
}
.pricing-card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -80px;
  top: -70px;
  border-radius: 50%;
  background: rgba(200,38,46,.24);
}
.pricing-card > * { position: relative; z-index: 1; }
.pricing-card .badge { color: white; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); }
.pricing-card h3 { margin: 12px 0 8px; font-size: clamp(1.7rem, 3vw, 3rem); }
.pricing-card .muted { color: rgba(255,255,255,.72); margin-bottom: 0; }
.payment-status {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--muted);
  line-height: 1.6;
}
.payment-status.ok { color: #0d5b2e; background: #eefbf2; border-color: rgba(13,91,46,.18); }
.payment-status.warn { color: #8a4b00; background: #fff8e8; border-color: rgba(138,75,0,.18); }
.payment-status.error { color: #9e1c24; background: #fff0f1; border-color: rgba(158,28,36,.18); }

.upload-zone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 210px;
  padding: 28px;
  border: 2px dashed rgba(200,38,46,.28);
  border-radius: 24px;
  background: rgba(255,255,255,.62);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--red); background: #fff9f9; transform: translateY(-1px); }
.upload-icon { font-size: 2.8rem; }
.upload-zone span { color: var(--muted); }
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.photo-card {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.photo-card img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; }
.photo-card small { display: block; color: var(--muted); margin-top: 4px; }
.photo-card button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: #fff1f2;
  color: var(--red-dark);
  font-size: 1.2rem;
  cursor: pointer;
}

.form-grid { margin-top: 18px; }
.two-col, .three-col {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: 7px; font-weight: 750; color: var(--leaf-900); }
input, select, textarea {
  width: 100%;
  border: 1px solid rgba(23,75,43,.18);
  background: rgba(255,255,255,.9);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(200,38,46,.10); background: white; }
.full-width { margin-bottom: 16px; }

.results.hidden, .hidden { display: none; }
.results-topline { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.result-layout { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); gap: 20px; align-items: start; }
.summary-card, .result-card, .error-card {
  padding: 22px;
  border-radius: 22px;
  background: white;
  border: 1px solid var(--border);
  box-shadow: 0 12px 34px rgba(9,37,23,.08);
}
.summary-card { position: sticky; top: 18px; }
.summary-card h3 { line-height: 1.35; }
.status-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.badge.low { background: #ecfbef; color: #0e6b31; }
.badge.medium { background: #fff8e4; color: #8a4b00; }
.badge.high { background: #fff0df; color: #a14d00; }
.badge.emergency { background: #fff0f1; color: var(--red-dark); }
.warning-box {
  padding: 14px;
  border-radius: 16px;
  background: #fff8e8;
  border: 1px solid rgba(154,91,0,.16);
  color: #704000;
  line-height: 1.65;
}
.confidence-ring {
  --pct: 0;
  width: 106px;
  height: 106px;
  display: grid;
  place-items: center;
  margin: 16px 0;
  border-radius: 50%;
  background: conic-gradient(var(--red) calc(var(--pct) * 1%), #eef0ec 0);
}
.confidence-ring span {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: white;
  font-weight: 900;
}
.diagnosis-list { display: grid; gap: 16px; }
.result-card h3 { display: flex; align-items: center; gap: 10px; }
.result-card li { margin-bottom: 8px; line-height: 1.65; }
.diagnosis-item { padding: 16px 0; border-top: 1px solid var(--border); }
.diagnosis-item:first-child { border-top: 0; padding-top: 0; }
.diagnosis-item header { display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.progress { height: 9px; background: #edf0eb; border-radius: 999px; overflow: hidden; margin: 10px 0 12px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--leaf-500)); border-radius: inherit; }
.prescription-grid, .schedule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.prescription-block, .schedule-block { padding: 16px; border-radius: 16px; background: var(--leaf-050); border: 1px solid var(--border); }
.prescription-block h4, .schedule-block h4 { margin: 0 0 10px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature-grid article { padding: 22px; border-radius: 22px; background: white; border: 1px solid var(--border); }
.feature-grid article > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 50%;
  color: white;
  background: var(--red);
  font-weight: 900;
}
.feature-grid p { color: var(--muted); line-height: 1.7; }

.footer {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto 36px;
  padding: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  color: var(--muted);
}
.footer img { width: 32px; height: 32px; border-radius: 50%; }
.footer a { color: var(--red-dark); font-weight: 800; }

.loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-card { color: var(--red-dark); background: #fff0f1; border-color: rgba(158,28,36,.18); line-height: 1.6; }

@media (max-width: 900px) {
  .nav-bar { align-items: flex-start; flex-direction: column; }
  .nav-controls { justify-content: flex-start; }
  .hero-grid, .pricing-card, .result-layout { grid-template-columns: 1fr; }
  .three-col, .two-col, .feature-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; }
}

@media print {
  .hero, .pricing-panel, .upload-zone, .form-actions, .footer, .results-topline .button { display: none !important; }
  body { background: white; }
  main, .results { width: 100%; margin: 0; padding: 0; box-shadow: none; border: 0; }
  .result-layout { grid-template-columns: 1fr; }
}
