/* Tribfan – sistema de diseño base.
   Tokens arriba; el resto los consume. Cambia la marca tocando solo :root. */
:root {
  --paper: #F5F3FB;
  --surface: #FFFFFF;
  --ink: #1C1640;
  --muted: #5E5883;
  --line: #DAD5EC;
  --action: #3A33F2;
  --on-action: #FFFFFF;
  --gold: #F0B93A;
  --danger: #B3261E;
  --ok: #17703F;
  --foil: linear-gradient(115deg, #8EF0D0 0%, #B9A6FF 35%, #FFC4D6 66%, #FFE7A1 100%);
  --font: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --r-panel: 22px;
  --r-field: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #120F2A; --surface: #1B1740; --ink: #EEEAFF; --muted: #A49FCB; --line: #2E2960;
    --action: #8C88FF; --on-action: #120F2A; --danger: #FF8A80; --ok: #6EE0A0;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--action); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Cabecera ---------- */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.5rem; letter-spacing: -0.04em; color: var(--ink); text-decoration: none; }
.brand::before { content: ""; width: 16px; height: 22px; border-radius: 4px; background: var(--foil); transform: rotate(-9deg); box-shadow: 0 0 0 2px var(--ink) inset; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-nav a:not(.btn):hover { text-decoration: underline; }
.site-nav form { margin: 0; }
.nav-links { display: flex; gap: 22px; }
@media (max-width: 720px) { .nav-links { display: none; } .site-nav { gap: 14px; } }

/* ---------- Botones y enlaces-botón ---------- */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border: 2px solid var(--action);
  border-radius: 999px; background: var(--action); color: var(--on-action); font: 700 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--action); }
.btn.small { padding: 8px 18px; font-size: .95rem; }
button.link { background: none; border: 0; padding: 0; color: var(--ink); font: 500 1rem var(--font); cursor: pointer; }
button.link:hover { text-decoration: underline; }

/* ---------- Portada: hero ---------- */
.hero { padding-block: clamp(32px, 7vw, 88px) clamp(48px, 8vw, 104px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { margin: 0 0 24px; font-weight: 800; font-size: clamp(2.5rem, 6.2vw, 4.7rem); line-height: 1.02; letter-spacing: -0.04em; }
.hero p.lead { margin: 0 0 32px; max-width: 34em; font-size: 1.2rem; color: var(--muted); }
.hero .actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } .hero .carnet-wrap { order: -1; } }

/* El carnet: lo único con holograma de toda la web */
.carnet-wrap { display: grid; justify-items: center; gap: 14px; perspective: 900px; }
.carnet { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 30%;
  position: relative; width: min(320px, 100%); aspect-ratio: 63 / 88; padding: 10px; border-radius: 20px; background: var(--foil);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .15s ease-out;
  box-shadow: 0 30px 60px -24px rgba(28, 22, 64, .55); animation: deal .9s cubic-bezier(.2, .8, .2, 1) both; color: #1C1640; }
.carnet::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 45%); mix-blend-mode: soft-light; }
.carnet-face { height: 100%; padding: 20px; border-radius: 12px; background: rgba(255, 255, 255, .78); display: flex; flex-direction: column; justify-content: space-between; }
.carnet-top { display: flex; justify-content: space-between; align-items: baseline; }
.carnet-top .wm { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.04em; }
.carnet-top .tag { font-size: .85rem; }
.carnet-name { font-weight: 800; font-size: 1.6rem; letter-spacing: -0.03em; line-height: 1.1; }
.carnet-name small { display: block; margin-top: 4px; font-weight: 500; font-size: .95rem; letter-spacing: 0; opacity: .75; }
.carnet-mods { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.carnet-mods li { padding: 3px 11px; border: 1.5px solid #1C1640; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.carnet-pts { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; border-top: 1.5px solid #1C1640; }
.carnet-pts strong { font-size: 1.5rem; letter-spacing: -0.02em; }
.carnet-cap { margin: 0; font-size: .9rem; color: var(--muted); }
@keyframes deal { from { opacity: 0; transform: translateY(24px) rotate(-5deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .carnet { animation: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- Secciones ---------- */
.section { padding-block: clamp(48px, 7vw, 96px); border-top: 1px solid var(--line); }
.section h2 { margin: 0 0 12px; font-weight: 800; font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.1; letter-spacing: -0.035em; }
.section .intro { margin: 0 0 40px; max-width: 36em; color: var(--muted); }

/* Módulos como filas, no como tarjetas iguales */
.rows { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.rows li { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2.4fr) auto; gap: 8px 32px; align-items: baseline; padding: 22px 0; border-bottom: 1px solid var(--line); }
.rows .name { font-weight: 800; font-size: 1.6rem; letter-spacing: -0.03em; }
.rows .desc { margin: 0; color: var(--muted); }
.badge { display: inline-block; padding: 3px 12px; border: 1.5px solid var(--line); border-radius: 999px; font-size: .9rem; font-weight: 600; white-space: nowrap; }
.badge.first { background: var(--gold); border-color: var(--gold); color: #1C1640; }
@media (max-width: 720px) { .rows li { grid-template-columns: 1fr; } }

/* Cartera: texto + extracto de ejemplo */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 80px); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.statement { margin: 0; padding: 8px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.statement .cap { margin: 16px 0 0; font-size: .9rem; color: var(--muted); }
.statement ul { margin: 0; padding: 0; list-style: none; }
.statement li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.statement li:last-child { border-bottom: 0; }
.statement .plus { color: var(--ok); font-weight: 700; } .statement .minus { color: var(--ink); font-weight: 700; }
.statement .pts { font-weight: 700; }
.statement .foot { padding-bottom: 14px; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 0; border-top: 2px solid var(--ink); }
.steps li { counter-increment: s; display: grid; grid-template-columns: 64px 1fr; gap: 8px 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(s); font-weight: 800; font-size: 2rem; line-height: 1; letter-spacing: -0.04em; }
.steps strong { display: block; font-size: 1.2rem; }
.steps span { color: var(--muted); }

.closing { background: var(--ink); color: #F5F3FB; padding-block: clamp(56px, 8vw, 112px); }
.closing .wrap { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.closing h2 { margin: 0; max-width: 16em; font-weight: 800; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -0.035em; }
.closing .btn { background: #F5F3FB; border-color: #F5F3FB; color: #1C1640; }

.site-footer { padding-block: 32px; color: var(--muted); font-size: .95rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Páginas interiores ---------- */
main.inner { padding-block: 24px 80px; }
.page-head { margin-bottom: 28px; }
.page-head h1 { margin: 0; font-weight: 800; font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.08; letter-spacing: -0.04em; }
.flash { margin-bottom: 24px; padding: 14px 18px; border: 1.5px solid var(--ok); border-radius: var(--r-field); color: var(--ok); background: var(--surface); }
.panel { margin-bottom: 24px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel h2 { margin: 0 0 12px; font-size: 1.15rem; }

.balances { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.balances > div { padding: 24px 28px; } .balances > div + div { border-left: 1px solid var(--line); }
.balances .label { color: var(--muted); }
.balances .amount { font-weight: 800; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; letter-spacing: -0.04em; }
.balances .pts { color: inherit; } .balances .pts::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 8px; border-radius: 50%; background: var(--gold); vertical-align: middle; }
@media (max-width: 560px) { .balances { grid-template-columns: 1fr; } .balances > div + div { border-left: 0; border-top: 1px solid var(--line); } }
.section-title { margin: 40px 0 12px; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.rows.compact li { grid-template-columns: 1fr auto; padding: 16px 0; } .rows.compact .name { font-size: 1.2rem; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 32px; margin: 0; } .dl dt { color: var(--muted); } .dl dd { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stats .panel { margin: 0; } .stats .n { font-weight: 800; font-size: 2.2rem; letter-spacing: -0.03em; }

/* ---------- Formularios y login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.auth-aside { background: var(--ink); color: #F5F3FB; padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-aside .brand { color: #F5F3FB; }
.auth-aside h2 { margin: 0; font-weight: 800; font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.08; letter-spacing: -0.035em; max-width: 12em; }
.auth-aside .carnet { width: 200px; animation: none; transform: rotate(-6deg); }
.auth-aside .carnet-face { padding: 12px; } .auth-aside .carnet-name { font-size: 1.05rem; } .auth-aside .carnet-top .wm { font-size: 1rem; }
.auth-aside .carnet-mods, .auth-aside .carnet-pts, .auth-aside .carnet-name small { display: none; }
.auth-main { display: grid; align-content: center; padding: clamp(28px, 5vw, 64px); }
.auth-form { width: min(440px, 100%); margin-inline: auto; }
.auth-form h1 { margin: 0 0 8px; font-weight: 800; font-size: 2.2rem; letter-spacing: -0.04em; line-height: 1.1; }
.auth-form .sub { margin: 0 0 24px; color: var(--muted); }
.auth-form .alt { margin-top: 28px; color: var(--muted); }
.mobile-brand { display: none; padding: 20px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-aside { display: none; } .mobile-brand { display: block; } }
label { display: block; margin: 18px 0 6px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=date] {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-field); background: var(--surface); color: var(--ink); font: inherit; }
input:focus { outline: 3px solid var(--action); outline-offset: 1px; border-color: var(--action); }
.hint { margin: 6px 0 0; font-size: .92rem; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; font-weight: 400; }
.check input { margin-top: 5px; accent-color: var(--action); }
.error { margin: 6px 0 0; font-size: .95rem; color: var(--danger); font-weight: 600; }
.form-actions { margin-top: 28px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.form-actions .btn { min-width: 150px; }

/* Ajustes móvil */
.rows .badge { justify-self: start; }
.statement li span:last-child { white-space: nowrap; }
@media (max-width: 560px) { .carnet { width: min(260px, 100%); } .carnet-face { padding: 16px; } }
