/* ==========================================================================
   PILMATE — CORE STYLES  (Purple Premium Theme)
   Reset, base, typography, layout utilities, and all section-level styles.
   ========================================================================== */

@import url('./variables.css');

/* --------------------------------------------------------------------------
   1. RESET & BOX-MODEL
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   2. BASE / BODY
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: var(--line-height-body);
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY  (Manrope hierarchy)
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  line-height: var(--line-height-heading);
  color: var(--ink);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--h1-size); }
h2 { font-size: var(--h2-size); }
h3 { font-size: var(--h3-size); }
h4 { font-size: var(--h4-size); }

h5,
h6 {
  font-family: var(--font-heading);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p {
  line-height: 1.75;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* --------------------------------------------------------------------------
   4. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

section {
  padding-top: var(--section-pad-v);
  padding-bottom: var(--section-pad-v);
}

.text-center {
  text-align: center;
}

.text-center .section-sub {
  margin: 0 auto;
}

.bg-alt {
  background: var(--gradient-light);
}

/* --------------------------------------------------------------------------
   5. SECTION TYPOGRAPHY HELPERS
   -------------------------------------------------------------------------- */
.section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-mid);
  background: var(--teal-light);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.section-title {
  font-size: var(--h2-size);
  font-weight: 800;
  color: var(--ink);
  margin-bottom: var(--space-2);
  letter-spacing: -0.03em;
}

.section-sub {
  font-size: var(--font-size-base);
  color: var(--muted);
  max-width: 640px;
  line-height: var(--line-height-body);
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   6. NAVIGATION
   -------------------------------------------------------------------------- */
nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  isolation: isolate;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(86, 0, 130, 0.08);
  transition: box-shadow var(--transition-med);
}

body.nav-menu-open {
  overflow: hidden;
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  touch-action: none;
}

body.nav-menu-open nav {
  z-index: var(--z-modal);
}

nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 72px;
  gap: var(--space-2);
}

.nav-inner > .logo {
  justify-self: start;
}

.nav-inner > .nav-links {
  justify-self: center;
  grid-column: 2;
}

.nav-inner > .nav-cta,
.nav-inner > .nav-hamburger,
.nav-inner > .nav-close {
  justify-self: end;
  grid-column: 3;
}

.nav-close {
  display: none;
}

/* Mobile menu backdrop — toggled via body.nav-menu-open */
body.nav-menu-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(26, 10, 46, 0.45);
  z-index: calc(var(--z-modal) - 1);
  opacity: 1;
  transition: opacity 0.3s ease;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 21px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.03em;
}

/* Logo image (replaces the old inline SVG icon) */
.logo-img {
  height: 38px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Footer variant — slightly smaller, original logo colors */
.logo-img--footer {
  height: 34px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.75rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform var(--transition-med);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--teal);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

/* Hamburger — hidden on desktop */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  z-index: var(--z-nav-control);
  transition: background var(--transition);
}

.nav-hamburger:hover {
  background: var(--teal-light);
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transform-origin: center;
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s ease,
    width 0.3s ease;
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   7. HERO
   -------------------------------------------------------------------------- */
.hero {
  background: var(--gradient-hero);
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
  overflow: hidden;
  position: relative;
}

/* Decorative orbs */
.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(181, 137, 212, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: 5%;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 165, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: var(--h1-size);
  font-weight: 800;
  color: white;
  line-height: var(--line-height-heading);
  margin-bottom: var(--space-3);
  letter-spacing: -0.04em;
}

.hero h1 .hero-h1-line {
  white-space: nowrap;
}

.hero h1 span:not(.hero-h1-line) {
  /* Gradient text accent on the highlight word */
  background: linear-gradient(90deg, #b589d4 0%, #d8b8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  margin-bottom: var(--space-4);
  max-width: 520px;
  font-weight: 400;
}

.hero-btns {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Hero app showcase — styles in components.css (.hero-showcase) */

/* --------------------------------------------------------------------------
   8. TRUST BADGES
   -------------------------------------------------------------------------- */
.trust {
  background: rgba(238, 231, 246, 0.5);
  padding: var(--space-4) var(--container-pad);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.trust-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   9. FEATURES GRID
   -------------------------------------------------------------------------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* --------------------------------------------------------------------------
   9b. PROCESS STEPS (How It Works)
   -------------------------------------------------------------------------- */
.steps-process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* --------------------------------------------------------------------------
   10. HOW IT WORKS
   -------------------------------------------------------------------------- */
.how-section {
  background: linear-gradient(145deg, #1a0a2e 0%, #270c3c 50%, #2d1050 100%);
  position: relative;
  overflow: hidden;
}

/* Decorative orb in dark section */
.how-section::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -60px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(86, 0, 130, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.how-section .section-title { color: white; letter-spacing: -0.03em; }
.how-section .section-sub   { color: rgba(255, 255, 255, 0.58); }
.how-section .section-label {
  background: rgba(124, 58, 165, 0.25);
  color: var(--purple-light);
}

.flows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

/* --------------------------------------------------------------------------
   11. DOCTOR CONSULTATION
   -------------------------------------------------------------------------- */
.consult-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-top: 2rem;
}

/* --------------------------------------------------------------------------
   12. PHARMACY SECTION
   -------------------------------------------------------------------------- */
.pharmacy-section {
  background: var(--gradient-light);
}

.pharmacy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-top: 2rem;
}

.pharmacy-benefits {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* --------------------------------------------------------------------------
   13. SUBSCRIPTION
   -------------------------------------------------------------------------- */
.sub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

/* --------------------------------------------------------------------------
   14. DELIVERY
   -------------------------------------------------------------------------- */
.delivery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

/* --------------------------------------------------------------------------
   15. TESTIMONIALS
   -------------------------------------------------------------------------- */
.testi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

/* --------------------------------------------------------------------------
   16. FAQ
   -------------------------------------------------------------------------- */
.faq-list {
  max-width: 860px;
  margin: var(--space-5) auto 0;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-q {
  padding: 1.15rem 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-heading);
  user-select: none;
  transition: color var(--transition);
  letter-spacing: -0.01em;
}

.faq-q:hover {
  color: var(--teal);
}

.faq-toggle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--teal);
  transition: transform var(--transition-med), background var(--transition);
}

.faq-item.open .faq-toggle {
  transform: rotate(45deg);
  background: var(--teal);
  color: white;
}

.faq-a {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow), padding var(--transition-med);
  padding-bottom: 0;
}

.faq-item.open .faq-a {
  max-height: 32rem;
  padding-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   17. DOWNLOAD CTA
   -------------------------------------------------------------------------- */
.download-section {
  background: var(--gradient-cta);
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.download-section .container {
  position: relative;
  z-index: 1;
}

.download-section::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(181, 137, 212, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.download-section h2 {
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 800;
  color: white;
  margin-bottom: 1rem;
  letter-spacing: -0.04em;
}

.download-section p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  margin-bottom: 2.5rem;
}

.store-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   18. FOOTER
   -------------------------------------------------------------------------- */
footer {
  background: linear-gradient(180deg, #1a0a2e 0%, #270c3c 100%);
  color: rgba(255, 255, 255, 0.65);
  padding-top: var(--space-6);
  padding-bottom: var(--space-4);
}

.footer-grid {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand p {
  font-size: 14px;
  line-height: var(--line-height-body);
  margin-top: var(--space-2);
  max-width: 320px;
  font-weight: 400;
}

.footer-col h5 {
  font-size: 11px;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  font-family: var(--font-heading);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-col ul a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  transition: color var(--transition);
  font-weight: 400;
}

.footer-col ul a:hover {
  color: var(--purple-light);
}

.footer-bottom {
  width: 100%;
  max-width: var(--container-max);
  margin: var(--space-4) auto 0;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-bottom a:hover {
  color: rgba(255, 255, 255, 0.65);
}

/* --------------------------------------------------------------------------
   19. FADE-IN ANIMATION SUPPORT
   Content is visible by default; JS adds .animate-on-scroll for off-screen
   elements so cards stay readable when modules fail to load (e.g. file://).
   -------------------------------------------------------------------------- */
.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.fade-in.animate-on-scroll {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.58s ease, transform 0.58s ease;
}

.fade-in.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   20. PAGE HERO (inner pages)
   -------------------------------------------------------------------------- */
.page-hero {
  background: var(--gradient-hero);
  padding: 5.5rem var(--section-pad-h) 4.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(181, 137, 212, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: 5%;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 165, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero .section-label {
  background: rgba(181, 137, 212, 0.2);
  color: var(--purple-light);
}

.page-hero h1 {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  color: white;
  margin-bottom: 1rem;
  letter-spacing: -0.04em;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 17px;
  max-width: 600px;
  margin: 0 auto;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   21. LEGAL PAGES
   -------------------------------------------------------------------------- */
.legal-body {
  width: 100%;
}

.legal-body h2 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.legal-body h3 {
  font-size: 15px;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--ink2);
  letter-spacing: -0.01em;
}

.legal-body p,
.legal-body li {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.85;
  margin-bottom: 0.75rem;
}

.legal-body ul {
  list-style: disc;
  padding-left: 1.5rem;
}

.legal-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.legal-body a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}

.legal-body a:hover {
  text-decoration: underline;
}

.legal-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.legal-body strong {
  color: var(--ink2);
  font-weight: 600;
}

.legal-ack {
  margin-top: 2.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--teal-light);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
}

.legal-ack p {
  margin-bottom: 0;
  color: var(--ink2);
  font-weight: 500;
}

.legal-contact {
  margin-top: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.legal-contact p {
  margin-bottom: 0.5rem;
}

.legal-contact p:last-child {
  margin-bottom: 0;
}

.legal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.legal-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.legal-download-btn:hover {
  border-color: var(--teal-mid);
  box-shadow: var(--shadow-sm);
  transform: scale(1.02);
}

.legal-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 96px;
  z-index: var(--z-sticky-content);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

body.nav-menu-open .legal-toc {
  z-index: 1;
  pointer-events: none;
}

.legal-toc h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.legal-toc ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-toc a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  line-height: 1.4;
}

.legal-toc a:hover,
.legal-toc a.active {
  background: var(--teal-light);
  color: var(--teal);
}

.legal-toc a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
