/* =====================================================================
   AYURPHILIA — Design System
   Concept: "The Apothecary Ledger" — an old Ayurvedic pharmacy register.
   Doctor approval = a stamped, verified ledger entry. Ingredients,
   prescriptions, and index cards give structure its shape.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Work+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* --- Color tokens --- */
  --ink-green: #1B3A2F;
  --ink-green-soft: #234a3c;
  --turmeric: #C89B3C;
  --turmeric-light: #E0BD6B;
  --madder: #8C3B2E;
  --madder-light: #A85242;
  --parchment: #F3EAD3;
  --parchment-dark: #EADFC2;
  --sandalwood: #D9C9A3;
  --neem: #6B8F71;
  --ink: #241F16;
  --ink-soft: #56503f;
  --white: #FFFDF8;

  /* --- Type --- */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;

  /* --- Layout --- */
  --max-width: 1200px;
  --radius: 6px;
  --shadow-card: 0 6px 20px rgba(27, 58, 47, 0.10);
  --shadow-lift: 0 14px 34px rgba(27, 58, 47, 0.18);
  --border-dotted: repeating-linear-gradient(90deg, var(--ink-green) 0, var(--ink-green) 6px, transparent 6px, transparent 14px);
}

/* ---------------------------------------------------------------------
   Reset & base
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--parchment);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink-green);
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: 1.15;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--madder);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--madder);
  display: inline-block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 96px 0; position: relative; }
.section-tight { padding: 64px 0; }

.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* Focus visibility (accessibility) */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--turmeric);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--madder);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(140, 59, 46, 0.35);
}
.btn-primary:hover { background: var(--madder-light); box-shadow: 0 10px 24px rgba(140, 59, 46, 0.45); transform: translateY(-2px); }
.btn-outline {
  background: transparent;
  border-color: var(--ink-green);
  color: var(--ink-green);
}
.btn-outline:hover { background: var(--ink-green); color: var(--white); transform: translateY(-2px); }
.btn-gold {
  background: var(--turmeric);
  color: var(--ink-green);
  box-shadow: 0 8px 20px rgba(200, 155, 60, 0.35);
}
.btn-gold:hover { background: var(--turmeric-light); transform: translateY(-2px); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ---------------------------------------------------------------------
   Header / Nav
   --------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(243, 234, 211, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.site-header.scrolled {
  box-shadow: 0 4px 16px rgba(27, 58, 47, 0.08);
  border-bottom-color: var(--sandalwood);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--ink-green); }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; }

.main-nav { display: flex; align-items: center; gap: 36px; }
.main-nav a { font-weight: 500; font-size: 0.95rem; color: var(--ink-soft); position: relative; padding: 4px 0; }
.main-nav a::after {
  content: ''; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px;
  background: var(--madder); transition: width 0.25s ease;
}
.main-nav a:hover { color: var(--ink-green); }
.main-nav a:hover::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-toggle {
  display: none; background: none; border: none; width: 42px; height: 42px;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink-green); transition: transform 0.25s ease, opacity 0.25s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------------------------------------------------------------
   Hero — "The Stamped Ledger"
   --------------------------------------------------------------------- */
.hero { padding: 72px 0 56px; overflow: hidden; }
.hero .container { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero-copy h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); margin: 18px 0 20px; }
.hero-copy h1 em { font-style: italic; color: var(--madder); }
.hero-copy p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 46ch; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }

.perforation {
  height: 1px; background-image: var(--border-dotted); background-repeat: repeat-x;
  background-size: 14px 1px; margin: 32px 0 24px; opacity: 0.55;
}

.ledger-tally { display: flex; gap: 40px; flex-wrap: wrap; }
.ledger-tally .stat { font-family: var(--font-mono); }
.ledger-tally .stat .num {
  font-size: 1.9rem; font-weight: 700; color: var(--ink-green); display: block;
}
.ledger-tally .stat .label { font-size: 0.72rem; letter-spacing: 0.06em; color: var(--ink-soft); text-transform: uppercase; }

/* Hero visual: still-life card with stamp seal */
.hero-visual { position: relative; display: flex; justify-content: center; align-items: center; }
.apothecary-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lift);
  border: 1px solid var(--sandalwood);
}
.apothecary-card::before {
  content: '';
  position: absolute; inset: 10px;
  border: 1px dashed var(--sandalwood);
  border-radius: 4px;
  pointer-events: none;
}
.apothecary-card svg { width: 100%; height: auto; }

.stamp-seal {
  position: absolute;
  top: -22px;
  right: -22px;
  width: 118px;
  height: 118px;
  animation: stamp-in 900ms cubic-bezier(.2,1.6,.4,1) both;
  animation-delay: 400ms;
  filter: drop-shadow(0 6px 10px rgba(140,59,46,0.35));
}
@keyframes stamp-in {
  0%   { transform: scale(2.6) rotate(-18deg); opacity: 0; }
  60%  { transform: scale(0.92) rotate(-10deg); opacity: 1; }
  80%  { transform: scale(1.06) rotate(-12deg); }
  100% { transform: scale(1) rotate(-10deg); }
}

/* ---------------------------------------------------------------------
   About
   --------------------------------------------------------------------- */
.about .container { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
.about-figure { position: relative; }
.about-figure .ring {
  position: absolute; inset: -18px; border: 1px solid var(--turmeric); border-radius: 50%;
  opacity: 0.5;
}
.about-figure img, .about-figure svg { border-radius: 50%; aspect-ratio: 1/1; object-fit: cover; }

/* ---------------------------------------------------------------------
   Benefits — "ingredient labels"
   --------------------------------------------------------------------- */
.benefits-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.benefit-jar {
  background: var(--white);
  border: 1px solid var(--sandalwood);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.benefit-jar:hover { transform: translateY(-6px); box-shadow: var(--shadow-card); }
.benefit-jar .icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--parchment-dark); display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px; color: var(--madder);
}
.benefit-jar h3 { font-size: 1.2rem; margin-bottom: 6px; }
.benefit-jar p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }
.benefit-jar .tag {
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--neem); text-transform: uppercase;
  letter-spacing: 0.08em; display: block; margin-top: 14px;
}

/* ---------------------------------------------------------------------
   Featured Doctors — index cards
   --------------------------------------------------------------------- */
.doctors-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.doctor-card {
  background: var(--white); border: 1px solid var(--sandalwood); border-radius: var(--radius);
  overflow: hidden; position: relative; transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.doctor-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lift); }
.doctor-photo { aspect-ratio: 4/3; background: var(--parchment-dark) center/cover; position: relative; }
.doctor-photo .avatar-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 2.2rem; color: var(--ink-green); background: var(--sandalwood);
}
.verified-badge {
  position: absolute; top: 10px; right: 10px; background: var(--ink-green); color: var(--white);
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 4px; display: flex; align-items: center; gap: 4px;
  transform: rotate(-4deg);
}
.doctor-info { padding: 18px; }
.doctor-info h3 { font-size: 1.15rem; margin-bottom: 2px; }
.doctor-info .spec { color: var(--madder); font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; }
.doctor-info .meta { font-size: 0.82rem; color: var(--ink-soft); display: flex; justify-content: space-between; }

/* ---------------------------------------------------------------------
   Daily Tip — torn note w/ washi tape
   --------------------------------------------------------------------- */
.tip-banner {
  background: var(--ink-green);
  border-radius: var(--radius);
  padding: 44px;
  position: relative;
  color: var(--parchment);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
}
.tip-banner .washi {
  position: absolute; top: -14px; left: 42px; width: 90px; height: 26px;
  background: repeating-linear-gradient(45deg, var(--turmeric), var(--turmeric) 6px, var(--turmeric-light) 6px, var(--turmeric-light) 12px);
  opacity: 0.9; transform: rotate(-4deg);
}
.tip-icon { width: 56px; height: 56px; color: var(--turmeric); flex-shrink: 0; }
.tip-banner h3 { color: var(--parchment); }
.tip-banner p { color: var(--sandalwood); margin: 0; font-size: 1.05rem; }

/* ---------------------------------------------------------------------
   Articles
   --------------------------------------------------------------------- */
.articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.article-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--sandalwood); transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.article-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-card); }
.article-thumb { aspect-ratio: 16/10; background: var(--parchment-dark); }
.article-body { padding: 20px; }
.article-body .date { font-family: var(--font-mono); font-size: 0.72rem; color: var(--neem); text-transform: uppercase; }
.article-body h3 { font-size: 1.15rem; margin: 8px 0; }
.article-body p { color: var(--ink-soft); font-size: 0.92rem; }

/* ---------------------------------------------------------------------
   Testimonials — carousel
   --------------------------------------------------------------------- */
.testimonial-wrap { position: relative; max-width: 760px; margin: 0 auto; text-align: center; }
.testimonial-slide { display: none; animation: fade-in 0.5s ease; }
.testimonial-slide.active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.testimonial-quote { font-family: var(--font-display); font-size: 1.5rem; font-style: italic; color: var(--ink-green); }
.testimonial-author { margin-top: 18px; font-weight: 600; }
.testimonial-role { color: var(--ink-soft); font-size: 0.9rem; }
.testimonial-dots { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }
.testimonial-dots button {
  width: 9px; height: 9px; border-radius: 50%; background: var(--sandalwood); border: none; padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}
.testimonial-dots button.active { background: var(--madder); transform: scale(1.3); }

/* ---------------------------------------------------------------------
   CTA banner
   --------------------------------------------------------------------- */
.cta-banner {
  background: var(--madder);
  border-radius: var(--radius);
  padding: 56px;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.cta-banner h2 { color: var(--white); font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
.cta-banner p { color: rgba(255,255,255,0.85); max-width: 52ch; margin: 0 auto 28px; }
.cta-banner .btn-gold { color: var(--ink); }

/* ---------------------------------------------------------------------
   Contact + Newsletter
   --------------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.contact-form-card, .newsletter-card {
  background: var(--white); border: 1px solid var(--sandalwood); border-radius: var(--radius); padding: 32px;
}
.field { margin-bottom: 20px; position: relative; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-green); }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border-radius: 4px; border: 1.5px solid var(--sandalwood);
  font-family: var(--font-body); font-size: 0.95rem; background: var(--parchment); transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--ink-green); box-shadow: 0 0 0 3px rgba(27,58,47,0.12);
}
.field textarea { min-height: 120px; resize: vertical; }
.field .error-msg {
  display: none; color: var(--madder); font-size: 0.8rem; margin-top: 6px; font-weight: 500;
}
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--madder); animation: shake 0.35s ease; }
.field.invalid .error-msg { display: block; }
.field.valid input, .field.valid textarea, .field.valid select { border-color: var(--neem); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.password-meter { height: 5px; border-radius: 3px; background: var(--sandalwood); margin-top: 8px; overflow: hidden; }
.password-meter-fill { height: 100%; width: 0%; transition: width 0.25s ease, background 0.25s ease; background: var(--madder); }
.password-hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 6px; }
.password-hint .ok { color: var(--neem); font-weight: 600; }

/* ---------------------------------------------------------------------
   Panel card (shared with the portal shell — used by faq.php, page.php)
   --------------------------------------------------------------------- */
.panel { background: var(--white); border: 1px solid var(--sandalwood); border-radius: var(--radius); padding: 26px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.panel-head h2 { font-size: 1.15rem; margin: 0; }

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.site-footer { background: var(--ink-green); color: var(--parchment); padding-top: 64px; }
.footer-stitch {
  height: 2px;
  background-image: repeating-linear-gradient(90deg, var(--turmeric) 0, var(--turmeric) 8px, transparent 8px, transparent 18px);
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-brand .brand { color: var(--parchment); }
.footer-brand p { color: var(--sandalwood); font-size: 0.9rem; max-width: 32ch; }
.footer-col h4 { color: var(--turmeric); font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 16px; }
.footer-col a, .footer-col li { color: var(--sandalwood); font-size: 0.92rem; margin-bottom: 10px; display: block; }
.footer-col a:hover { color: var(--turmeric); }
.social-row { display: flex; gap: 12px; margin-top: 16px; }
.social-row a {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--sandalwood);
  display: flex; align-items: center; justify-content: center; transition: background 0.2s ease, border-color 0.2s ease;
}
.social-row a:hover { background: var(--turmeric); border-color: var(--turmeric); color: var(--ink-green); }
.footer-bottom {
  border-top: 1px solid rgba(217,201,163,0.25); padding: 20px 0 28px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 0.85rem; color: var(--sandalwood);
}
.footer-bottom .credit { font-weight: 600; color: var(--turmeric); }

/* ---------------------------------------------------------------------
   Toasts (client-side JS feedback)
   --------------------------------------------------------------------- */
.toast-stack { position: fixed; top: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink-green); color: var(--white); padding: 14px 20px; border-radius: 6px;
  box-shadow: var(--shadow-lift); font-size: 0.9rem; display: flex; align-items: center; gap: 10px;
  animation: toast-in 0.3s ease;
  max-width: 320px;
}
.toast.error { background: var(--madder); }
.toast.success { background: var(--neem); }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* ---------------------------------------------------------------------
   Scroll reveal
   --------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-stagger.in-view > * { animation: rise-in 0.6s ease both; }
.reveal-stagger.in-view > *:nth-child(1) { animation-delay: 0.05s; }
.reveal-stagger.in-view > *:nth-child(2) { animation-delay: 0.15s; }
.reveal-stagger.in-view > *:nth-child(3) { animation-delay: 0.25s; }
.reveal-stagger.in-view > *:nth-child(4) { animation-delay: 0.35s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .doctors-grid { grid-template-columns: repeat(2, 1fr); }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .benefits-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .main-nav { position: fixed; top: 78px; left: 0; right: 0; background: var(--parchment);
    flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 24px 20px;
    box-shadow: 0 12px 20px rgba(0,0,0,0.08); transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease; }
  .main-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .main-nav a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--sandalwood); }
  .nav-toggle { display: flex; }
  .nav-actions .btn-outline { display: none; }

  .hero .container, .about .container { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 360px; margin: 0 auto 32px; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  section { padding: 64px 0; }
  .doctors-grid, .articles-grid, .benefits-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .ledger-tally { gap: 24px; }
  .tip-banner { grid-template-columns: 1fr; text-align: center; }
  .tip-icon { margin: 0 auto; }
  .cta-banner { padding: 36px 22px; }
  .hero-actions .btn { width: 100%; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
