/* ==========================================================================
   Política de Privacidad SIGEDAP — Hospital Dr. Franco Ravera Zunino
   Paleta basada en el logo institucional: teal + verde lima + gris grafito
   ========================================================================== */

:root {
  /* Colores extraídos del logo del hospital */
  --teal-900: #0a4d4c;
  --teal-700: #0d6e6a;
  --teal-600: #0f8a85;
  --teal-500: #16a09b;
  --teal-100: #e3f5f3;

  --lime-600: #7fb62d;
  --lime-500: #93c93f;
  --lime-100: #eef8dd;

  --gray-900: #2b2d31;
  --gray-700: #4d4f54;
  --gray-500: #6d6e71;
  --gray-300: #c7c9cc;
  --gray-100: #f4f6f6;

  --white: #ffffff;

  --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 2px 8px rgba(10, 60, 58, 0.06);
  --shadow-md: 0 8px 24px rgba(10, 60, 58, 0.10);
  --shadow-lg: 0 16px 40px rgba(10, 60, 58, 0.14);

  --header-height: 78px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--gray-700);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--teal-600);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  color: var(--gray-900);
  font-weight: 700;
  line-height: 1.25;
}

p {
  margin: 0 0 14px 0;
}

ul {
  margin: 0 0 14px 0;
  padding-left: 22px;
}
li {
  margin-bottom: 6px;
}

/* ==========================================================================
   Barra de progreso de lectura
   ========================================================================== */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--teal-600), var(--lime-500));
  z-index: 1100;
  transition: width 0.1s ease-out;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--gray-300);
  transition: box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  height: 40px;
  width: auto;
  display: block;
}

.brand-logo--sigedap {
  height: 26px;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: var(--gray-300);
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  color: var(--gray-700);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-link:hover {
  background: var(--teal-100);
  color: var(--teal-700);
  text-decoration: none;
}

.nav-link--cta {
  background: var(--teal-600);
  color: var(--white);
  font-weight: 600;
}
.nav-link--cta:hover {
  background: var(--teal-700);
  color: var(--white);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--gray-900);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--teal-900) 0%, var(--teal-700) 55%, var(--teal-600) 100%);
  padding: 72px 0 96px;
  color: var(--white);
}

.hero__decoration {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 20%, rgba(147, 201, 63, 0.35) 0%, transparent 45%),
    radial-gradient(circle at 10% 85%, rgba(147, 201, 63, 0.18) 0%, transparent 40%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lime-500);
  margin-bottom: 18px;
}

.hero__title {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 800;
  color: var(--white);
  margin: 0 0 16px 0;
  max-width: 720px;
}
.hero__title span {
  color: var(--lime-500);
}

.hero__subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 28px 0;
  font-weight: 500;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white);
}

.hero__update {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  font-style: italic;
}

/* ==========================================================================
   Layout principal
   ========================================================================== */

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 56px;
  padding-top: 56px;
  padding-bottom: 40px;
  align-items: start;
}

/* Tabla de contenidos */
.toc {
  position: relative;
}

.toc__sticky {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  border: 1px solid var(--gray-300);
}

.toc__title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin: 0 0 12px 0;
}

.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc__link {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--gray-700);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.toc__link:hover {
  background: var(--white);
  color: var(--teal-700);
  text-decoration: none;
}

.toc__link.is-active {
  background: var(--white);
  color: var(--teal-700);
  border-left-color: var(--lime-500);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Documento
   ========================================================================== */

.doc {
  min-width: 0;
}

.doc-section {
  padding: 34px 0;
  border-bottom: 1px solid var(--gray-300);
  scroll-margin-top: calc(var(--header-height) + 20px);
}

.doc-section:first-child {
  padding-top: 0;
}

.doc-section:last-of-type {
  border-bottom: none;
}

.doc-section__title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 1.4rem;
  margin: 0 0 18px 0;
}

.doc-section__num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--white);
  background: var(--teal-600);
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.doc-section p,
.doc-section li {
  color: var(--gray-700);
  font-size: 0.98rem;
}

.doc-section h3 {
  font-size: 1.02rem;
  color: var(--gray-900);
  margin: 20px 0 10px 0;
}

.info-list {
  list-style: none;
  padding: 0;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  border: 1px solid var(--gray-300);
}
.info-list li {
  padding: 6px 0;
}

.subblock {
  margin-bottom: 22px;
}
.subblock:last-child {
  margin-bottom: 0;
}

.callout {
  background: var(--teal-100);
  border-left: 4px solid var(--teal-600);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--teal-900);
  font-size: 0.98rem;
}

/* Listas de verificación con check-icon */
.check-list {
  list-style: none;
  padding: 0;
}
.check-list li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 12px;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--lime-500);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px;
}

/* Cards de datos recopilados */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.data-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.data-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--teal-500);
}

.data-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--teal-100);
  color: var(--teal-700);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.data-card h3 {
  font-size: 0.98rem;
  margin: 0 0 10px 0;
}

.data-card ul {
  margin: 0;
  padding-left: 18px;
}
.data-card li {
  font-size: 0.88rem;
  color: var(--gray-500);
  margin-bottom: 6px;
}

/* Permisos */
.permission-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.permission-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.permission-item:hover {
  border-color: var(--lime-500);
  box-shadow: var(--shadow-sm);
}

.permission-item__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--lime-100);
  color: var(--lime-600);
  display: flex;
  align-items: center;
  justify-content: center;
}

.permission-item h3 {
  font-size: 0.98rem;
  margin: 0 0 6px 0;
}

.permission-item code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.75rem;
  background: var(--gray-100);
  color: var(--teal-700);
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 500;
}

.permission-item p {
  font-size: 0.9rem;
  color: var(--gray-500);
  margin: 0;
}

/* Derechos del usuario */
.rights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 18px 0 20px 0;
}

.right-card {
  background: linear-gradient(160deg, var(--teal-900), var(--teal-700));
  color: var(--white);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
}

.right-card__letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--lime-500);
  color: var(--teal-900);
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 14px;
}

.right-card h3 {
  color: var(--white);
  font-size: 1rem;
  margin: 0 0 8px 0;
}

.right-card p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.87rem;
  margin: 0;
}

/* Contacto */
.contact-card {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: 26px;
  margin-top: 10px;
}

.contact-card__logo {
  height: 56px;
  width: auto;
  flex-shrink: 0;
}

.contact-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.contact-card__list li {
  margin-bottom: 5px;
  color: var(--gray-700);
  font-size: 0.95rem;
}

.acceptance-note {
  margin-top: 10px;
  padding: 22px 24px;
  background: var(--teal-100);
  border-radius: var(--radius-md);
  text-align: center;
}
.acceptance-note p {
  margin: 0;
  color: var(--teal-900);
  font-weight: 500;
  font-size: 0.92rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--gray-900);
  color: rgba(255, 255, 255, 0.7);
  padding: 40px 0;
  margin-top: 20px;
}

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

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 18px;
}

.footer-logo {
  height: 34px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-logo--sigedap {
  height: 22px;
}

.site-footer p {
  margin: 0 0 6px 0;
  font-size: 0.88rem;
}

.footer-note {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem !important;
}

/* ==========================================================================
   Botón volver arriba
   ========================================================================== */

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--teal-600);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, visibility 0.25s ease;
  z-index: 900;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--teal-700);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .toc {
    order: 2;
  }

  .toc__sticky {
    position: static;
    max-height: none;
  }

  .doc {
    order: 1;
  }
}

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

  .site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--white);
    border-bottom: 1px solid var(--gray-300);
    box-shadow: var(--shadow-md);
    padding: 10px 20px 20px;
    gap: 4px;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  }

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

  .nav-link {
    padding: 12px 14px;
  }

  .nav-link--cta {
    margin-top: 6px;
    text-align: center;
  }

  .hero {
    padding: 52px 0 64px;
  }

  .brand-logo {
    height: 32px;
  }

  .brand-logo--sigedap {
    height: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero__title {
    font-size: 1.7rem;
  }

  .contact-card {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}
