/* ═══════════════════════════════════════════════════════════
   IRONIC TEETH CLUB — Design System & Styles
   Premium Dental Brand • New York City
   ═══════════════════════════════════════════════════════════ */

/* ─── 1. DESIGN TOKENS ──────────────────────────────────── */
:root {
  /* Color Palette */
  --color-bg:             #FAFAF7;
  --color-bg-warm:        #F6F5F0;
  --color-surface:        #F0EFEA;
  --color-surface-elevated: #FFFFFF;
  --color-primary:        #1A1F2E;
  --color-secondary:      #5A6070;
  --color-tertiary:       #8A8F9D;
  --color-accent:         #4A7C72;
  --color-accent-hover:   #3D6960;
  --color-accent-light:   #EAF2EF;
  --color-accent-subtle:  #F4F9F7;
  --color-border:         #E5E3DE;
  --color-border-light:   #EDEBE7;
  --color-card:           #FFFFFF;
  --color-overlay:        rgba(26, 31, 46, 0.6);
  --color-success:        #3D8B6E;
  --color-success-bg:     #EDFAF3;
  --color-error:          #C75B5B;
  --color-error-bg:       #FDF2F2;
  --color-warning:        #D4A843;
  --color-warning-bg:     #FDF9EE;

  /* Typography */
  --font-serif:   'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Fluid Type Scale */
  --text-xs:      clamp(0.6875rem, 0.65rem + 0.19vw, 0.8125rem);
  --text-sm:      clamp(0.8125rem, 0.78rem + 0.16vw, 0.875rem);
  --text-base:    clamp(0.9375rem, 0.9rem + 0.19vw, 1rem);
  --text-lg:      clamp(1.0625rem, 1rem + 0.31vw, 1.125rem);
  --text-xl:      clamp(1.1875rem, 1.05rem + 0.69vw, 1.375rem);
  --text-2xl:     clamp(1.375rem, 1.15rem + 1.13vw, 1.75rem);
  --text-3xl:     clamp(1.75rem, 1.4rem + 1.75vw, 2.5rem);
  --text-4xl:     clamp(2.25rem, 1.7rem + 2.75vw, 3.25rem);
  --text-5xl:     clamp(2.75rem, 1.9rem + 4.25vw, 4.25rem);
  --text-display: clamp(3.25rem, 2rem + 6.25vw, 5.5rem);

  /* Line Heights */
  --leading-none:   1;
  --leading-tight:  1.15;
  --leading-snug:   1.3;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* Letter Spacing */
  --tracking-tight:   -0.02em;
  --tracking-normal:  0;
  --tracking-wide:    0.04em;
  --tracking-wider:   0.08em;
  --tracking-widest:  0.14em;

  /* Spacing Scale */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --space-40: 10rem;
  --space-48: 12rem;

  /* Section Spacing */
  --section-py: clamp(5rem, 4rem + 5vw, 9rem);
  --section-py-sm: clamp(3rem, 2.5rem + 2.5vw, 5rem);

  /* Container */
  --container-max:     1280px;
  --container-narrow:  720px;
  --container-wide:    1440px;
  --container-padding: clamp(1.25rem, 0.75rem + 2.5vw, 3rem);

  /* Border Radius */
  --radius-xs:   2px;
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(26, 31, 46, 0.03);
  --shadow-sm:  0 1px 3px rgba(26, 31, 46, 0.04), 0 1px 2px rgba(26, 31, 46, 0.03);
  --shadow-md:  0 4px 6px rgba(26, 31, 46, 0.04), 0 2px 4px rgba(26, 31, 46, 0.03);
  --shadow-lg:  0 10px 24px rgba(26, 31, 46, 0.06), 0 4px 8px rgba(26, 31, 46, 0.03);
  --shadow-xl:  0 20px 48px rgba(26, 31, 46, 0.08), 0 8px 16px rgba(26, 31, 46, 0.04);

  /* Transitions */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast:   150ms;
  --duration-base:   300ms;
  --duration-slow:   500ms;
  --duration-slower: 700ms;

  /* Z-index */
  --z-base:     1;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;

  /* Navbar */
  --nav-height: 72px;
  --nav-height-scrolled: 64px;
}

/* ─── 2. RESET & BASE ────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-height) + 2rem);
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  font-style: italic;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
  max-width: 68ch;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--color-accent-light);
  color: var(--color-primary);
}

/* ─── 3. TYPOGRAPHY ──────────────────────────────────────── */
.font-serif { font-family: var(--font-serif); }
.font-sans  { font-family: var(--font-sans); }

.text-display {
  font-family: var(--font-serif);
  font-size: var(--text-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 400;
}

h1, .text-h1 {
  font-family: var(--font-serif);
  font-size: var(--text-5xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 400;
}

h2, .text-h2 {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 400;
}

h3, .text-h3 {
  font-family: var(--font-sans);
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  font-weight: 500;
}

h4, .text-h4 {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  font-weight: 500;
}

.text-body-lg {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

.text-body {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.text-small {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.text-xs {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}

.text-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-secondary);
}

.text-secondary { color: var(--color-secondary); }
.text-tertiary  { color: var(--color-tertiary); }
.text-accent    { color: var(--color-accent); }

/* ─── 4. LAYOUT ──────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

.section {
  padding-block: var(--section-py);
}

.section--sm {
  padding-block: var(--section-py-sm);
}

.section--surface {
  background: var(--color-surface);
}

.section--warm {
  background: var(--color-bg-warm);
}

.section--dark {
  background: var(--color-primary);
  color: var(--color-bg);
}

.section--dark .text-secondary,
.section--dark .text-label {
  color: rgba(250, 250, 247, 0.6);
}

.grid {
  display: grid;
  gap: var(--space-8);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── 5. ANNOUNCEMENT BAR ────────────────────────────────── */
.announcement-bar {
  background: var(--color-primary);
  color: var(--color-bg);
  padding: var(--space-2) var(--container-padding);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  position: relative;
  z-index: var(--z-sticky);
}

.announcement-bar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  max-width: var(--container-wide);
  margin: 0 auto;
}

.announcement-bar__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  opacity: 0.85;
}

.announcement-bar__divider {
  width: 1px;
  height: 12px;
  background: rgba(250, 250, 247, 0.2);
}

/* ─── 6. NAVIGATION ──────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: all var(--duration-base) var(--ease-out);
  height: var(--nav-height);
}

.navbar.scrolled {
  border-bottom-color: var(--color-border);
  background: rgba(250, 250, 247, 0.97);
  height: var(--nav-height-scrolled);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding-inline: var(--container-padding);
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
  color: var(--color-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar__logo-mark {
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.navbar__link {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-secondary);
  border-radius: var(--radius-md);
  transition: color var(--duration-fast) var(--ease-in-out),
              background var(--duration-fast) var(--ease-in-out);
  white-space: nowrap;
}

.navbar__link:hover,
.navbar__link:focus-visible {
  color: var(--color-primary);
  background: var(--color-surface);
}

.navbar__link--active {
  color: var(--color-primary);
  font-weight: 500;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.navbar__call {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-secondary);
  border-radius: var(--radius-md);
  transition: color var(--duration-fast) var(--ease-in-out);
}

.navbar__call:hover {
  color: var(--color-primary);
}

/* Mobile Menu Toggle */
.navbar__toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: background var(--duration-fast) var(--ease-in-out);
}

.navbar__toggle:hover {
  background: var(--color-surface);
}

.navbar__toggle-icon {
  width: 20px;
  height: 14px;
  position: relative;
}

.navbar__toggle-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  position: absolute;
  left: 0;
  transition: all var(--duration-base) var(--ease-out);
}

.navbar__toggle-icon span:first-child { top: 0; }
.navbar__toggle-icon span:nth-child(2) { top: 6px; }
.navbar__toggle-icon span:last-child { top: 12px; }

.navbar__toggle.active .navbar__toggle-icon span:first-child {
  top: 6px;
  transform: rotate(45deg);
}

.navbar__toggle.active .navbar__toggle-icon span:nth-child(2) {
  opacity: 0;
  transform: translateX(-8px);
}

.navbar__toggle.active .navbar__toggle-icon span:last-child {
  top: 6px;
  transform: rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--nav-height);
  background: var(--color-bg);
  z-index: var(--z-overlay);
  padding: var(--space-8) var(--container-padding);
  flex-direction: column;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
}

.mobile-menu.open {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu__link {
  display: block;
  padding: var(--space-4) 0;
  font-size: var(--text-xl);
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-border-light);
  transition: color var(--duration-fast) var(--ease-in-out);
}

.mobile-menu__link:hover {
  color: var(--color-accent);
}

.mobile-menu__cta {
  margin-top: var(--space-8);
}

/* ─── 7. BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: var(--color-accent);
  color: #FFFFFF;
  padding: var(--space-4) var(--space-8);
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-8);
}

.btn--secondary:hover {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #FFFFFF;
}

.btn--ghost {
  background: transparent;
  color: var(--color-accent);
  padding: var(--space-2) var(--space-4);
}

.btn--ghost:hover {
  background: var(--color-accent-light);
}

.btn--sm {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-xs);
}

.btn--lg {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-base);
}

.btn--dark {
  background: var(--color-primary);
  color: #FFFFFF;
}

.btn--dark:hover {
  background: #2A2F3E;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--white {
  background: #FFFFFF;
  color: var(--color-primary);
}

.btn--white:hover {
  background: var(--color-bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn--full {
  width: 100%;
}

/* ─── 8. HERO ────────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - var(--nav-height) - 36px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
  padding-block: var(--space-16);
}

.hero__content {
  max-width: 600px;
}

.hero__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent-light);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  color: var(--color-accent);
  margin-bottom: var(--space-8);
}

.hero__label-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

.hero__title {
  margin-bottom: var(--space-6);
}

.hero__title em {
  font-style: italic;
  color: var(--color-accent);
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-10);
  max-width: 480px;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero__image {
  position: relative;
  height: 100%;
  min-height: 500px;
  border-radius: var(--radius-2xl);
  overflow: hidden;
}

.hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__image-badge {
  position: absolute;
  bottom: var(--space-6);
  left: var(--space-6);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-lg);
}

.hero__image-badge-icon {
  width: 40px;
  height: 40px;
  background: var(--color-accent-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}

.hero__image-badge-text {
  font-size: var(--text-sm);
  font-weight: 600;
}

.hero__image-badge-sub {
  font-size: var(--text-xs);
  color: var(--color-secondary);
}

/* ─── 9. TRUST BAR ───────────────────────────────────────── */
.trust-bar {
  padding-block: var(--section-py-sm);
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.trust-bar__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
}

.trust-bar__item {
  text-align: center;
  padding: var(--space-6);
}

.trust-bar__value {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  line-height: var(--leading-none);
  margin-bottom: var(--space-2);
  color: var(--color-primary);
}

.trust-bar__label {
  font-size: var(--text-sm);
  color: var(--color-secondary);
}

.trust-bar__divider {
  width: 1px;
  background: var(--color-border);
  align-self: stretch;
}

/* ─── 10. SECTION HEADERS ────────────────────────────────── */
.section-header {
  max-width: 640px;
  margin-bottom: var(--space-16);
}

.section-header--center {
  text-align: center;
  margin-inline: auto;
}

.section-header__label {
  display: inline-block;
  margin-bottom: var(--space-4);
}

.section-header__title {
  margin-bottom: var(--space-4);
}

.section-header__subtitle {
  font-size: var(--text-lg);
  color: var(--color-secondary);
  line-height: var(--leading-relaxed);
}

/* ─── 11. TREATMENT CARDS ────────────────────────────────── */
.treatments-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.treatment-card {
  background: var(--color-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: all var(--duration-base) var(--ease-out);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.treatment-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.treatment-card__icon {
  width: 48px;
  height: 48px;
  background: var(--color-accent-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  color: var(--color-accent);
  font-size: 24px;
  transition: all var(--duration-base) var(--ease-out);
}

.treatment-card:hover .treatment-card__icon {
  background: var(--color-accent);
  color: white;
}

.treatment-card__title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.treatment-card__description {
  font-size: var(--text-sm);
  color: var(--color-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

.treatment-card__items {
  margin-bottom: var(--space-6);
}

.treatment-card__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--color-secondary);
}

.treatment-card__item-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

.treatment-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent);
  transition: gap var(--duration-base) var(--ease-out);
}

.treatment-card:hover .treatment-card__link {
  gap: var(--space-3);
}

/* ─── 12. ABOUT / WHY SECTION ────────────────────────────── */
.about-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.about-split--reverse {
  direction: rtl;
}

.about-split--reverse > * {
  direction: ltr;
}

.about-split__image {
  border-radius: var(--radius-2xl);
  overflow: hidden;
  aspect-ratio: 4/5;
}

.about-split__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-split__content {
  max-width: 520px;
}

.about-split__text {
  font-size: var(--text-lg);
  color: var(--color-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
}

.about-split__list {
  margin-bottom: var(--space-10);
}

.about-split__list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.about-split__list-item:last-child {
  border-bottom: none;
}

.about-split__list-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--color-accent);
  margin-top: 2px;
}

.about-split__list-text h4 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.about-split__list-text p {
  font-size: var(--text-sm);
  color: var(--color-secondary);
}

/* ─── 13. PROCESS STEPS ──────────────────────────────────── */
.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  counter-reset: process;
}

.process-step {
  position: relative;
  counter-increment: process;
  padding: var(--space-8);
  background: var(--color-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  transition: all var(--duration-base) var(--ease-out);
}

.process-step:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

.process-step__number {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  color: var(--color-accent-light);
  line-height: var(--leading-none);
  margin-bottom: var(--space-4);
  font-weight: 400;
}

.process-step__title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.process-step__text {
  font-size: var(--text-sm);
  color: var(--color-secondary);
  line-height: var(--leading-relaxed);
}

/* ─── 14. DOCTOR PROFILE ─────────────────────────────────── */
.doctor-section {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-16);
  align-items: center;
}

.doctor-section__image {
  border-radius: var(--radius-2xl);
  overflow: hidden;
  aspect-ratio: 3/4;
}

.doctor-section__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doctor-section__content {
  max-width: 560px;
}

.doctor-section__name {
  margin-bottom: var(--space-2);
}

.doctor-section__credentials {
  font-size: var(--text-sm);
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: var(--space-6);
  letter-spacing: var(--tracking-wide);
}

.doctor-section__bio {
  font-size: var(--text-lg);
  color: var(--color-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
}

.doctor-section__details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.doctor-section__detail {
  padding: var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
}

.doctor-section__detail-label {
  font-size: var(--text-xs);
  color: var(--color-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-1);
}

.doctor-section__detail-value {
  font-size: var(--text-sm);
  font-weight: 500;
}

/* ─── 15. TESTIMONIALS ───────────────────────────────────── */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.testimonial-card {
  background: var(--color-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: all var(--duration-base) var(--ease-out);
}

.testimonial-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.testimonial-card__stars {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-5);
  color: #E5A83B;
}

.testimonial-card__star {
  width: 16px;
  height: 16px;
}

.testimonial-card__text {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
  color: var(--color-secondary);
}

.testimonial-card__author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.testimonial-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-accent);
}

.testimonial-card__name {
  font-size: var(--text-sm);
  font-weight: 600;
}

.testimonial-card__source {
  font-size: var(--text-xs);
  color: var(--color-tertiary);
}

/* ─── 16. FAQ ACCORDION ──────────────────────────────────── */
.faq-list {
  max-width: 800px;
  margin-inline: auto;
}

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

.faq-item__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) 0;
  font-size: var(--text-lg);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-in-out);
}

.faq-item__trigger:hover {
  color: var(--color-accent);
}

.faq-item__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--color-tertiary);
  transition: transform var(--duration-base) var(--ease-out);
}

.faq-item.open .faq-item__icon {
  transform: rotate(45deg);
  color: var(--color-accent);
}

.faq-item__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-slow) var(--ease-out);
}

.faq-item.open .faq-item__content {
  max-height: 400px;
}

.faq-item__answer {
  padding-bottom: var(--space-6);
  font-size: var(--text-base);
  color: var(--color-secondary);
  line-height: var(--leading-relaxed);
  max-width: 640px;
}

/* ─── 17. APPOINTMENT FORM ───────────────────────────────── */
.booking-section {
  background: var(--color-primary);
  color: var(--color-bg);
}

.booking-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-16);
  align-items: center;
}

.booking-content__title {
  color: var(--color-bg);
}

.booking-content__text {
  font-size: var(--text-lg);
  color: rgba(250, 250, 247, 0.65);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
}

.booking-content__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.booking-content__feature {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: rgba(250, 250, 247, 0.75);
}

.booking-content__feature-icon {
  width: 20px;
  height: 20px;
  color: var(--color-accent);
}

.booking-form {
  background: var(--color-card);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  color: var(--color-primary);
}

.booking-form__title {
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.booking-form__subtitle {
  font-size: var(--text-sm);
  color: var(--color-secondary);
  margin-bottom: var(--space-8);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-group--full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
}

.form-label .required {
  color: var(--color-error);
}

.form-input,
.form-select,
.form-textarea {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  transition: border-color var(--duration-fast) var(--ease-in-out),
              box-shadow var(--duration-fast) var(--ease-in-out);
  background: var(--color-bg);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-tertiary);
}

.form-input.error {
  border-color: var(--color-error);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-error);
  display: none;
}

.form-group.has-error .form-error {
  display: block;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A8F9D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.form-radio-group {
  display: flex;
  gap: var(--space-4);
}

.form-radio {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
}

.form-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
}

.form-submit {
  margin-top: var(--space-6);
}

.form-success {
  display: none;
  text-align: center;
  padding: var(--space-10);
}

.form-success.show {
  display: block;
}

.form-success__icon {
  width: 64px;
  height: 64px;
  background: var(--color-success-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  color: var(--color-success);
}

.form-success__title {
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.form-success__text {
  font-size: var(--text-base);
  color: var(--color-secondary);
  max-width: 400px;
  margin-inline: auto;
}

/* ─── 18. FINAL CTA ──────────────────────────────────────── */
.final-cta {
  text-align: center;
  padding-block: var(--section-py);
}

.final-cta__title {
  margin-bottom: var(--space-6);
  max-width: 700px;
  margin-inline: auto;
}

.final-cta__text {
  font-size: var(--text-lg);
  color: var(--color-secondary);
  max-width: 520px;
  margin-inline: auto;
  margin-bottom: var(--space-10);
  line-height: var(--leading-relaxed);
}

.final-cta__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ─── 19. FOOTER ─────────────────────────────────────────── */
.footer {
  background: var(--color-primary);
  color: var(--color-bg);
  padding-top: var(--section-py);
}

.footer__top {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-12);
  padding-bottom: var(--space-16);
  border-bottom: 1px solid rgba(250, 250, 247, 0.1);
}

.footer__brand {
  max-width: 320px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 600;
  font-size: var(--text-lg);
  margin-bottom: var(--space-6);
}

.footer__logo-mark {
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
}

.footer__tagline {
  font-size: var(--text-sm);
  color: rgba(250, 250, 247, 0.5);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

.footer__social {
  display: flex;
  gap: var(--space-3);
}

.footer__social-link {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(250, 250, 247, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-in-out);
  color: rgba(250, 250, 247, 0.6);
}

.footer__social-link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.footer__column-title {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: rgba(250, 250, 247, 0.4);
  margin-bottom: var(--space-6);
}

.footer__link {
  display: block;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: rgba(250, 250, 247, 0.6);
  transition: color var(--duration-fast) var(--ease-in-out);
}

.footer__link:hover {
  color: var(--color-bg);
}

.footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: rgba(250, 250, 247, 0.6);
}

.footer__contact-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-accent);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) 0;
  font-size: var(--text-xs);
  color: rgba(250, 250, 247, 0.35);
}

.footer__legal {
  display: flex;
  gap: var(--space-6);
}

.footer__legal a {
  color: rgba(250, 250, 247, 0.35);
  transition: color var(--duration-fast) var(--ease-in-out);
}

.footer__legal a:hover {
  color: rgba(250, 250, 247, 0.7);
}

/* ─── 20. MOBILE STICKY CTA ─────────────────────────────── */
.mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) var(--container-padding);
  box-shadow: 0 -4px 20px rgba(26, 31, 46, 0.08);
}

.mobile-cta__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.mobile-cta__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
}

.mobile-cta__btn--call {
  background: var(--color-surface);
  color: var(--color-primary);
}

.mobile-cta__btn--book {
  background: var(--color-accent);
  color: white;
}

/* ─── 21. TECHNOLOGY SECTION ─────────────────────────────── */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.tech-card {
  display: flex;
  gap: var(--space-5);
  padding: var(--space-6);
  background: var(--color-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  transition: all var(--duration-base) var(--ease-out);
}

.tech-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.tech-card__icon {
  width: 44px;
  height: 44px;
  background: var(--color-accent-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-accent);
}

.tech-card__title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.tech-card__text {
  font-size: var(--text-sm);
  color: var(--color-secondary);
  line-height: var(--leading-relaxed);
}

/* ─── 22. RESULTS / BEFORE & AFTER ───────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

.result-card {
  background: var(--color-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.result-card__images {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.result-card__image {
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
}

.result-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-card__image-label {
  position: absolute;
  bottom: var(--space-3);
  left: var(--space-3);
  background: rgba(26, 31, 46, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
}

.result-card__info {
  padding: var(--space-6);
}

.result-card__treatment {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.result-card__meta {
  font-size: var(--text-xs);
  color: var(--color-tertiary);
}

.result-card__disclaimer {
  font-size: var(--text-xs);
  color: var(--color-tertiary);
  font-style: italic;
  margin-top: var(--space-3);
}

/* ─── 23. BADGE ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
  letter-spacing: var(--tracking-wide);
}

.badge--accent {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.badge--placeholder {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

/* ─── 24. ANIMATIONS ─────────────────────────────────────── */
/* Intersection Observer Reveals */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }
.reveal-delay-5 { transition-delay: 500ms; }
.reveal-delay-6 { transition-delay: 600ms; }

/* Hover Image Zoom */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform var(--duration-slow) var(--ease-out);
}

.img-zoom:hover img {
  transform: scale(1.04);
}

/* ─── 25. RESPONSIVE ─────────────────────────────────────── */

/* Tablet (≤ 1024px) */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: var(--space-10);
    padding-block: var(--space-12);
  }

  .hero__content {
    max-width: 100%;
    text-align: center;
    order: 1;
  }

  .hero__subtitle {
    margin-inline: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__image {
    order: 0;
    min-height: 400px;
  }

  .trust-bar__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .treatments-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-split,
  .about-split--reverse {
    grid-template-columns: 1fr;
    gap: var(--space-10);
    direction: ltr;
  }

  .about-split__image {
    aspect-ratio: 16/9;
  }

  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .doctor-section {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .doctor-section__image {
    aspect-ratio: 16/10;
    max-height: 450px;
  }

  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .booking-grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .footer__top {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__brand {
    grid-column: 1 / -1;
  }

  .tech-grid {
    grid-template-columns: 1fr;
  }

  .navbar__links {
    display: none;
  }

  .navbar__call {
    display: none;
  }

  .navbar__toggle {
    display: flex;
  }

  .mobile-menu {
    display: flex;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile (≤ 768px) */
@media (max-width: 768px) {
  .announcement-bar__inner {
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  .announcement-bar__divider {
    display: none;
  }

  .hero__image {
    min-height: 300px;
    border-radius: var(--radius-xl);
  }

  h1, .text-h1 {
    font-size: var(--text-4xl);
  }

  .trust-bar__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }

  .trust-bar__item {
    padding: var(--space-4);
  }

  .treatments-grid {
    grid-template-columns: 1fr;
  }

  .process-grid {
    grid-template-columns: 1fr;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .booking-form {
    padding: var(--space-6);
  }

  .doctor-section__details {
    grid-template-columns: 1fr;
  }

  .footer__top {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .footer__legal {
    flex-wrap: wrap;
    justify-content: center;
  }

  .mobile-cta {
    display: block;
  }

  body {
    padding-bottom: 64px;
  }

  .section-header {
    margin-bottom: var(--space-10);
  }
}

/* Small Mobile (≤ 480px) */
@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .hero__image-badge {
    bottom: var(--space-3);
    left: var(--space-3);
    padding: var(--space-3) var(--space-4);
  }

  .final-cta__actions {
    flex-direction: column;
  }

  .final-cta__actions .btn {
    width: 100%;
  }
}

/* Large Desktop (≥ 1440px) */
@media (min-width: 1440px) {
  .hero {
    gap: var(--space-24);
  }
}

/* ─── 26. REDUCED MOTION ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ─── 27. PRINT ──────────────────────────────────────────── */
@media print {
  .navbar,
  .announcement-bar,
  .mobile-cta,
  .footer,
  .booking-section,
  .btn {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .section {
    padding-block: 1cm;
    break-inside: avoid;
  }
}

/* ─── 28. UTILITY CLASSES ────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.placeholder-notice {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
}

/* ─── CHATBOT WIDGET ─────────────────────────────────────── */

/* Launcher Button */
.chat-launcher {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  border-radius: 9999px;
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  box-shadow: 0 8px 32px rgba(26,31,46,0.25), 0 2px 8px rgba(26,31,46,0.12);
  transition: transform 220ms cubic-bezier(0.16,1,0.3,1),
              box-shadow 220ms cubic-bezier(0.16,1,0.3,1),
              background 180ms ease;
  outline-offset: 3px;
}
.chat-launcher:hover {
  background: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(74,124,114,0.35), 0 4px 12px rgba(74,124,114,0.18);
}
.chat-launcher:focus-visible { outline: 2px solid var(--color-accent); }
.chat-launcher.is-open { background: var(--color-accent); }
.chat-launcher__icon { width: 22px; height: 22px; flex-shrink: 0; }
.chat-launcher.is-open .chat-launcher__icon-chat { display: none; }
.chat-launcher__icon-close { display: none; }
.chat-launcher.is-open .chat-launcher__icon-close { display: block; }
.chat-launcher__label { line-height: 1; }
.chat-launcher__badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 14px; height: 14px;
  background: #E05252;
  border-radius: 50%;
  border: 2px solid var(--color-bg);
  animation: badgePulse 2.2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}
@media (max-width: 767px) {
  .chat-launcher {
    bottom: 88px;
    right: var(--space-4);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-xs);
  }
}

/* Chat Panel */
.chat-panel {
  position: fixed;
  bottom: 100px;
  right: var(--space-6);
  z-index: 8999;
  width: 380px;
  max-height: 600px;
  background: var(--color-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(26,31,46,0.18), 0 4px 16px rgba(26,31,46,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border-light);
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 280ms cubic-bezier(0.16,1,0.3,1),
              transform 280ms cubic-bezier(0.16,1,0.3,1);
  transform-origin: bottom right;
}
.chat-panel.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
@media (max-width: 440px) {
  .chat-panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 156px;
    max-height: 70vh;
  }
}

/* Panel Header */
.chat-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-primary);
  color: var(--color-bg);
  flex-shrink: 0;
}
.chat-header__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  position: relative;
}
.chat-header__avatar::after {
  content: '';
  position: absolute;
  bottom: 1px; right: 1px;
  width: 9px; height: 9px;
  background: #4ADE80;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
}
.chat-header__info { flex: 1; min-width: 0; }
.chat-header__name {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  margin: 0; line-height: 1.3;
}
.chat-header__status {
  font-size: var(--text-xs);
  color: rgba(250,250,247,0.6);
  margin: 0; line-height: 1.4;
}
.chat-header__close {
  background: none; border: none;
  cursor: pointer;
  color: rgba(250,250,247,0.55);
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: color 150ms;
  display: flex; align-items: center;
}
.chat-header__close:hover { color: var(--color-bg); }

/* Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  scroll-behavior: smooth;
  background: var(--color-bg-warm);
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

/* Message bubbles */
.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 86%;
  animation: msgSlideIn 250ms cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-msg--bot { align-self: flex-start; }
.chat-msg--user { align-self: flex-end; }
.chat-msg__bubble {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  font-family: var(--font-sans);
}
.chat-msg--bot .chat-msg__bubble {
  background: var(--color-card);
  color: var(--color-primary);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(26,31,46,0.07);
}
.chat-msg--user .chat-msg__bubble {
  background: var(--color-primary);
  color: var(--color-bg);
  border-bottom-right-radius: 4px;
}
.chat-msg__bubble p { margin: 0 0 var(--space-2); }
.chat-msg__bubble p:last-child { margin: 0; }
.chat-msg__bubble strong { font-weight: 600; }
.chat-msg__bubble ul { margin: var(--space-2) 0; padding-left: 1.2em; }
.chat-msg__bubble li { margin-bottom: 2px; }
.chat-msg__time {
  font-size: var(--text-xs);
  color: var(--color-tertiary);
  padding: 0 var(--space-1);
}
.chat-msg--user .chat-msg__time { text-align: right; }

/* Typing indicator */
.chat-msg--typing .chat-msg__bubble {
  background: var(--color-card);
  box-shadow: 0 1px 4px rgba(26,31,46,0.07);
}
.typing-dots {
  display: flex; gap: 5px;
  align-items: center; height: 18px;
}
.typing-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-tertiary);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Quick Reply Chips */
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0 var(--space-5) var(--space-3);
  background: var(--color-bg-warm);
}
.chat-chip {
  background: var(--color-card);
  color: var(--color-accent);
  border: 1px solid var(--color-accent-light);
  border-radius: 9999px;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms, border-color 160ms, color 160ms, transform 140ms;
  white-space: nowrap;
}
.chat-chip:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
  transform: translateY(-1px);
}

/* Input bar */
.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-card);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-primary);
  background: var(--color-bg-warm);
  resize: none;
  min-height: 42px;
  max-height: 110px;
  line-height: var(--leading-normal);
  transition: border-color 160ms;
  outline: none;
}
.chat-input:focus { border-color: var(--color-accent); }
.chat-input::placeholder { color: var(--color-tertiary); }
.chat-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white; border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 160ms, transform 140ms;
}
.chat-send:hover { background: var(--color-accent-hover); transform: scale(1.06); }
.chat-send:disabled { background: var(--color-border); cursor: not-allowed; transform: none; }

/* Powered-by */
.chat-powered {
  text-align: center;
  font-size: 10px;
  color: var(--color-tertiary);
  padding: 6px var(--space-4) 8px;
  background: var(--color-card);
  letter-spacing: var(--tracking-wide);
}

/* API Key prompt */
.chat-api-prompt {
  position: absolute;
  inset: 0;
  background: var(--color-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-8);
  text-align: center;
  z-index: 10;
}
.chat-api-prompt h3 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--color-primary);
  margin: 0;
}
.chat-api-prompt p {
  font-size: var(--text-sm);
  color: var(--color-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
}
.chat-api-prompt input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-primary);
  background: var(--color-bg-warm);
  outline: none;
  transition: border-color 160ms;
}
.chat-api-prompt input:focus { border-color: var(--color-accent); }
.chat-api-prompt .btn { width: 100%; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .chat-panel, .chat-launcher, .chat-msg, .typing-dots span {
    transition: none; animation: none;
  }
}
