/* ============================================================
   Bemmo · sitio público
   Paleta tomada de Bemmo/bemoo/ui/tema.py para mantener la
   misma identidad visual de la aplicación de escritorio.
   ============================================================ */

:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-alt: #f1f3f6;
  --border: #e4e7ec;
  --text: #101828;
  --muted: #667085;
  --primary: #006fee;
  --primary-strong: #006fee;
  --primary-strong-hover: #005bc4;
  --primary-hover: #005bc4;
  --primary-soft: #e8f1fe;
  --success: #12923f;
  --success-soft: #e7f7ed;
  --warning: #b26b00;
  --warning-soft: #fef4e6;
  --danger: #d92d20;
  --danger-soft: #feecea;
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1080px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, 0.05), 0 24px 64px rgba(16, 24, 40, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d12;
    --surface: #121821;
    --surface-alt: #1a2230;
    --border: #243044;
    --text: #e7ecf3;
    --muted: #93a2b7;
    --primary: #3b82f6;
    --primary-strong: #2563eb;
    --primary-strong-hover: #1d4ed8;
    --primary-hover: #60a5fa;
    --primary-soft: #152640;
    --success: #22c55e;
    --success-soft: #0f2a1d;
    --warning: #f5a524;
    --warning-soft: #2a2210;
    --danger: #f43f5e;
    --danger-soft: #2a131c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 40px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.35), 0 32px 80px rgba(0, 0, 0, 0.5);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
  color: #fff;
}

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

/* ---------- Cabecera ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding-block: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 750;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(0, 111, 238, 0.24);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 22px;
  font-size: 0.92rem;
  font-weight: 550;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

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

.nav a[aria-current="page"] {
  color: var(--primary);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 8vw, 92px) 0 clamp(40px, 6vw, 64px);
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -280px;
  right: -120px;
  width: 720px;
  height: 720px;
  background: radial-gradient(
    circle,
    var(--primary-soft) 0%,
    transparent 68%
  );
  opacity: 0.9;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  bottom: -360px;
  left: -220px;
  width: 640px;
  height: 640px;
  background: radial-gradient(
    circle,
    var(--success-soft) 0%,
    transparent 70%
  );
  opacity: 0.55;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--text);
  font-weight: 760;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 15ch;
  margin-bottom: 20px;
  font-size: clamp(2.35rem, 5.4vw, 4.15rem);
  line-height: 1.02;
}

h1 .accent {
  color: var(--primary);
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.12;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.lead {
  max-width: 62ch;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.5vw, 1.16rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.actions-center {
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease,
    color 160ms ease, transform 160ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary-strong);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 111, 238, 0.24);
}

.btn-primary:hover {
  background: var(--primary-strong-hover);
  color: #fff;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.fineprint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- Ventana de ejemplo ---------- */

.app-window {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: rotate(0.6deg);
}

.app-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
}

.dot:nth-child(1) {
  background: #f97066;
}

.dot:nth-child(2) {
  background: #fdb022;
}

.dot:nth-child(3) {
  background: #32d583;
}

.app-title {
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.app-body {
  padding: 20px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  font-weight: 650;
}

.pulse {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--success);
  opacity: 0.35;
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  70%,
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.badge {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.metric-list {
  display: grid;
  gap: 2px;
  margin: 0;
}

.metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.metric:first-child {
  border-top: 0;
}

.metric dt {
  color: var(--muted);
  font-size: 0.84rem;
}

.metric dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 680;
  text-align: right;
}

.metric dd.primary {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.app-note {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.76rem;
}

/* ---------- Secciones ---------- */

.section {
  padding: clamp(48px, 7vw, 80px) 0;
}

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 680px;
  margin-bottom: clamp(28px, 4vw, 42px);
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 16px;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-alt .card {
  background: var(--bg);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.icon svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Dos columnas ---------- */

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 4vw, 40px);
  align-items: start;
}

.panel {
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-alt .panel {
  background: var(--bg);
}

.panel h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 1.02rem;
}

.panel h3 .mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 800;
}

.mark-yes {
  background: var(--success-soft);
  color: var(--success);
}

.mark-no {
  background: var(--danger-soft);
  color: var(--danger);
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 28px;
  color: var(--muted);
  font-size: 0.93rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  top: 0.48em;
  left: 4px;
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}

.check-list.no li::before {
  top: 0.55em;
  left: 5px;
  width: 9px;
  height: 9px;
  border: 0;
  background:
    linear-gradient(45deg, transparent 43%, var(--danger) 43%, var(--danger) 57%, transparent 57%),
    linear-gradient(-45deg, transparent 43%, var(--danger) 43%, var(--danger) 57%, transparent 57%);
  transform: none;
}

.callout {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--text);
  font-size: 0.92rem;
}

.callout p {
  margin: 0;
}

.callout p + p {
  margin-top: 8px;
}

.callout .en {
  font-size: 0.86rem;
}

/* ---------- Pasos ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: paso;
}

.steps li {
  position: relative;
  padding: 22px 20px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  counter-increment: paso;
}

.section-alt .steps li {
  background: var(--bg);
}

.steps li::before {
  content: counter(paso, decimal-leading-zero);
  display: block;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.steps strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.98rem;
}

.steps span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Aviso ---------- */

.notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--text);
  font-size: 0.92rem;
}

.notice svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  stroke: var(--warning);
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notice-spaced {
  margin-top: 22px;
}

.gmail-links {
  margin: 18px 0 0;
}

/* ---------- Inglés ---------- */

.english {
  color: var(--muted);
  font-size: 0.95rem;
}

.english p {
  margin: 0 0 12px;
}

/* ---------- Pie ---------- */

.site-footer {
  padding: 40px 0 32px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.footer-brand p {
  max-width: 34ch;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 0.88rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

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

.footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
}

.footer-bottom p {
  margin: 0;
}

/* ---------- Páginas legales ---------- */

.legal-wrap {
  padding: clamp(36px, 6vw, 64px) 0 clamp(56px, 8vw, 88px);
}

.legal {
  max-width: 820px;
  margin-inline: auto;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.back:hover {
  color: var(--text);
}

.legal h1 {
  max-width: none;
  margin-bottom: 10px;
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.08;
}

.legal .meta {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.9rem;
}

.legal h2 {
  margin: 42px 0 12px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.legal h3 {
  margin: 24px 0 8px;
  font-size: 1rem;
}

.legal p,
.legal li {
  color: var(--text);
}

.legal p {
  margin: 0 0 14px;
}

.legal ul,
.legal ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.legal li {
  margin-bottom: 8px;
}

.legal li::marker {
  color: var(--primary);
}

.legal code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-alt);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.legal .lead {
  margin-bottom: 26px;
  font-size: 1.08rem;
}

.toc {
  margin: 0 0 34px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.9rem;
}

.toc strong {
  display: block;
  margin-bottom: 8px;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 28px;
}

.toc li {
  margin-bottom: 4px;
  break-inside: avoid;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
}

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

.legal .callout {
  margin: 18px 0;
}

.legal .callout strong {
  color: var(--text);
}

.legal table {
  width: 100%;
  margin: 8px 0 20px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.legal th,
.legal td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.legal th {
  background: var(--surface-alt);
  font-weight: 700;
}

.legal hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.legal .english {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ---------- 404 ---------- */

.error-page {
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding: 60px 0;
  text-align: center;
}

.error-page .code {
  margin: 0;
  color: var(--primary);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
}

.error-page h1 {
  max-width: none;
  margin: 12px 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.error-page p {
  max-width: 48ch;
  margin: 0 auto 24px;
  color: var(--muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero-grid,
  .split {
    grid-template-columns: 1fr;
  }

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

  .app-window {
    transform: none;
  }

  .hero::before {
    right: -320px;
  }

  h1 {
    max-width: 18ch;
  }
}

@media (max-width: 560px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .nav {
    gap: 4px 16px;
    font-size: 0.86rem;
  }

  .actions .btn {
    width: 100%;
  }

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

  .toc ol {
    columns: 1;
  }

  .legal table,
  .legal thead,
  .legal tbody,
  .legal th,
  .legal td,
  .legal tr {
    display: block;
  }

  .legal thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .legal tr {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
  }

  .legal td {
    border: 0;
    border-top: 1px solid var(--border);
  }

  .legal td:first-child {
    border-top: 0;
    background: var(--surface-alt);
    font-weight: 650;
  }
}

/* ---------- Movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Impresión ---------- */

@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .back,
  .actions {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .legal {
    max-width: none;
  }

  .toc {
    display: none;
  }

  .callout,
  .panel,
  .card {
    box-shadow: none;
  }

  .legal h2,
  .legal h3 {
    break-after: avoid;
  }
}
