// Molara homepage — telehealth-style public landing page.

const HOME_GREEN = '#145c4f';
const HOME_GREEN_DARK = '#0d433a';
const HOME_GOLD = '#b69c34';
const HOME_SAGE = '#dfeae5';
const HOME_CREAM = '#f7f4ea';

const dentalTreatments = [
  {
    k: 'emergency',
    label: 'Emergency dental consultation 24/7',
    icon: 'shield',
    body: 'For severe tooth pain, swelling, bleeding, broken teeth, or sudden dental worry. Connect quickly with Dr. Shivani, explain symptoms, share photos if needed, and get immediate next-step guidance.',
  },
  {
    k: 'toothache',
    label: 'All types of tooth ache',
    icon: 'tooth',
    body: 'For sensitivity, chewing pain, cavity concerns, gum pain, wisdom tooth flare-ups, or root canal doubts. A dentist reviews what you feel and helps decide whether medicine, monitoring, or clinic care is needed.',
  },
  {
    k: 'kids',
    label: 'Kids tooth care',
    icon: 'baby',
    body: 'For children’s tooth pain, milk tooth concerns, teething, early cavities, brushing habits, and dental anxiety. Parents get calm guidance on what is urgent and what can safely wait.',
  },
  {
    k: 'aligners',
    label: 'Aligners and braces opinion',
    icon: 'settings',
    body: 'For braces, aligners, bite issues, retainers, treatment planning, or second opinions. Upload details, discuss goals, and understand possible options before committing to a clinic visit.',
  },
  {
    k: 'cosmetic',
    label: 'Teeth whitening and cosmetic dental care',
    icon: 'sparkle',
    body: 'For whitening, stains, smile design, chipped tooth bonding, veneers, and cosmetic planning. Get a realistic online opinion on what may work and when an in-person procedure is required.',
  },
];

function MarketingHome({ tone = 'warm', hideNav = false }) {
  const { user, signedIn } = useAuth();
  useDoctorReviews();
  const siteReviews = useSiteReviews ? useSiteReviews() : [];
  const [active, setActive] = React.useState('home');
  const scrollRef = React.useRef(null);
  const presence = usePresence();
  const onlineDoctors = DOCTORS.filter((d) => presence.has(d.id));
  const featuredDoctors = DOCTORS;

  const go = (id) => {
    if (id === 'home') {
      setActive('home');
      const root = scrollRef.current;
      if (root) root.scrollTo({ top: 0, behavior: 'smooth' });
      return;
    }
    if (id === 'find') {
      window.navigate && window.navigate('/find');
      return;
    }
    if (id === 'emergency') {
      window.startEmergencyConsult ? window.startEmergencyConsult(user) : (window.requireAuth && window.requireAuth('/book?emergency=1'));
      return;
    }
    setActive(id);
    const root = scrollRef.current;
    const el = root && root.querySelector(`[data-sec="${id}"]`);
    if (el) el.scrollIntoView({ behavior: 'smooth', block: 'start' });
  };

  const tabs = [
    ['home', 'Home'],
    ['treat', 'Services'],
    ['how', 'How it works'],
    ['network', 'Dentists'],
    ['security', 'Records'],
  ];

  return (
    <div ref={scrollRef} className="ml-root molara-home" style={{ height: '100%', overflowY: 'auto', background: '#fff' }}>
      <style>{homeCss}</style>

      {!hideNav && (
        <nav className="home-nav">
          <button className="home-brand" onClick={() => go('home')} aria-label="Molara home">
            <Logo size={22}/>
          </button>
          <div className="home-nav__links">
            {tabs.map(([k, label]) => (
              <button key={k} onClick={() => go(k)} className={active === k ? 'is-active' : ''}>
                {label}
              </button>
            ))}
          </div>
          <div className="home-nav__actions">
            {signedIn ? (
              <button onClick={() => window.navigate && window.navigate('/profile')} className="home-avatar" title={user?.name}>
                {user?.initials || 'PT'}
              </button>
            ) : (
              <button className="home-link" onClick={() => window.openGate ? window.openGate('/', 'signin') : window.navigate('/signin')}>
                Sign in
              </button>
            )}
            <button className="home-btn home-btn--green" onClick={() => go('find')}>Book Now</button>
          </div>
        </nav>
      )}

      <section className="home-hero" data-sec="home">
        <div className="home-hero__copy">
          <div className="home-kicker"><span className="ml-live"/> Licensed dentists online</div>
          <h1>
            Dental care that is convenient, calm and relevant to <span>you.</span>
          </h1>
          <p>
            Choose from online dental consultations for tooth pain, emergencies, kids care,
            aligners, braces opinions, whitening, and cosmetic dental planning.
          </p>
          <div className="home-hero__buttons">
            <button className="home-btn home-btn--green" onClick={() => go('find')}>Book Now</button>
            <button className="home-btn home-btn--urgent" onClick={() => go('emergency')}>Emergency Consult</button>
            <button className="home-btn home-btn--gold" onClick={() => go('treat')}>View Services</button>
          </div>
          <div className="home-hero__proof">
            <span><I.check size={14}/> Dr. Shivani available 24/7</span>
            <span><I.check size={14}/> Prescription and follow-up support</span>
          </div>
        </div>

        <HeroTelehealthVisual/>
      </section>

      <section data-sec="treat" className="home-section home-services">
        <div className="home-section__intro">
          <div className="home-label">Services</div>
          <h2>Dental help for the moments patients actually search for.</h2>
          <p>Start online, understand the next step clearly, and move to a clinic only when hands-on care is needed.</p>
        </div>
        <div className="home-service-grid">
          {dentalTreatments.map((s) => {
            const Icon = I[s.icon] || I.tooth;
            return (
              <button key={s.k} className="home-service-card" onClick={() => s.k === 'emergency' ? go('emergency') : (window.navigate && window.navigate(`/find?spec=${encodeURIComponent(s.k)}`))}>
                <span className="home-service-card__icon"><Icon size={20}/></span>
                <strong>{s.label}</strong>
                <p>{s.body}</p>
              </button>
            );
          })}
        </div>
      </section>

      <section data-sec="how" className="home-section home-steps">
        <div className="home-section__intro">
          <div className="home-label">How it works</div>
          <h2>From tooth trouble to a plan, in three simple steps.</h2>
        </div>
        <div className="home-step-grid">
          {[
            ['01', 'Tell us what hurts', 'Share symptoms, timing, and optional photos before the visit.'],
            ['02', 'Meet the dentist on WhatsApp', 'After confirmation, your registered email receives the dentist WhatsApp link for the consultation.'],
            ['03', 'Leave with next steps', 'Get prescription notes, care guidance, records, and follow-up eligibility.'],
          ].map(([n, title, body]) => (
            <div key={n} className="home-step-card">
              <span>{n}</span>
              <h3>{title}</h3>
              <p>{body}</p>
            </div>
          ))}
        </div>
      </section>

      <section data-sec="network" className="home-section home-network">
        <div className="home-section__intro">
          <div className="home-label">Dentists</div>
          <h2>{featuredDoctors.length} trusted dentists ready for online consultation.</h2>
          <p>Browse specialists, choose the right fit, and keep all visits connected to your patient dashboard.</p>
        </div>
        <div className="home-doctor-grid">
          {featuredDoctors.map((d) => {
            const stats = doctorStats(d);
            return (
            <button key={d.id} onClick={() => window.navigate && window.navigate(`/doctor/${d.id}`)} className="home-doctor-card">
              <div className="home-doctor-card__avatar" style={{ background: TONE_BG[d.tone], color: TONE_FG[d.tone] }}>{d.avatar}</div>
              <div>
                <strong>{d.n}</strong>
                <span>{d.spec}</span>
                <p>{briefDoctorProfile(d)}</p>
                <em><I.star size={12}/> {stats.rating} · {stats.reviews} reviews</em>
              </div>
            </button>
          );})}
        </div>
        <button onClick={() => go('find')} className="home-btn home-btn--outline">Browse all dentists <I.arrowR size={14}/></button>
      </section>

      <section className="home-section home-reviews">
        <div className="home-section__intro">
          <h2>What patient say after using Molara</h2>
        </div>
        {siteReviews.length ? (
          <div className="home-review-grid">
            {siteReviews.slice(0, 6).map((r) => (
              <div key={r.id || `${r.consultId}-${r.createdAt}`} className="home-review-card">
                <div className="home-review-card__stars">{'★'.repeat(Number(r.rating || 5))}</div>
                <p>“{r.note}”</p>
                <strong>{r.patientName || 'Molara patient'}</strong>
              </div>
            ))}
          </div>
        ) : (
          <div className="home-review-empty">Patient reviews will appear here after prescriptions are uploaded and patients share feedback.</div>
        )}
      </section>

      <section data-sec="security" className="home-security">
        <div>
          <div className="home-label">Records</div>
          <h2>Your dental record stays connected after every visit.</h2>
        </div>
        <div className="home-security__items">
          {[
            ['Private records', 'Bookings, prescriptions, and uploaded dental records stay attached to the patient login.'],
            ['Doctor notes', 'The notes and prescription written after the call appear in the patient account.'],
            ['Follow-up window', 'Follow-ups within 7 days remain free and visible to the dentist.'],
          ].map(([t, b]) => (
            <div key={t}>
              <I.shield size={21}/>
              <strong>{t}</strong>
              <p>{b}</p>
            </div>
          ))}
        </div>
      </section>

      <footer className="home-footer">
        <span>© Molara 2026</span>
        <button onClick={() => window.navigate && window.navigate('/doctor-signin')}>Doctor login <I.arrowR size={12}/></button>
      </footer>
    </div>
  );
}

function marketingRouteParams(route) {
  const raw = String(route || window.location.hash.replace(/^#/, '') || '');
  return new URLSearchParams(raw.split('?')[1] || '');
}

function MolaraReviewPage({ route = '' }) {
  const params = marketingRouteParams(route);
  const consultId = params.get('consult') || '';
  const initialStars = Math.max(1, Math.min(5, Number(params.get('stars') || 5)));
  const [rating, setRating] = React.useState(initialStars);
  const [note, setNote] = React.useState('');
  const [busy, setBusy] = React.useState(false);
  const [done, setDone] = React.useState(false);
  const [err, setErr] = React.useState('');
  const submit = async () => {
    setErr('');
    if (!note.trim()) {
      setErr('Please add a short review note.');
      return;
    }
    setBusy(true);
    try {
      await createSiteReview({ consultId, rating, note });
      setDone(true);
    } catch (e) {
      setErr(e.message || 'Could not save review.');
    } finally {
      setBusy(false);
    }
  };
  return (
    <div className="ml-root molara-home" style={{ minHeight: '100%', background: HOME_CREAM, display: 'grid', placeItems: 'center', padding: 24 }}>
      <style>{homeCss}</style>
      <div className="home-review-page">
        <Logo size={42}/>
        <div className="home-label" style={{ marginTop: 20 }}>Molara review</div>
        <h1>{done ? 'Thank you for reviewing Molara.' : 'How was your Molara experience?'}</h1>
        {done ? (
          <>
            <p>Your review has been saved and can appear on the Molara home page.</p>
            <button className="home-btn home-btn--green" onClick={() => window.navigate && window.navigate('/')}>Back to Molara</button>
          </>
        ) : (
          <>
            <p>Your rating helps future patients understand the Molara experience. Please do not include private medical details in the public review.</p>
            <div className="home-review-stars">
              {[1,2,3,4,5].map((n) => (
                <button key={n} onClick={() => setRating(n)} className={n <= rating ? 'is-on' : ''}>★</button>
              ))}
            </div>
            <textarea className="ml-input" rows={5} value={note} onChange={(e) => setNote(e.target.value)} placeholder="Write a short public review for Molara..." style={{ resize: 'none', fontFamily: 'var(--sans)', marginTop: 16 }}/>
            {err && <div style={{ marginTop: 12, color: 'var(--danger)', fontSize: 13 }}>{err}</div>}
            <button className="home-btn home-btn--green" onClick={submit} disabled={busy} style={{ marginTop: 18, opacity: busy ? 0.65 : 1 }}>{busy ? 'Saving...' : 'Submit review'}</button>
          </>
        )}
      </div>
    </div>
  );
}

function HeroTelehealthVisual() {
  return (
    <div className="home-media" aria-label="Molara online dental consultation preview">
      <div className="home-media__loop"/>
      <div className="home-media__loop home-media__loop--gold"/>
      <div className="home-media__photo home-media__photo--image">
        <img src="molara-hero-consult.jpeg" alt="Online dental consultation with Molara"/>
      </div>
    </div>
  );
}

function briefDoctorProfile(doc) {
  const first = String(doc.bio || '').split('. ')[0].trim();
  return first ? `${first.replace(/\.$/, '')}.` : `${doc.creds} dentist for online dental consultation.`;
}

const homeCss = `
.molara-home {
  --home-green: ${HOME_GREEN};
  --home-green-dark: ${HOME_GREEN_DARK};
  --home-gold: ${HOME_GOLD};
  --home-sage: ${HOME_SAGE};
  --home-cream: ${HOME_CREAM};
}
.home-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 84px;
  padding: 18px clamp(22px, 5vw, 76px);
  display: flex;
  align-items: center;
  gap: 32px;
  background: rgba(255,255,255,.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(20,92,79,.08);
}
.home-brand,
.home-nav button,
.home-footer button {
  font-family: var(--sans);
}
.home-brand {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.home-nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}
.home-nav__links button,
.home-link,
.home-footer button {
  border: 0;
  background: transparent;
  color: #10231f;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}
.home-nav__links button.is-active {
  color: var(--home-green);
  text-decoration: underline;
  text-underline-offset: 8px;
}
.home-nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.home-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(20,92,79,.18);
  background: var(--home-sage);
  color: var(--home-green);
  font-weight: 700;
}
.home-btn {
  min-height: 44px;
  border-radius: 999px;
  border: 0;
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(11,59,51,.12);
}
.home-btn--green {
  background: var(--home-green);
  color: #fff;
}
.home-btn--gold {
  background: var(--home-gold);
  color: #fff;
}
.home-btn--urgent {
  background: #7f332d;
  color: #fff;
}
.home-btn--outline {
  color: var(--home-green);
  background: #fff;
  border: 1px solid rgba(20,92,79,.18);
  box-shadow: none;
}
.home-hero {
  min-height: 700px;
  padding: clamp(58px, 8vw, 112px) clamp(24px, 7vw, 96px) 76px;
  display: grid;
  grid-template-columns: minmax(360px, 0.93fr) minmax(420px, 1.07fr);
  gap: clamp(30px, 7vw, 92px);
  align-items: center;
  background:
    linear-gradient(90deg, rgba(255,255,255,.96) 0 43%, rgba(255,255,255,.72) 56%, rgba(255,255,255,.18) 100%),
    radial-gradient(circle at 78% 44%, rgba(20,92,79,.13), transparent 36%),
    linear-gradient(180deg, #fff, #f7f4ea);
  overflow: hidden;
}
.home-kicker {
  width: fit-content;
  margin-bottom: 28px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--home-green);
  background: rgba(223,234,229,.72);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  display: flex;
  align-items: center;
  gap: 7px;
}
.home-hero h1 {
  max-width: 680px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(48px, 5.8vw, 86px);
  line-height: 1.05;
  letter-spacing: 0;
  color: #121a17;
  font-weight: 500;
}
.home-hero h1 span {
  color: var(--home-green);
  font-weight: 700;
}
.home-hero p {
  margin: 26px 0 0;
  max-width: 560px;
  font-size: 18px;
  line-height: 1.62;
  color: rgba(16,35,31,.68);
}
.home-hero__buttons {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.home-hero__proof {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 24px;
  color: rgba(16,35,31,.66);
  font-size: 13.5px;
}
.home-hero__proof span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.home-media {
  min-height: 635px;
  position: relative;
  display: grid;
  place-items: center;
  margin-right: clamp(-62px, -4vw, -22px);
}
.home-media__photo {
  position: relative;
  width: min(820px, 118%);
  aspect-ratio: 1.22 / 1;
  border-radius: 34% 0 0 34%;
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(255,255,255,.10), rgba(255,255,255,.48)),
    linear-gradient(135deg, #edf2ef, #d9e2de 48%, #efe9d3);
  box-shadow: 0 38px 105px rgba(20,92,79,.20);
  transform: translateX(4%);
  -webkit-mask-image: radial-gradient(ellipse at 55% 50%, #000 0%, #000 72%, rgba(0,0,0,.86) 87%, transparent 100%);
  mask-image: radial-gradient(ellipse at 55% 50%, #000 0%, #000 72%, rgba(0,0,0,.86) 87%, transparent 100%);
}
.home-media__photo::before {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.34) 0%, rgba(255,255,255,.10) 24%, rgba(255,255,255,0) 58%, rgba(247,244,234,.18) 100%),
    radial-gradient(circle at 78% 18%, rgba(255,255,255,.18), transparent 28%),
    radial-gradient(circle at 28% 78%, rgba(223,234,229,.22), transparent 34%);
  pointer-events: none;
}
.home-media__photo::after {
  content: '';
  position: absolute;
  z-index: 3;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08) 0%, transparent 38%, rgba(247,244,234,.16) 100%);
  pointer-events: none;
}
.home-media__photo img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: .98;
  filter: saturate(.98) contrast(1.04) brightness(.92);
}
.home-media__loop,
.home-media__loop--gold {
  position: absolute;
  width: min(470px, 76%);
  aspect-ratio: 1;
  border: 46px solid rgba(20,92,79,.25);
  border-radius: 50%;
  right: 2%;
  top: 10%;
  transform: rotate(-16deg);
}
.home-media__loop::after {
  content: '';
  position: absolute;
  width: 128px;
  height: 46px;
  background: rgba(20,92,79,.28);
  right: 26px;
  top: 45%;
  clip-path: polygon(0 28%, 66% 28%, 66% 0, 100% 50%, 66% 100%, 66% 72%, 0 72%);
}
.home-media__loop--gold {
  border-color: rgba(182,156,52,.28);
  transform: translate(72px, -4px) rotate(16deg);
}
.home-media__loop--gold::after { display: none; }
.home-media__person {
  position: absolute;
  left: 18%;
  right: 15%;
  bottom: 0;
  height: 82%;
}
.home-media__head {
  position: absolute;
  z-index: 2;
  width: 94px;
  height: 108px;
  border-radius: 46% 46% 44% 44%;
  background: linear-gradient(135deg, #8d684f, #c79772);
  top: 7%;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: inset -12px 0 rgba(58,35,29,.18);
}
.home-media__hair {
  position: absolute;
  z-index: 1;
  width: 138px;
  height: 142px;
  border-radius: 48% 48% 40% 40%;
  background: #25201e;
  top: 2%;
  left: 50%;
  transform: translateX(-52%);
  clip-path: polygon(10% 0, 90% 0, 100% 72%, 78% 100%, 62% 58%, 32% 58%, 18% 100%, 0 72%);
  opacity: .92;
}
.home-media__body {
  position: absolute;
  z-index: 2;
  width: 230px;
  height: 250px;
  border-radius: 42% 42% 0 0;
  background: linear-gradient(135deg, #dce9f0, #9fb8c2);
  left: 50%;
  bottom: 9%;
  transform: translateX(-50%);
}
.home-media__laptop {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 7%;
  width: 320px;
  height: 176px;
  border-radius: 16px 16px 10px 10px;
  transform: translateX(-48%) perspective(580px) rotateX(3deg);
  background: linear-gradient(135deg, #c49c78, #e2c5a7);
  box-shadow: 0 24px 44px rgba(64,45,36,.20);
  display: grid;
  place-items: center;
}
.home-media__call {
  position: absolute;
  z-index: 6;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(20,92,79,.10);
  box-shadow: 0 18px 42px rgba(20,92,79,.16);
  border-radius: 18px;
}
.home-media__call {
  left: 0;
  top: 16%;
  padding: 15px 18px;
  display: grid;
  gap: 5px;
  min-width: 214px;
}
.home-media__call span {
  font-size: 12px;
  color: rgba(16,35,31,.54);
}
.home-media__call strong {
  color: #10231f;
  font-size: 15px;
}
.home-media__call em {
  font-style: normal;
  color: var(--home-green);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.home-section {
  padding: 86px clamp(24px, 7vw, 96px);
}
.home-section__intro {
  max-width: 760px;
  margin-bottom: 34px;
}
.home-label {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--home-green);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 12px;
}
.home-section h2,
.home-security h2 {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.08;
  color: #121a17;
}
.home-section__intro p {
  margin-top: 16px;
  font-size: 17px;
  color: rgba(16,35,31,.64);
  max-width: 620px;
}
.home-services {
  background: #fff;
}
.home-service-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 18px;
}
.home-service-card {
  min-height: 318px;
  border: 1px solid rgba(20,92,79,.10);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(20,92,79,.08);
  padding: 24px 22px 26px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 18px;
  color: #10231f;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.home-service-card:hover {
  transform: translateY(-3px);
  border-color: rgba(20,92,79,.20);
  box-shadow: 0 22px 48px rgba(20,92,79,.12);
}
.home-service-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--home-sage);
  color: var(--home-green);
  display: grid;
  place-items: center;
}
.home-service-card strong {
  font-size: 19px;
  line-height: 1.25;
}
.home-service-card p {
  margin: 0;
  color: rgba(16,35,31,.62);
  font-size: 14px;
  line-height: 1.56;
}
.home-steps {
  background: var(--home-cream);
}
.home-step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.home-step-card {
  padding: 28px;
  border-radius: 28px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(20,92,79,.08);
}
.home-step-card span {
  font-family: var(--mono);
  color: var(--home-gold);
  font-weight: 700;
}
.home-step-card h3 {
  margin-top: 36px;
  font-size: 25px;
  color: #10231f;
  letter-spacing: 0;
}
.home-step-card p {
  margin: 12px 0 0;
  color: rgba(16,35,31,.62);
}
.home-network {
  background: #fff;
}
.home-doctor-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.home-doctor-card {
  border: 1px solid rgba(20,92,79,.10);
  background: #fff;
  border-radius: 24px;
  padding: 22px;
  display: grid;
  gap: 16px;
  align-content: start;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(20,92,79,.08);
  min-height: 318px;
}
.home-doctor-card__avatar {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-family: var(--display);
}
.home-doctor-card strong,
.home-doctor-card span,
.home-doctor-card em,
.home-doctor-card p {
  display: block;
}
.home-doctor-card strong {
  font-size: 18px;
  color: #10231f;
  line-height: 1.16;
}
.home-doctor-card span {
  margin-top: 6px;
  color: rgba(16,35,31,.60);
  font-size: 13px;
  line-height: 1.35;
}
.home-doctor-card p {
  margin: 12px 0 0;
  color: rgba(16,35,31,.62);
  font-size: 13px;
  line-height: 1.48;
}
.home-doctor-card em {
  margin-top: 14px;
  color: var(--home-green);
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.home-security {
  padding: 70px clamp(24px, 7vw, 96px);
  background: var(--home-green-dark);
  color: #fff;
  display: grid;
  grid-template-columns: minmax(260px, .8fr) 1.2fr;
  gap: 46px;
  align-items: start;
}
.home-reviews {
  background: #fff;
}
.home-review-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.home-review-card {
  border: 1px solid rgba(20,92,79,.10);
  border-radius: 24px;
  background: #fff;
  padding: 24px;
  box-shadow: 0 14px 34px rgba(20,92,79,.08);
}
.home-review-card__stars {
  color: var(--home-gold);
  letter-spacing: 0;
  font-size: 18px;
  margin-bottom: 14px;
}
.home-review-card p {
  margin: 0 0 18px;
  color: rgba(16,35,31,.68);
  line-height: 1.55;
}
.home-review-card strong {
  color: #10231f;
}
.home-review-empty {
  border: 1px dashed rgba(20,92,79,.22);
  border-radius: 24px;
  padding: 28px;
  color: rgba(16,35,31,.62);
  background: rgba(247,244,234,.58);
}
.home-review-page {
  width: min(680px, 100%);
  background: #fff;
  border: 1px solid rgba(20,92,79,.12);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(20,92,79,.14);
  padding: 34px;
}
.home-review-page h1 {
  font-size: 38px;
  letter-spacing: 0;
  color: #10231f;
  margin: 12px 0;
}
.home-review-page p {
  color: rgba(16,35,31,.66);
  line-height: 1.55;
}
.home-review-stars {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}
.home-review-stars button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(20,92,79,.14);
  background: #fff;
  color: rgba(16,35,31,.25);
  font-size: 23px;
  cursor: pointer;
}
.home-review-stars button.is-on {
  background: #f5f1e4;
  color: var(--home-gold);
  border-color: rgba(182,156,52,.35);
}
.home-security h2 {
  color: #fff;
}
.home-security .home-label {
  color: #d8ca80;
}
.home-security__items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.home-security__items div {
  border-left: 1px solid rgba(255,255,255,.20);
  padding-left: 18px;
}
.home-security__items svg {
  color: #d8ca80;
  margin-bottom: 12px;
}
.home-security__items strong {
  display: block;
  margin-bottom: 8px;
}
.home-security__items p {
  margin: 0;
  color: rgba(255,255,255,.68);
  font-size: 14px;
  line-height: 1.55;
}
.home-footer {
  min-height: 72px;
  padding: 22px clamp(24px, 7vw, 96px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(16,35,31,.58);
  background: #fff;
}
.home-footer button {
  color: var(--home-green);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 1060px) {
  .home-nav { gap: 18px; }
  .home-nav__links { gap: 16px; }
  .home-hero {
    grid-template-columns: 1fr;
    padding-top: 64px;
  }
  .home-media { min-height: 460px; }
  .home-service-grid { grid-template-columns: repeat(3, 1fr); }
  .home-doctor-grid,
  .home-security,
  .home-security__items { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .home-nav {
    min-height: auto;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 14px 18px;
  }
  .home-nav__links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .home-nav__actions { margin-left: auto; }
  .home-link { display: none; }
  .home-hero { padding: 42px 20px 56px; }
  .home-hero h1 { font-size: 43px; }
  .home-hero p { font-size: 16px; }
  .home-media { min-height: 390px; }
  .home-media__call { left: 6px; top: 8%; min-width: 176px; }
  .home-media__laptop { width: 250px; height: 138px; }
  .home-section { padding: 58px 20px; }
  .home-service-grid,
  .home-step-grid,
  .home-doctor-grid,
  .home-review-grid {
    grid-template-columns: 1fr;
  }
  .home-security { padding: 54px 20px; }
}
`;

Object.assign(window, { MarketingHome, MolaraReviewPage });
