/* ============================================================
   Next Salud — Estilos compartidos
   ============================================================ */

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

:root {
  --sage:        #7A9E7E;
  --sage-light:  #EAF2EA;
  --sage-mid:    #B5CEAE;
  --terracotta:  #C4714A;
  --terra-light: #F5EBE0;
  --cream:       #FAF7F2;
  --stone:       #4A4540;
  --stone-mid:   #8C8580;
  --warm-white:  #FEFCF9;
  --gold:        #BFA060;
  --gold-light:  #F5EDD5;
  --lavender:    #8E85B5;
  --lav-light:   #EEEAF8;
  --sky:         #5A9BBF;
  --sky-light:   #E3F0F7;
  --danger:      #C0392B;
  --danger-light:#FDECEA;
  --success:     #2E7D52;
  --success-light:#E8F5EE;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--cream);
  color: var(--stone);
  font-size: 16px;
  line-height: 1.7;
}

/* ── Tipografía compartida ──────────────────────────────── */
.section-eyebrow {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--stone);
  margin-bottom: 1rem;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--stone-mid);
  font-weight: 300;
  max-width: 540px;
  margin-bottom: 3.5rem;
  line-height: 1.8;
}

/* ── Botones ────────────────────────────────────────────── */
.btn-primary {
  background: var(--sage);
  color: white;
  padding: 0.85rem 2rem;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
}
.btn-primary:hover { background: #6A8E6E; transform: translateY(-1px); }

.btn-secondary {
  color: var(--stone);
  padding: 0.85rem 1.5rem;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 400;
  text-decoration: none;
  border: 1.5px solid rgba(74,69,64,0.2);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
}
.btn-secondary:hover { border-color: var(--sage); color: var(--sage); }

/* ── Formularios compartidos ────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--stone);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(74,69,64,0.15);
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--stone);
  background: white;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--sage); }
.form-group textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.availability-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.pill {
  padding: 0.4rem 1rem;
  border-radius: 100px;
  font-size: 0.8rem;
  border: 1.5px solid rgba(74,69,64,0.15);
  cursor: pointer;
  transition: all 0.15s;
  background: white;
  color: var(--stone-mid);
}
.pill:hover, .pill.active { background: var(--sage-light); border-color: var(--sage); color: var(--sage); }

.btn-submit {
  width: 100%;
  background: var(--sage);
  color: white;
  border: none;
  padding: 0.9rem;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 1.25rem;
}
.btn-submit:hover { background: #6A8E6E; }

/* ── Alertas / flash messages ───────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.alert i { flex-shrink: 0; margin-top: 0.1rem; }
.alert-error   { background: var(--danger-light);  color: var(--danger);  border: 1px solid rgba(192,57,43,0.15); }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(46,125,82,0.15); }

/* ── Tags ───────────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
}
.tag.cocina    { background: #FBEDE5; color: var(--terracotta); }
.tag.ejercicio { background: var(--sage-light); color: var(--sage); }
.tag.relajacion{ background: var(--lav-light);  color: var(--lavender); }
.tag.ocio      { background: var(--gold-light); color: var(--gold); }
.tag.mental    { background: #EEF0F8; color: #58649B; }
.tag.consejos  { background: var(--sky-light);  color: var(--sky); }

/* ── Navegación ─────────────────────────────────────────── */
#main-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(250,247,242,0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid rgba(74,69,64,0.08);
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--stone);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.nav-logo span { color: var(--sage); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex: 1;
  justify-content: flex-end;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--stone-mid);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active { color: var(--sage); }

/* Auth section del nav */
.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav-login {
  text-decoration: none;
  color: var(--stone-mid);
  font-size: 0.88rem;
  font-weight: 400;
  transition: color 0.2s;
}
.nav-login:hover { color: var(--sage); }

.nav-cta {
  background: var(--sage);
  color: white !important;
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
}
.nav-cta:hover { background: #6A8E6E; }

/* Dropdown de usuario */
.nav-user { position: relative; }

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: 1.5px solid rgba(74,69,64,0.15);
  border-radius: 100px;
  padding: 0.35rem 0.9rem 0.35rem 0.4rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--stone);
  transition: border-color 0.2s, background 0.2s;
}
.nav-user-btn:hover { border-color: var(--sage); background: var(--sage-light); }
.nav-user-btn.open  { border-color: var(--sage); background: var(--sage-light); }

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sage);
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0;
}

.nav-user-name { font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-chevron {
  font-size: 0.65rem;
  color: var(--stone-mid);
  transition: transform 0.2s;
}
.nav-user-btn.open .nav-chevron { transform: rotate(180deg); }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 220px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(74,69,64,0.13);
  border: 1px solid rgba(74,69,64,0.08);
  padding: 0.5rem;
  z-index: 200;
}
.nav-dropdown.open { display: block; }

.nav-dropdown-header {
  padding: 0.6rem 0.75rem 0.75rem;
  border-bottom: 1px solid rgba(74,69,64,0.07);
  margin-bottom: 0.4rem;
}
.nav-dropdown-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--stone);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-dropdown-role {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage);
  background: var(--sage-light);
  padding: 0.15rem 0.55rem;
  border-radius: 100px;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--stone-mid);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: 'Inter', sans-serif;
  text-align: left;
}
.nav-dropdown-item i { width: 14px; text-align: center; flex-shrink: 0; }
.nav-dropdown-item:hover { background: var(--cream); color: var(--stone); }
.nav-dropdown-item.logout { color: var(--danger); }
.nav-dropdown-item.logout:hover { background: var(--danger-light); }

.nav-dropdown-divider {
  height: 1px;
  background: rgba(74,69,64,0.07);
  margin: 0.4rem 0;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 110;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--stone);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Footer ─────────────────────────────────────────────── */
footer {
  background: var(--stone);
  color: rgba(255,255,255,0.6);
  padding: 4rem 5rem 2.5rem;
}

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

.footer-brand h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: white;
  font-weight: 500;
  margin-bottom: 0.75rem;
}
.footer-brand h2 span { color: var(--sage-mid); }
.footer-brand p { font-size: 0.88rem; line-height: 1.7; max-width: 280px; }

.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: white;
  margin-bottom: 1.25rem;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col ul a { text-decoration: none; color: rgba(255,255,255,0.5); font-size: 0.88rem; transition: color 0.15s; }
.footer-col ul a:hover { color: var(--sage-mid); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}
.footer-bottom i { color: var(--sage-mid); }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--warm-white);
  border-radius: 24px;
  padding: 2.5rem;
  max-width: 520px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 1.25rem; right: 1.25rem;
  background: rgba(74,69,64,0.07);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  color: var(--stone-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.modal-close:hover { background: rgba(74,69,64,0.13); }

.modal h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--stone);
  margin-bottom: 0.5rem;
}
.modal p { font-size: 0.9rem; color: var(--stone-mid); margin-bottom: 1.5rem; }

.success-msg {
  text-align: center;
  padding: 1.5rem 0;
  display: none;
}
.success-msg .check-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success-light);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 1rem;
}
.success-msg h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--stone);
  margin-bottom: 0.5rem;
}
.success-msg p { font-size: 0.88rem; color: var(--stone-mid); }

/* ── Chat widget ─────────────────────────────────────────── */
.chat-btn {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--sage);
  color: white;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(122,158,126,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  transition: transform 0.2s, background 0.2s;
}
.chat-btn:hover { transform: scale(1.07); background: #6A8E6E; }

.chat-popup {
  position: fixed;
  bottom: 5rem; right: 2rem;
  width: 340px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(74,69,64,0.15);
  z-index: 150;
  overflow: hidden;
  display: none;
  flex-direction: column;
  border: 1px solid rgba(74,69,64,0.08);
}
.chat-popup.open { display: flex; }

.chat-header {
  background: var(--sage);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
}
.chat-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.chat-header-info h4 { font-size: 0.92rem; font-weight: 500; }
.chat-status {
  font-size: 0.73rem;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.chat-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #7EE8A2;
  display: inline-block;
}

.chat-messages {
  padding: 1.1rem;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #FAFAF8;
}

.chat-msg {
  max-width: 82%;
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.5;
}
.chat-msg.bot {
  background: white;
  border: 1px solid rgba(74,69,64,0.1);
  color: var(--stone);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-msg.user {
  background: var(--sage);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-input-area {
  padding: 0.9rem 1.1rem;
  border-top: 1px solid rgba(74,69,64,0.08);
  display: flex;
  gap: 0.5rem;
  background: white;
}
.chat-input-area input {
  flex: 1;
  border: 1.5px solid rgba(74,69,64,0.15);
  border-radius: 100px;
  padding: 0.5rem 0.9rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  outline: none;
  transition: border-color 0.2s;
  color: var(--stone);
}
.chat-input-area input:focus { border-color: var(--sage); }
.chat-send {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--sage);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.chat-send:hover { background: #6A8E6E; }

/* ── Responsive nav ─────────────────────────────────────── */
@media (max-width: 900px) {
  #main-nav { padding: 0 1.5rem; }

  .nav-hamburger { display: flex; }

  .nav-menu {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: rgba(250,247,242,0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(74,69,64,0.1);
    padding: 1.25rem 1.5rem 1.5rem;
  }
  .nav-menu.open { display: flex; }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    margin-bottom: 1rem;
  }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(74,69,64,0.06);
    font-size: 0.95rem;
  }

  .nav-auth {
    width: 100%;
    padding-top: 0.5rem;
    gap: 0.6rem;
  }
  .nav-cta, .nav-login { font-size: 0.9rem; }

  .nav-dropdown {
    position: static;
    box-shadow: none;
    border: 1px solid rgba(74,69,64,0.1);
    margin-top: 0.5rem;
    width: 100%;
  }
}

@media (max-width: 640px) {
  footer { padding: 3rem 1.5rem 2rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
}

/* ── Gating de contenido (suscripción) ──────────────────── */
.content-lock {
  position: relative;
  border-radius: inherit;
  overflow: hidden;
}

.content-lock-preview {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
  transform: scale(1.02);
}

.content-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: rgba(250,247,242,0.82);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  text-align: center;
  padding: 1.25rem;
  border-radius: inherit;
}

.lock-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sage-light);
  color: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.lock-plan {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  margin: 0;
}

.lock-msg {
  font-size: 0.82rem;
  color: var(--stone-mid);
  line-height: 1.5;
  margin: 0;
  max-width: 220px;
}

.lock-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 100px;
  background: var(--sage);
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  margin-top: 0.25rem;
  transition: background 0.2s, transform 0.15s;
}
.lock-btn:hover { background: var(--sage-mid); transform: translateY(-1px); }
