/* ============================================================
   Capitalario JND 2026 — App styles
   Mobile-first. Two themes: sobria (default) and cálida.
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #1a1919;
  font-family: var(--font-sans);
  color: var(--fg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--sch-cream);
  overflow-x: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 30px 80px rgba(0,0,0,0.18);
}

@media (min-width: 480px) {
  body {
    background: radial-gradient(ellipse at center top, #2a2828 0%, #141313 70%);
    padding: 24px 0;
  }
  .app-shell {
    border-radius: 28px;
    overflow: hidden;
    margin: 24px auto 60px;
    min-height: calc(100vh - 84px);
  }
}

/* ============================================================
   Header
   ============================================================ */
.app-header {
  position: relative;
  background: var(--sch-red);
  color: var(--sch-cream);
  padding: 28px 20px 38px;
  overflow: hidden;
}
.app-header-slim { padding: 22px 20px 24px; }

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.app-header-inner-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
}
.app-header-slim .app-header-inner-hero { min-height: 64px; }

.logo-jnd-hero {
  height: 120px;
  width: auto;
  max-width: 78%;
  filter: brightness(0) invert(1);
  opacity: 0.98;
  display: block;
}
.logo-jnd-hero-slim { height: 72px; }

.logo-sch-corner {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 22px;
  opacity: 0.8;
}
.app-header-slim .logo-sch-corner { height: 20px; }

.header-arc {
  position: absolute;
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%);
  width: 140%;
  height: 56px;
  background: var(--sch-cream);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.app-header-slim .header-arc { display: none; }

.theme-calida .app-header {
  background: linear-gradient(180deg, var(--sch-red-deep) 0%, var(--sch-red) 100%);
}

.info-header {
  background: var(--sch-cream);
  color: var(--sch-red);
  padding: 16px 20px;
  border-bottom: 1px solid var(--sch-gray-line);
}
.info-header .header-arc { display: none; }
.back-btn {
  background: transparent;
  border: 0;
  color: var(--sch-red);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 4px;
  letter-spacing: 0.02em;
}
.back-btn:hover { color: var(--sch-red-deep); }

/* ============================================================
   Pantalla 1 — Oración
   ============================================================ */
.oracion-body {
  padding: 36px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.eyebrow-row {
  text-align: center;
  margin-bottom: 18px;
}
.overline {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--sch-red);
}
.overline-large {
  font-size: 28px;
  letter-spacing: 0.04em;
  font-weight: 700;
  line-height: 1.15;
  display: inline-block;
}
.eyebrow-row-large {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--sch-gray-line);
}

.lema-simple {
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1.05;
  font-weight: 600;
  color: var(--sch-red);
  text-align: center;
  margin: 0 0 28px;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.lema-display {
  font-family: var(--font-serif);
  text-align: center;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 0.95;
}
.lema-display .lema-l1 {
  font-size: 38px;
  font-weight: 700;
  color: var(--sch-red);
  letter-spacing: -0.02em;
}
.lema-display .lema-l2 {
  font-size: 50px;
  font-weight: 700;
  color: var(--sch-red);
  letter-spacing: -0.025em;
}
.lema-display .lema-l2 em {
  font-style: italic;
  color: var(--sch-blue);
  font-weight: 600;
  position: relative;
}
.lema-display .lema-l2 em::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: -2px;
  height: 4px;
  background: var(--sch-yellow);
  border-radius: 2px;
  z-index: -1;
}
.theme-calida .lema-display .lema-l2 em::after {
  bottom: 2px;
  height: 8px;
  opacity: 0.85;
}

.oracion-texto {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.55;
  color: var(--sch-gray);
  text-align: left;
  margin: 0 0 28px;
  text-wrap: pretty;
  font-style: italic;
  max-width: none;
}
.oracion-texto-poema {
  white-space: pre-line;
  text-align: center;
  font-size: 18.5px;
  line-height: 1.5;
  color: var(--sch-gray);
  margin-bottom: 32px;
}
.theme-calida .oracion-texto-poema {
  font-size: 19px;
  line-height: 1.55;
}
.theme-calida .oracion-texto {
  text-align: center;
  font-size: 18px;
  line-height: 1.6;
}

.familia-field {
  margin-bottom: 28px;
}
.familia-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--sch-gray);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.familia-field .opt {
  font-weight: 400;
  color: var(--sch-gray-soft);
}
.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.select-wrap select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  color: var(--sch-gray);
  padding: 14px 40px 14px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--sch-gray-line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease);
}
.select-wrap select:focus {
  outline: 2px solid var(--sch-red);
  outline-offset: 2px;
  border-color: var(--sch-red);
}
.select-chev {
  position: absolute;
  right: 16px;
  width: 12px;
  height: 8px;
  color: var(--sch-gray-soft);
  pointer-events: none;
}

.btn-marcar {
  width: 100%;
  background: var(--sch-red);
  color: var(--sch-cream);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--font-serif);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-base) var(--ease);
  box-shadow: 0 5px 0 var(--sch-red-deep), 0 10px 20px rgba(167, 34, 32, 0.18);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.btn-marcar:hover { background: var(--sch-red-deep); }
.btn-marcar:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 var(--sch-red-deep), 0 6px 12px rgba(167, 34, 32, 0.18);
}
.btn-marcar-label {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.theme-calida .btn-marcar {
  background: var(--sch-red);
  box-shadow: 0 5px 0 var(--sch-red-deep), 0 14px 32px rgba(167, 34, 32, 0.28);
}
.theme-calida .btn-marcar-label { font-size: 28px; }

.microcopy {
  font-size: 13px;
  line-height: 1.45;
  color: var(--sch-gray-soft);
  text-align: center;
  margin: 0;
  max-width: 30ch;
  margin-left: auto;
  margin-right: auto;
  font-style: italic;
}

.cerrado-block {
  background: var(--bg-sunken);
  border: 1px solid var(--sch-gray-line);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  text-align: center;
}
.cerrado-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--sch-cream);
  background: var(--sch-gray);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}
.cerrado-msg {
  font-family: var(--font-serif);
  font-size: 19px;
  font-style: italic;
  color: var(--sch-red);
  line-height: 1.4;
  margin: 0 0 14px;
  max-width: none;
}
.cerrado-sub {
  font-size: 14px;
  color: var(--sch-gray);
  margin: 0;
  max-width: none;
}
.cerrado-sub strong {
  color: var(--sch-red);
  font-weight: 700;
}

/* ============================================================
   Pantalla 2 — Confirmación
   ============================================================ */
.confirm-body {
  padding: 28px 24px 32px;
}

.confirm-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 26px;
  color: var(--sch-red);
}

.check-stamp {
  display: inline-flex;
  color: var(--sch-red);
}
.check-circle {
  stroke-dasharray: 70;
  stroke-dashoffset: 70;
  animation: drawCircle 600ms var(--ease) forwards;
}
.check-tick {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: drawTick 360ms var(--ease) 380ms forwards;
}
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawTick   { to { stroke-dashoffset: 0; } }

.big-count {
  text-align: center;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.big-count-pre,
.big-count-post {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--sch-red);
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.big-count-pre { margin-bottom: -2px; }
.big-count-post { margin-top: -6px; }
.big-count-post:empty { display: none; }
.big-count-num {
  font-family: var(--font-serif);
  color: var(--sch-red);
  letter-spacing: -0.04em;
  line-height: 1;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
  margin: 4px 0;
}

.theme-calida .big-count-num {
  background: linear-gradient(180deg, var(--sch-red) 0%, var(--sch-red-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
}
.theme-calida .big-count {
  position: relative;
}
.theme-calida .big-count::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 219, 74, 0.25) 0%, rgba(255, 219, 74, 0) 65%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
}

.confirm-sub {
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
  color: var(--sch-gray);
  margin: 12px auto 18px;
  max-width: 32ch;
}
.confirm-sub strong {
  color: var(--sch-red);
  font-weight: 700;
}

.familia-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-sunken);
  color: var(--sch-gray);
  padding: 7px 14px 7px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  margin: 0 auto 22px;
  display: flex;
  width: fit-content;
}
.familia-chip svg { color: var(--sch-red); flex-shrink: 0; }
.familia-chip strong { color: var(--sch-ink); font-weight: 700; }

.invitacion {
  background: var(--bg-sunken);
  border-left: 3px solid var(--sch-red);
  padding: 16px 18px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 24px;
}
.invitacion p {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--sch-gray);
  max-width: none;
}
.theme-calida .invitacion {
  background: var(--sch-cream-warm);
  border-left-color: var(--sch-blue);
}

.action-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}
.btn-secondary {
  width: 100%;
  background: var(--bg-raised);
  color: var(--sch-gray);
  border: 1px solid var(--sch-gray-line);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.btn-secondary:hover {
  border-color: var(--sch-red);
  color: var(--sch-red);
}
.btn-secondary svg { color: #25D366; }

.btn-text {
  background: transparent;
  border: 0;
  color: var(--sch-red);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.btn-text:hover { color: var(--sch-red-deep); }
.btn-text-center { display: flex; margin: 24px auto 0; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sch-ink);
  color: var(--sch-cream);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: toastIn 220ms var(--ease);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   Desglose por familia
   ============================================================ */
.desglose {
  margin-top: 8px;
  padding-top: 28px;
  border-top: 1px solid var(--sch-gray-line);
}
.desglose-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 10px;
}
.desglose-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--sch-red);
  margin: 0;
  letter-spacing: -0.01em;
}
.desglose-sub {
  font-size: 12px;
  color: var(--sch-gray-soft);
  white-space: nowrap;
}

.desglose-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.desglose-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.desglose-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-sans);
}
.desglose-rank {
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 600;
  color: var(--sch-gray-soft);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.desglose-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--sch-ink);
  letter-spacing: -0.005em;
}
.desglose-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--sch-red);
  font-variant-numeric: tabular-nums;
}
.desglose-bar {
  height: 6px;
  background: var(--sch-cream-deep);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-left: 38px;
}
.desglose-bar-fill {
  height: 100%;
  background: var(--sch-red);
  border-radius: var(--radius-pill);
  transition: width 600ms var(--ease-soft);
}
.theme-calida .desglose-bar-fill {
  background: linear-gradient(90deg, var(--sch-red) 0%, var(--sch-red-soft) 100%);
}

.btn-ver-todas {
  width: 100%;
  margin-top: 22px;
  background: transparent;
  border: 1px dashed var(--sch-gray-line);
  border-radius: var(--radius-md);
  padding: 12px;
  color: var(--sch-red);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--dur-fast) var(--ease);
}
.btn-ver-todas:hover {
  border-color: var(--sch-red);
  border-style: solid;
}

.link-info {
  width: 100%;
  margin-top: 36px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--sch-gray-line);
  padding: 22px 4px 4px;
  color: var(--sch-gray);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color var(--dur-fast) var(--ease);
}
.link-info:hover { color: var(--sch-red); }

/* ============================================================
   Pantalla Info
   ============================================================ */
.info-body {
  padding: 28px 24px 36px;
}
.info-body .overline {
  display: block;
  text-align: center;
  margin-bottom: 8px;
}
.info-title {
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 700;
  color: var(--sch-red);
  text-align: center;
  margin: 0 0 18px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.info-lead {
  text-align: center;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--sch-gray);
  max-width: 36ch;
  margin: 0 auto 32px;
}

.info-data {
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--sch-gray-line);
}
.info-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--sch-gray-line);
  align-items: baseline;
}
.info-row dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--sch-red);
  margin: 0;
}
.info-row dd {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--sch-ink);
  margin: 0;
  line-height: 1.4;
  font-weight: 500;
  max-width: none;
}
.info-row dd em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--sch-red);
  font-weight: 600;
  font-size: 16px;
}

.info-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.4;
  color: var(--sch-red);
  border-left: 3px solid var(--sch-red);
  padding: 8px 0 8px 18px;
  margin: 0 0 32px;
  max-width: none;
  text-wrap: pretty;
}

.info-cta-block {
  background: var(--sch-cream-warm);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  text-align: center;
  margin-bottom: 8px;
}
.info-cta-sub {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sch-gray-soft);
  margin: 0 0 6px;
  max-width: none;
}
.info-cta-link {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--sch-red);
  text-decoration: none;
  display: inline-block;
  border-bottom: 2px solid var(--sch-red);
  padding-bottom: 2px;
}

/* ============================================================
   Footer
   ============================================================ */
.app-footer {
  padding: 22px 24px 28px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sch-gray-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-top: 1px solid var(--sch-gray-line);
  margin-top: 24px;
}
.app-footer .dot { opacity: 0.6; }

/* ============================================================
   Cálida theme global
   ============================================================ */
.theme-calida .app-shell {
  background: radial-gradient(ellipse 800px 400px at 50% 0%, var(--sch-cream-warm) 0%, var(--sch-cream) 60%);
}
.theme-calida .lema-simple { font-size: 44px; }

/* Screen entry animation */
.screen {
  animation: screenIn 320ms var(--ease-soft);
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
