:root {
  --brand: #0ea5e9;
  --brand-2: #2dd4bf;
  --ink: #0f172a;
  --muted: #64748b;
  --bg: #ffffff;
  --bg-alt: #f1f7fd;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; border: none; }

/* ---------- Estado de la base de datos ---------- */
.db-status {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  color: var(--muted);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.db-status__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}
.db-status.is-ok .db-status__dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,0.15); }
.db-status.is-error { color: #b91c1c; }
.db-status.is-error .db-status__dot { background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,0.15); }
.db-status.is-hidden { opacity: 0; transform: translateY(-8px); pointer-events: none; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__logo { width: 44px; height: 44px; border-radius: 12px; }
.brand__name { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }

.nav { display: flex; gap: 22px; }
.nav a { color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--brand); text-decoration: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.35);
}
.btn--ghost {
  background: #fff;
  color: var(--brand);
  border: 1.5px solid var(--border);
}

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(900px 400px at 90% -10%, rgba(45, 212, 191, 0.18), transparent 60%),
    radial-gradient(700px 380px at 0% 0%, rgba(14, 165, 233, 0.12), transparent 55%);
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.hero__eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--brand);
  font-weight: 600;
  font-size: 0.85rem;
}
.hero__title {
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.hero__claim { margin: 0 0 28px; font-size: 1.2rem; color: var(--muted); max-width: 30ch; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero__media-frame {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 6px solid #fff;
  transform: rotate(1.2deg);
}
.hero__media-frame img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Secciones ---------- */
.section { padding: 64px 0; }
.section--alt { background: var(--bg-alt); }
.section__title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 28px;
  letter-spacing: -0.01em;
  position: relative;
  padding-bottom: 12px;
}
.section__title::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 64px; height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
}
.intro-text {
  font-size: 1.12rem;
  color: #334155;
  max-width: 72ch;
}

/* ---------- Datos de la clínica ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.info-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.info-card:hover { transform: translateY(-4px); }
.info-card__icon {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 1.3rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(45,212,191,0.18), rgba(14,165,233,0.18));
}
.info-card__label { margin: 0; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.info-card__value { margin: 4px 0 0; font-weight: 600; word-break: break-word; }

/* ---------- Galería de instalaciones ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.gallery-card {
  margin: 0;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: #fff;
}
.gallery-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.gallery-card:hover img { transform: scale(1.05); }
.gallery-card__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.75), transparent);
}

/* ---------- Equipo médico ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 280px));
  justify-content: start;
  gap: 22px;
  margin-top: 28px;
}
.doctor-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
  display: flex;
  flex-direction: column;
}
.doctor-card:hover { transform: translateY(-4px); }
.doctor-card__photo {
  aspect-ratio: 1 / 1;
  background: var(--bg-alt);
}
.doctor-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.doctor-card__body { padding: 20px; }
.doctor-card__name { margin: 0 0 4px; font-size: 1.15rem; letter-spacing: -0.01em; }
.doctor-card__role {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
}
.doctor-card__desc { margin: 0; color: #475569; font-size: 0.98rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #cbd5e1;
  padding: 28px 0;
}
.site-footer__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  text-align: center;
  flex-wrap: wrap;
}
.site-footer__logo { width: 34px; height: 34px; border-radius: 9px; }
.site-footer p { margin: 0; font-size: 0.9rem; }
.site-footer__links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
}
.site-footer__links a { color: #93c5fd; font-size: 0.88rem; }
.site-footer__links a:hover { color: #fff; }

/* ---------- Páginas legales ---------- */
.legal { padding: 56px 0 72px; }
.legal__header { margin-bottom: 8px; }
.legal__title {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.legal__updated { color: var(--muted); font-size: 0.9rem; margin: 0 0 8px; }
.legal__back {
  display: inline-block;
  margin-bottom: 24px;
  font-weight: 600;
  font-size: 0.9rem;
}
.legal__content h2 {
  font-size: 1.25rem;
  margin: 34px 0 12px;
  letter-spacing: -0.01em;
}
.legal__content h3 { font-size: 1.05rem; margin: 22px 0 8px; }
.legal__content p,
.legal__content li { color: #334155; }
.legal__content ul { padding-left: 22px; margin: 8px 0; }
.legal__content li { margin-bottom: 6px; }
.data-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
}
.data-box p { margin: 6px 0; }
.data-box strong { color: var(--ink); }

/* ---------- Aviso de almacenamiento / cookies ---------- */
.cookie-aviso {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 200;
  width: min(760px, 94%);
  transform: translate(-50%, 24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.cookie-aviso.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.cookie-aviso__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cookie-aviso__titulo {
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--ink);
  font-size: 0.98rem;
}
.cookie-aviso__texto p:not(.cookie-aviso__titulo) {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}
.cookie-aviso__acciones { flex-shrink: 0; }
.cookie-aviso__acciones .btn { white-space: nowrap; }

/* ---------- Listado de clínicas ---------- */
.clinicas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 28px;
}
.clinica-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.clinica-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}
.clinica-card__nombre { margin: 0 0 8px; font-size: 1.2rem; }
.clinica-card__eslogan { margin: 0 0 10px; color: var(--brand); font-weight: 600; font-size: 0.92rem; }
.clinica-card__direccion { margin: 0 0 14px; color: var(--muted); font-size: 0.95rem; }
.clinica-card__enlace { color: var(--brand); font-weight: 600; font-size: 0.92rem; }

/* ---------- Panel instalación / aviso ---------- */
.aviso,
.panel {
  max-width: 560px;
  margin: 80px auto;
  background: #fff;
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.aviso { text-align: center; }
.aviso h1 { margin: 0 0 14px; }
.panel h1 { margin: 0 0 20px; }
.ok {
  background: var(--bg-alt);
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__media-frame { transform: none; max-width: 480px; }
  .nav { display: none; }
  .cookie-aviso__inner { flex-direction: column; align-items: stretch; text-align: left; }
  .cookie-aviso__acciones .btn { width: 100%; }
}
