/* --- CSS Variables --- */
:root {
  --primary: #fe8660;
  --primary-dark: #e56a3f;
  --secondary: #10b981;
  --dark: #0f172a;
  --light: #f9f3f1;
  --white: #ffffff;
  --text-gray: #64748b;
  --gradient-bg: linear-gradient(135deg, #fff3ed 0%, #ffffff 100%);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--dark);
  background-color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
.btn {
  font-family: "Poppins", sans-serif;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.3s;
}

ul {
  list-style: none;
}

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

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-padding {
  padding: 80px 0;
}

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

.badge {
  display: inline-block;
  padding: 6px 16px;
  background: #ffede5;
  color: var(--primary);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 6px rgba(254, 134, 96, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: var(--white);
}

/* --- Navbar --- */
.navbar {
  padding: 15px 0;
  position: sticky;
  top: 0;
  background: var(--white);
  backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid #f0e6e2;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-gray);
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--primary);
}

/* --- Login Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.login-dialog {
  background: var(--white);
  padding: 40px;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  position: relative;
}

.modal-overlay.active .login-dialog {
  transform: scale(1);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.8rem;
  cursor: pointer;
  color: #b89e94;
  line-height: 1;
}

.close-modal:hover {
  color: var(--dark);
}

.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 30px;
}

.role-card {
  border: 2px solid #f0e6e2;
  border-radius: 12px;
  padding: 25px 15px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.role-card:hover {
  border-color: var(--primary);
  background-color: #fff3ed;
  transform: translateY(-5px);
}

.role-icon {
  font-size: 2.2rem;
}

.role-title {
  font-weight: 700;
  color: var(--dark);
  font-size: 1.1rem;
}

.role-desc {
  font-size: 0.8rem;
  color: var(--text-gray);
}

/* --- Hero Section --- */
.hero {
  background: var(--gradient-bg);
  padding: 80px 0 100px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content h1 {
  font-size: 3.5rem;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.hero-content p {
  font-size: 1.15rem;
  color: var(--text-gray);
  margin-bottom: 40px;
  max-width: 500px;
}

.hero-btn-group {
  display: flex;
  gap: 15px;
}

.hero-ui-mockup {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 20px;
  border: 1px solid #f0e6e2;
  transform: rotate(-2deg);
  transition: transform 0.5s;
}

.hero-ui-mockup:hover {
  transform: rotate(0deg);
}

/* --- Feature Section Styles --- */
.section-header {
  max-width: 700px;
  margin: 0 auto 60px;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  line-height: 1.2;
}

.section-header p {
  color: var(--text-gray);
  font-size: 1.1rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.feature-card {
  background: var(--white);
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid #f9f3f1;
  box-shadow: var(--shadow-sm);
  transition: 0.3s;
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}

.f-icon {
  width: 50px;
  height: 50px;
  background: #ffede5;
  color: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.doctor-bg {
  background-color: #fcf9f8;
}

.patient-bg {
  background-color: #fff;
}

/* WhatsApp Integration Banner */
.whatsapp-banner {
  background-color: #dcfce7;
  border: 1px solid #86efac;
  border-radius: var(--radius);
  padding: 40px;
  display: flex;
  align-items: center;
  gap: 30px;
  margin-top: 60px;
}

.wa-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

/* --- Footer --- */
footer {
  background: var(--dark);
  color: #94a3b8;
  padding: 60px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer h4 {
  color: var(--white);
  margin-bottom: 20px;
}

.footer ul li {
  margin-bottom: 10px;
}

.footer ul li a {
  display: block;
  width: 100%;
}

.footer a:hover {
  color: var(--white);
}

.copyright {
  border-top: 1px solid #334155;
  padding-top: 20px;
  text-align: center;
  font-size: 0.9rem;
}

/* --- RESPONSIVE MEDIA QUERIES --- */

@media (max-width: 992px) {
  .hero-content h1 {
    font-size: 2.8rem;
  }

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

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

@media (max-width: 768px) {
  .section-padding {
    padding: 50px 0;
  }

  .nav-content {
    flex-direction: column;
    gap: 15px;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
  }

  .nav-links a {
    font-size: 0.9rem;
  }

  .hero {
    padding-top: 40px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-content p {
    margin: 0 auto 30px auto;
  }

  .hero-btn-group {
    justify-content: center;
  }

  .hero-ui-mockup {
    transform: rotate(0deg);
    margin: 0 10px;
  }

  .section-header h2 {
    font-size: 2rem;
  }

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

  .whatsapp-banner {
    flex-direction: column;
    text-align: center;
    padding: 30px 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 30px;
  }

  .login-dialog {
    padding: 30px 20px;
  }

  .role-selector {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 2.2rem;
  }

  .hero-btn-group {
    flex-direction: column;
    width: 100%;
  }

  .hero-btn-group button {
    width: 100%;
  }

  .nav-links {
    flex-direction: column;
    gap: 10px;
  }

  .nav-links button {
    width: 100%;
    margin-top: 5px;
  }
}

/* --- Contact Modal --- */
.contact-dialog {
  background: var(--white);
  padding: 30px 20px;
  /* Reduced padding for mobile */
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  /* Limit height to viewport */
  overflow-y: auto;
  /* Make the entire dialog scrollable */
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .contact-dialog {
  transform: scale(1);
}

.contact-dialog h2 {
  color: var(--dark);
  margin-bottom: 15px;
  font-size: 1.8rem;
}

.contact-dialog p {
  color: var(--text-gray);
  margin-bottom: 25px;
  font-size: 1rem;
}

/* HubSpot Form Container */
.hs-form-frame {
  width: 100%;
  flex-grow: 1;
  /* Allows it to take available space */
  min-height: 500px;
  /* Safe minimum for loading */
}

/* Force iframe to fill and be responsive */
.hs-form-frame iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 600px !important;
  /* Adjust if your form is longer */
  border: none;
  display: block;
}

/* Mobile-specific fixes */
@media (max-width: 768px) {
  .contact-dialog {
    padding: 20px 15px;
    max-width: 95%;
    max-height: 95vh;
  }

  .hs-form-frame iframe {
    min-height: 700px !important;
    /* Increase for longer forms on small screens */
  }
}