/* =============================================
   CALCULADORA GESTACIONAL — STYLESHEET
   Mobile-first, pastel pink, premium design
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@700;800&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  --pink-50:  #fff0f6;
  --pink-100: #ffe3ef;
  --pink-200: #ffc1d9;
  --pink-300: #ff94bc;
  --pink-400: #ff5f9a;
  --pink-500: #e8447e;
  --pink-600: #c73168;
  --accent:   #f06292;
  --rose:     #f48fb1;
  --lavender: #ce93d8;
  --teal:     #80cbc4;
  --white:    #ffffff;
  --gray-50:  #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #eeeeee;
  --gray-500: #9e9e9e;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;
  --shadow-sm:  0 2px 8px rgba(232,68,126,0.10);
  --shadow-md:  0 8px 30px rgba(232,68,126,0.15);
  --shadow-lg:  0 20px 60px rgba(232,68,126,0.20);
  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  32px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--pink-50);
  color: var(--gray-800);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* ---- Container ---- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =============================================
   HEADER / NAV
   ============================================= */
header {
  background: var(--white);
  border-bottom: 1px solid var(--pink-100);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(232,68,126,0.08);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--pink-500);
  letter-spacing: -0.3px;
}

.logo-icon { font-size: 1.6rem; }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--pink-400);
  transition: var(--transition);
  border-radius: 2px;
}

.nav-links a:hover { color: var(--pink-500); }
.nav-links a:hover::after { width: 100%; }

@media (max-width: 640px) { .nav-links { display: none; } }

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
  background: linear-gradient(135deg, #fff0f6 0%, #ffe3ef 40%, #fce4ec 100%);
  padding: 64px 0 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

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

.hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(206,147,216,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(232,68,126,0.10);
  color: var(--pink-600);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 99px;
  margin-bottom: 20px;
  border: 1px solid rgba(232,68,126,0.20);
  letter-spacing: 0.3px;
}

.hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero h1 span { color: var(--pink-500); }

.hero-subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--gray-600);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.65;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 36px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--pink-500);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* =============================================
   CALCULATOR CARD
   ============================================= */
.calc-section {
  margin: -24px auto 0;
  max-width: 720px;
  padding: 0 20px 60px;
  position: relative;
  z-index: 10;
}

.calc-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

@media (max-width: 480px) {
  .calc-card { padding: 28px 20px; }
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  background: var(--pink-50);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 32px;
  border: 1px solid var(--pink-100);
}

.tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.tab-btn.active {
  background: var(--pink-500);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(232,68,126,0.35);
}

.tab-btn:not(.active):hover {
  background: var(--pink-100);
  color: var(--pink-600);
}

/* ---- Tab Panels ---- */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Form Elements ---- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.form-group label span {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--gray-500);
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--pink-200);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--pink-400);
  box-shadow: 0 0 0 4px rgba(232,68,126,0.10);
}

.form-control:hover { border-color: var(--pink-300); }

/* Gestational age inline inputs */
.age-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.age-inputs .form-group { margin-bottom: 0; }

/* ---- Optional: Cycle Length ---- */
.optional-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 12px 16px;
  background: var(--pink-50);
  border-radius: var(--radius-md);
  border: 1px dashed var(--pink-200);
}

.toggle-optional {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--pink-500);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
}

.optional-fields { display: none; }
.optional-fields.open { display: block; }

/* ---- CTA Button ---- */
.btn-calc {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--pink-400) 0%, var(--pink-600) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 24px;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 20px rgba(232,68,126,0.40);
  position: relative;
  overflow: hidden;
}

.btn-calc::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
}

.btn-calc:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(232,68,126,0.50);
}

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

.btn-calc .btn-icon { margin-right: 8px; font-size: 1.2rem; }

/* =============================================
   RESULTS PANEL
   ============================================= */
.results-panel {
  display: none;
  margin-top: 32px;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.results-panel.visible { display: block; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.results-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--pink-100);
}

.results-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 500px) {
  .results-grid { grid-template-columns: 1fr; }
}

.result-card {
  background: var(--white);
  border: 1.5px solid var(--pink-100);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--pink-400), var(--lavender));
}

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

.result-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
  display: block;
}

.result-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.result-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--pink-600);
  line-height: 1.2;
}

.result-sub {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 4px;
}

/* Trimester Badge */
.trimester-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 8px;
}

.trim-1 { background: #e3f2fd; color: #1565c0; }
.trim-2 { background: #e8f5e9; color: #2e7d32; }
.trim-3 { background: #fff3e0; color: #e65100; }

/* Progress bar */
.progress-wrap {
  margin-top: 24px;
  background: var(--pink-100);
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--pink-300), var(--pink-500));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 6px;
}

/* Share / Print buttons */
.results-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-action {
  flex: 1;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-whatsapp {
  background: #25D366;
  color: var(--white);
  box-shadow: 0 4px 12px rgba(37,211,102,0.35);
}

.btn-whatsapp:hover { background: #1eb855; transform: translateY(-1px); }

.btn-print {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
}

.btn-print:hover { background: var(--gray-200); }

/* =============================================
   FEATURES STRIP
   ============================================= */
.features-strip {
  background: var(--white);
  border-top: 1px solid var(--pink-100);
  border-bottom: 1px solid var(--pink-100);
  padding: 28px 0;
}

.features-inner {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.feature-item .fi-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pink-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* =============================================
   CONTENT SECTIONS
   ============================================= */
.content-section {
  padding: 72px 0;
}

.content-section:nth-child(even) {
  background: var(--white);
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pink-500);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
}

.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.25;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1rem;
  color: var(--gray-600);
  max-width: 660px;
  line-height: 1.7;
}

/* Info cards */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.info-card {
  background: var(--white);
  border: 1.5px solid var(--pink-100);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.info-card.alt-bg { background: var(--pink-50); }

.info-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--pink-200);
}

.info-card-icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
  display: block;
}

.info-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 10px;
}

.info-card p {
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.65;
}

/* How to use steps */
.steps-list {
  list-style: none;
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-num {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(232,68,126,0.30);
}

.step-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* =============================================
   PREGNANCY WEEKS TABLE
   ============================================= */
.table-wrap {
  overflow-x: auto;
  margin-top: 32px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--pink-100);
}

.preg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.preg-table thead {
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  color: var(--white);
}

.preg-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.3px;
}

.preg-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--pink-50);
  color: var(--gray-700);
}

.preg-table tbody tr:nth-child(even) { background: var(--pink-50); }
.preg-table tbody tr:hover { background: var(--pink-100); }

.trim-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.73rem;
  font-weight: 700;
}

/* =============================================
   FAQ SECTION
   ============================================= */
.faq-section {
  padding: 72px 0;
  background: var(--pink-50);
}

.faq-list {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 760px;
}

.faq-item {
  background: var(--white);
  border: 1.5px solid var(--pink-100);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item:hover { border-color: var(--pink-200); }

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-800);
  text-align: left;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}

.faq-q:hover { color: var(--pink-600); }
.faq-q.open { color: var(--pink-600); }

.faq-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--pink-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--pink-400);
  transition: var(--transition);
}

.faq-q.open .faq-icon { transform: rotate(45deg); background: var(--pink-100); }

.faq-a {
  display: none;
  padding: 0 20px 18px;
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.7;
  border-top: 1px solid var(--pink-50);
}

.faq-a.open {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* =============================================
   NEWSLETTER / LEAD CAPTURE
   ============================================= */
.newsletter-section {
  background: linear-gradient(135deg, var(--pink-500) 0%, #c94f80 100%);
  padding: 64px 0;
  text-align: center;
  color: var(--white);
}

.newsletter-section h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  margin-bottom: 10px;
}

.newsletter-section p {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 28px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  gap: 10px;
}

@media (max-width: 500px) {
  .newsletter-form { flex-direction: column; }
}

.newsletter-input {
  flex: 1;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  color: var(--gray-800);
}

.btn-newsletter {
  padding: 14px 24px;
  background: var(--gray-900);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-newsletter:hover { background: var(--gray-800); transform: translateY(-1px); }

/* =============================================
   FOOTER
   ============================================= */
footer {
  background: var(--gray-900);
  color: var(--gray-200);
  padding: 48px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand .logo { color: var(--pink-300); }
.footer-brand p {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-top: 12px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 14px;
  letter-spacing: 0.3px;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a {
  font-size: 0.82rem;
  color: var(--gray-500);
  transition: var(--transition);
}
.footer-col ul a:hover { color: var(--pink-300); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  text-align: center;
}

.footer-bottom p { font-size: 0.8rem; color: var(--gray-500); }
.footer-bottom a { color: var(--pink-300); }

/* =============================================
   ALERT / TOAST
   ============================================= */
.error-msg {
  display: none;
  background: #fce4ec;
  border: 1.5px solid #ef9a9a;
  color: #c62828;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.875rem;
  margin-bottom: 16px;
  font-weight: 500;
}

.error-msg.visible { display: block; animation: fadeIn 0.25s ease; }

/* =============================================
   BACK TO TOP
   ============================================= */
.back-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pink-500);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 99;
}

.back-top.visible { opacity: 1; pointer-events: all; }
.back-top:hover { transform: translateY(-3px); }

/* =============================================
   UTILITIES
   ============================================= */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-pink { color: var(--pink-500); }
.bold { font-weight: 700; }
