
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --muted: #6b7280;
  --accent: #06b6d4;
  --accent-2: #2dd4bf;
  --text: #0f1724;
  --glass: rgba(15, 23, 36, 0.04);
  --container: 1200px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  will-change: scroll-position;
}

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

@media (min-width: 768px) {
  .container {
    padding: 2rem;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 998;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(15, 23, 36, 0.05);
  transition: box-shadow 0.3s ease;
  contain: layout style;
  padding: 0.75rem 0;
}

@media (min-width: 768px) {
  .site-header {
    padding: 1rem 0;
  }
}

@media (max-width: 767px) {
  .site-header {
    position: sticky;
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .header-inner {
    gap: 1rem;
    padding: 0 2rem;
  }
}

.brand {
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .brand {
    font-size: 1.1rem;
  }
}

.brand .muted {
  color: var(--muted);
  font-weight: 600;
  margin-left: 4px;
  display: none;
}

@media (min-width: 768px) {
  .brand .muted {
    display: inline;
    margin-left: 6px;
  }
}

.nav {
  display: none;
  gap: 1rem;
  pointer-events: none;
}

@media (min-width: 768px) {
  .nav {
    display: flex;
    pointer-events: auto;
  }
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
  font-size: 0.9rem;
  display: block;
  padding: 0.75rem 1rem;
}

@media (min-width: 768px) {
  .nav a {
    padding: 0.5rem 0.6rem;
    font-size: 1rem;
  }
}

.nav a:hover {
  color: var(--text);
  background: var(--glass);
}

.nav .cta {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #ffffff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  white-space: nowrap;
  width: 100%;
  border: none;
  font-family: inherit;
}

@media (min-width: 768px) {
  .nav .cta {
    width: auto;
  }
}

.nav .cta span {
  display: inline;
}

@media (max-width: 500px) {
  .nav .cta span {
    display: none;
  }

  .nav .cta {
    padding: 0.6rem;
  }
}

@media (min-width: 768px) {
  .nav .cta {
    padding: 0.5rem 0.8rem;
  }
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: background-color 0.2s;
  z-index: 1001;
  position: relative;
}

.nav-toggle:hover {
  background: var(--glass);
  border-radius: 8px;
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

.hero {
  padding: 5rem 0 2rem;
  position: relative;
  color: #ffffff;
  contain: paint; /* Prevent repaints outside this element */
}

.hero-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 36, 0.7);
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.hero-copy {
  flex: 1;
}

.hero h1 {
  font-size: 2.5rem;
  margin: 0 0 0.5rem;
  line-height: 1.1;
  font-weight: 800;
}

.lead {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 36, 0.1);
}

.btn.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #ffffff;
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.hero-visual {
  width: 320px;
  display: none; /* Hidden as we now have a background image */
}

.ac-card {
  width: 240px;
  height: 160px;
  background: #ffffff;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 36, 0.08);
  position: relative;
  overflow: hidden;
}

.ac-unit {
  width: 80px;
  height: 40px;
  background: linear-gradient(90deg, #eef2f6, #dbeafe);
  border-radius: 8px;
  margin: 20px auto 0;
  box-shadow: inset 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.ac-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  background: linear-gradient(
    90deg,
    rgba(45, 212, 191, 0.1),
    transparent
  );
  transform: translateY(30%);
  animation: wave 3s infinite linear;
}

@keyframes wave {
  0% { transform: translateX(-50%) translateY(30%); }
  100% { transform: translateX(0%) translateY(30%); }
}

.hero-divider {
  display: block;
  width: 100%;
  height: 60px;
  position: absolute;
  bottom: -1px;
  left: 0;
  z-index: 3;
}

.section {
  padding: 4.5rem 0;
  contain: layout style paint;
}

.section.alt {
  background: var(--surface);
  border-top: 1px solid rgba(15, 23, 36, 0.05);
  border-bottom: 1px solid rgba(15, 23, 36, 0.05);
}

.section-title {
  font-size: 2rem;
  margin: 0 0 0.5rem;
  text-align: center;
  font-weight: 700;
}

.section-sub {
  color: var(--muted);
  margin-bottom: 2.5rem;
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .section-sub {
    padding: 0 2rem;
  }
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 36, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 12px rgba(15, 23, 36, 0.04);
  contain: content; /* Isolate layout, paint, and style */
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(15, 23, 36, 0.08);
}

.card h3 {
  margin-top: 0;
  color: var(--accent);
}

.about-inner {
  display: flex;
  gap: 3rem;
  align-items: center;
}

.about-text {
  flex: 2;
}

.about-stats {
  flex: 1;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

.stat {
  background: linear-gradient(180deg, var(--bg), #f0f4f8);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(15, 23, 36, 0.05);
}

.stat .num {
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--accent-2);
}

.stat .label {
  color: var(--muted);
  font-size: 0.9rem;
}

.benefits {
  color: var(--muted);
  margin-top: 1rem;
  padding-left: 1.2rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.gallery-item {
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(15, 23, 36, 0.04);
  transition: transform 0.3s, box-shadow 0.3s;
  contain: content;
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(15, 23, 36, 0.08);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
  content-visibility: auto;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.carousel {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
}

.slide {
  display: none;
  padding: 2rem;
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
  font-size: 1.1rem;
  color: var(--muted);
}

.slide.active {
  display: block;
}

.testimonial-stars {
  color: #f59e0b;
  font-size: 1.2rem;
  letter-spacing: 0.12rem;
  margin-bottom: 0.6rem;
}

.slide cite {
  display: block;
  margin-top: 1rem;
  font-style: normal;
  font-weight: 600;
  color: var(--text);
}

.carousel-controls {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.carousel-controls button {
  background: rgba(15, 23, 36, 0.06);
  color: var(--text);
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s;
}

.carousel-controls button:hover {
  background: rgba(15, 23, 36, 0.1);
}

.testimonial-form-wrap {
  max-width: 780px;
  margin: 2rem auto 0;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 36, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(15, 23, 36, 0.04);
}

.testimonial-form-wrap h3 {
  margin: 0 0 1rem;
}

.testimonial-form {
  display: grid;
  gap: 0.85rem;
}

.testimonial-form label,
.rating-group legend {
  color: var(--muted);
  font-size: 0.9rem;
}

.testimonial-form input,
.testimonial-form textarea {
  width: 100%;
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  background: #ffffff;
  color: var(--text);
}

.testimonial-form input:focus,
.testimonial-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.rating-group {
  border: 0;
  padding: 0;
  margin: 0;
}

.star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 0.25rem;
}

.star-rating input {
  display: none;
}

.star-rating label {
  cursor: pointer;
  font-size: 1.5rem;
  color: rgba(15, 23, 36, 0.2);
  line-height: 1;
}

.star-rating label::before {
  content: '★';
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  color: #f59e0b;
}

.testimonial-form .btn {
  justify-self: start;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 2rem;
}

.contact-card,
.map-card {
  background: #ffffff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(15, 23, 36, 0.04);
}

.contact-form label {
  display: block;
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  background: #ffffff;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.form-status {
  margin-top: 1rem;
  color: var(--accent-2);
  font-weight: 500;
}

.form-status.error {
  color: #dc2626;
}

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: grid;
  gap: 0.5rem;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 36, 0.22);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: #059669;
}

.toast-error {
  background: #dc2626;
}

.map-wrap {
  overflow: hidden;
  border-radius: 12px;
}

.map-wrap iframe {
  width: 100%;
  height: 240px;
  border: 0;
}

.contact-details {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  color: var(--muted);
}

.contact-details li {
  margin-bottom: 0.5rem;
}

.site-footer {
  padding: 2rem 0;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid rgba(15, 23, 36, 0.05);
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.socials {
  display: flex;
  gap: 1rem;
}

.socials a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.socials a:hover {
  color: var(--accent);
}

/* Mobile-first responsive adjustments */
.btn {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
  }
}

.section-title {
  font-size: 1.5rem;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 2rem;
  }
}

.lead {
  font-size: 1rem;
}

@media (min-width: 768px) {
  .lead {
    font-size: 1.1rem;
  }
}

.contact-form label,
#appointment-form label {
  font-size: 0.85rem;
}

@media (min-width: 768px) {
  .contact-form label,
  #appointment-form label {
    font-size: 0.9rem;
  }
}

.contact-form input,
.contact-form textarea,
#appointment-form input,
#appointment-form select,
#appointment-form textarea {
  font-size: 16px; /* Prevent zoom on iOS */
}

@media (max-width: 767px) {
  .about-inner, .contact-grid {
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .hero-inner {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

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

  .hero h1 {
    font-size: 1.75rem;
  }

  .footer-inner {
    flex-direction: column;
  }

  .contact-grid {
    gap: 1.5rem;
  }
}

/* Mobile nav menu styling */
.nav.active {
  pointer-events: auto !important;
  z-index: 1001 !important;
}

@media (max-width: 767px) {
  .header-inner {
    position: relative;
  }

  .nav {
    display: flex;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    width: 100%;
    background: var(--surface);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    border: 1px solid rgba(15, 23, 36, 0.05);
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(15, 23, 36, 0.12);
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  }

  .nav.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .nav a {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(15, 23, 36, 0.04);
  }

  .nav.active .cta {
    background: transparent;
    color: var(--muted);
    width: 100%;
    margin: 0;
    padding: 0.9rem 1rem;
    border-radius: 0;
    text-align: left;
    border-bottom: 1px solid rgba(15, 23, 36, 0.04);
  }

  .nav.active .cta:hover {
    color: var(--text);
    background: var(--glass);
  }

  .nav.active button {
    margin: 0.5rem 1rem 0.75rem;
  }
}



@media (min-width: 768px) {
  .hero-actions {
    gap: 1rem;
  }
}

/* simple reveal animations */
[data-animate] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.5s ease-in, transform 0.5s ease-in;
  will-change: transform, opacity;
}

[data-animate].in-view {
  opacity: 1;
  transform: none;
  will-change: auto;
}

.section[data-animate] {
  transform: none;
  transition: opacity 0.5s ease-in;
  will-change: opacity;
}

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 36, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay[style*="display: flex"] {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: 12px;
  width: 90%;
  max-width: 520px;
  position: relative;
  box-shadow: 0 20px 60px rgba(15, 23, 36, 0.15);
  border: 1px solid rgba(15, 23, 36, 0.05);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.popup-overlay[style*="display: flex"] .popup-content {
  transform: scale(1);
}

.popup-content h2 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  color: var(--text);
  font-weight: 700;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--glass);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: rgba(15, 23, 36, 0.1);
  color: var(--text);
}

#appointment-form label {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

#appointment-form input,
#appointment-form select,
#appointment-form textarea {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#appointment-form input:focus,
#appointment-form select:focus,
#appointment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

#appointment-form button {
  width: 100%;
  padding: 0.9rem;
  margin-top: 0.5rem;
}
