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

:root {
  --bg: #0f0c14;
  --card: #1c1924;
  --text: #f1e7ff;
  --muted: #c5b8d9;
  --rose: #c0267a;
  --rose-soft: rgba(192, 38, 122, 0.15);
  --gold: #d4af77;
  --border: rgba(255, 255, 255, 0.1);
  --warn: #e8a094;
  --ok: #7dcea0;
  --font: 'Inter', system-ui, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--rose); text-decoration: none; }
a:hover { color: #ffb3d9; }

.top {
  border-bottom: 1px solid var(--border);
  background: rgba(10, 8, 15, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.top-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
}
.brand img {
  height: 42px;
  width: auto;
  border-radius: 10px;
  object-fit: contain;
}
.brand strong {
  font-family: var(--serif);
  font-size: 1.1rem;
  display: block;
  letter-spacing: -0.02em;
}
.brand span {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-links { display: flex; gap: 0.75rem; flex-wrap: wrap; font-size: 0.85rem; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--rose); }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.book-block {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.book-block:last-child { border-bottom: none; }
.book-block .conditional label { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; }
.clave-tomo {
  letter-spacing: 0.04em;
}


.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.65rem;
}
.tab {
  background: transparent;
  border: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1rem;
  border-radius: 0.75rem;
  cursor: pointer;
}
.tab.is-active {
  background: var(--rose-soft);
  color: #ffd6ec;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem 1.35rem;
  box-shadow: 0 25px 50px -18px rgba(0,0,0,.5);
}
.card h1 {
  font-family: var(--serif);
  font-size: 1.65rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.lead {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.section {
  margin: 0 0 1.35rem;
  padding: 1rem 0.9rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(0,0,0,.2);
}
.section h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.85rem;
  font-weight: 700;
}

.field { margin-bottom: 0.95rem; }
.field label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(192, 38, 122, 0.55);
  box-shadow: 0 0 0 3px var(--rose-soft);
}
.hint { font-size: 0.75rem; color: rgba(241,231,255,.4); margin-top: 0.3rem; line-height: 1.4; }
.warn-box {
  background: rgba(196, 92, 74, 0.14);
  border: 1px solid rgba(196, 92, 74, 0.35);
  color: var(--warn);
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 0.95rem;
}
.free-box {
  background: rgba(125, 206, 160, 0.1);
  border: 1px solid rgba(125, 206, 160, 0.35);
  color: rgba(241, 231, 255, 0.9);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  font-size: 0.86rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}
.free-box strong {
  color: var(--ok);
}
.notice-offline {
  background: rgba(100, 140, 220, 0.1);
  border: 1px solid rgba(120, 160, 240, 0.35);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  font-size: 0.86rem;
  line-height: 1.55;
  margin-bottom: 1.1rem;
  color: rgba(241, 231, 255, 0.9);
}
.notice-offline strong { color: #9ec0ff; }
.hint-inline {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: rgba(241, 231, 255, 0.45);
}
.engine-badge {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(241, 231, 255, 0.4);
  margin: 0 0 0.85rem;
  font-family: ui-monospace, monospace;
}


.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
  margin-top: 0.35rem;
}
.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 400;
  margin: 0;
  cursor: pointer;
}

.conditional {
  display: none;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}
.conditional.is-open { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.btn {
  appearance: none;
  border: none;
  border-radius: 0.9rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.85rem 1.25rem;
  width: 100%;
  transition: filter .15s;
}
.btn-primary {
  background: var(--rose);
  color: #fff;
  margin-top: 0.5rem;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  margin-top: 0.5rem;
}
.status { min-height: 1.2em; font-size: 0.85rem; margin: 0.65rem 0 0; text-align: center; }
.status.error { color: var(--warn); }
.status.ok { color: var(--ok); }

.panel { display: none; }
.panel.is-active { display: block; }

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #211d2b;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  z-index: 50;
  transition: transform .25s ease;
  max-width: 90vw;
  text-align: center;
}
.toast.is-show { transform: translateX(-50%) translateY(0); }

.session-bar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.9rem;
  background: var(--rose-soft);
  border-radius: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.session-bar.is-on { display: flex; flex-wrap: wrap; }
.session-bar strong { color: var(--gold); }
