/* giglih · components.css — requiere tokens.css. Sin dependencias externas. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-md)/var(--lh-base) var(--font-sans); -webkit-font-smoothing: antialiased; text-wrap: pretty; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
code, kbd, pre { font-family: var(--font-mono); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 28px; height: 28px; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-xs); line-height: 1.45; color: var(--text-3); }

/* ---------- Composición ---------- */
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.stack--sm { gap: var(--s-2); }
.stack--lg { gap: var(--s-6); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.cluster--end { justify-content: flex-end; }
.cluster--between { justify-content: space-between; }
.self-start { align-self: flex-start; }
.grow { flex: 1 1 260px; }
.w-sm { max-width: 560px; }
.w-md { max-width: 720px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--s-4); align-items: stretch; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand__logo { width: 32px; height: 32px; }
.brand__name { font-weight: 600; font-size: 20px; line-height: 1; letter-spacing: -.02em; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: var(--tap); padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-md); background: none; color: inherit; font: 600 15px/1.2 var(--font-sans); text-decoration: none; cursor: pointer; }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--danger-solid); color: var(--on-danger-solid); }
.btn--danger:hover { filter: brightness(.92); color: var(--on-danger-solid); }
.btn--danger-soft { background: var(--surface); color: var(--danger); border-color: var(--border-strong); }
.btn--danger-soft:hover { background: var(--danger-bg); color: var(--danger); }
.btn--warning-soft { background: var(--surface); color: var(--warning); border-color: var(--warning-border); }
.btn--sm { padding: 0 14px; font-size: 14px; }
.btn--lg { min-height: 48px; padding: 0 22px; font-size: 16px; }
.btn--block { display: flex; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--surface-2); color: var(--text-3); border-color: var(--border); cursor: not-allowed; filter: none; }
.icon-btn { width: var(--tap); height: var(--tap); display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link-btn { align-self: flex-start; display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 500; }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.form[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-weight: 500; font-size: var(--fs-sm); line-height: 1.4; }
.field__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.field__row a { font-weight: 500; font-size: var(--fs-sm); display: inline-flex; align-items: center; min-height: var(--tap); margin: -12px 0; }
.field__input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: 400 16px/1.3 var(--font-sans); }
.field__input:focus-visible { outline-offset: 1px; border-color: var(--focus); }
.field__input:disabled { background: var(--surface-2); color: var(--text-3); border-color: var(--border); }
.field__input--mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: .04em; }
.field__hint { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-xs); line-height: 1.45; color: var(--text-3); }
.field__error { display: flex; gap: 6px; align-items: flex-start; font-weight: 500; font-size: var(--fs-xs); line-height: 1.45; color: var(--danger); }
.field__hint .icon, .field__error .icon { width: 16px; height: 16px; margin-top: 1px; }
.field--error .field__input { border: 2px solid var(--danger); padding: 11px 13px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--s-4); }

/* Opción tipo tarjeta (radio) */
.choice-group { display: flex; flex-direction: column; gap: 10px; }
.choice-group__legend { margin-bottom: 10px; font-weight: 600; font-size: var(--fs-md); }
.choice { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); cursor: pointer; }
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--focus); }
.choice:has(input:checked) { border: 2px solid var(--focus); padding: 0 15px; background: var(--accent-soft); }
.choice:has(input:disabled) { background: var(--surface-2); border-color: var(--border); color: var(--text-3); cursor: not-allowed; }
.choice__label { flex: 1; font-weight: 600; font-size: 15px; }
.choice__meta { font-size: var(--fs-xs); color: var(--text-2); }

/* ---------- Avisos ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid; border-radius: var(--r-md); font-size: var(--fs-sm); line-height: 1.5; color: var(--text); }
.alert strong { font-weight: 600; }
.alert--info { background: var(--info-bg); border-color: var(--info-border); }
.alert--info > .icon { color: var(--info); }
.alert--success { background: var(--success-bg); border-color: var(--success-border); }
.alert--success > .icon { color: var(--success); }
.alert--warning { background: var(--warning-bg); border-color: var(--warning-border); }
.alert--warning > .icon { color: var(--warning); }
.alert--danger { background: var(--danger-bg); border-color: var(--danger-border); }
.alert--danger > .icon { color: var(--danger); }
.note { display: flex; gap: 8px; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-2); }
.note > .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--info); }

/* ---------- Etiquetas ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-full); font: 600 12px/1 var(--font-sans); white-space: nowrap; }
.badge .icon { width: 14px; height: 14px; }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--neutral { background: var(--surface-2); color: var(--text-2); }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--accent { background: var(--accent-soft); color: var(--accent-text); }
.badge--soon { border: 1px dashed var(--border-strong); color: var(--text-3); }
.badge--unverified { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }

/* ---------- Tarjetas ---------- */
.card { display: flex; flex-direction: column; gap: 20px; padding: clamp(18px, 2.2vw, 28px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card--accent { border: 2px solid var(--accent); box-shadow: none; }
.card__title { font-weight: 600; font-size: var(--fs-lg); line-height: 1.3; }
.card__desc { margin-top: 4px; font-size: var(--fs-sm); color: var(--text-2); }
.card--row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }

/* Tarjeta de conector: estados con badge + aviso; .connector--soon para «próximamente» */
.connector { display: flex; flex-direction: column; gap: var(--s-4); padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.connector__head { display: flex; gap: 14px; align-items: flex-start; }
.connector__logo { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); font-weight: 700; font-size: 16px; color: var(--text-2); }
.connector__info { flex: 1; min-width: 0; }
.connector__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.connector__name { font-weight: 600; font-size: 17px; line-height: 1.3; }
.connector__account { margin-top: 4px; font-size: var(--fs-sm); line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; }
.connector__meta { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-2); }
.connector__meta .icon { width: 18px; height: 18px; color: var(--text-3); }
.connector__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.connector--soon { background: transparent; border-style: dashed; border-color: var(--border-strong); box-shadow: none; }
.connector--soon .connector__name { color: var(--text-2); }
.connector--soon .connector__account { color: var(--text-3); }

/* Enlace destacado (siguiente paso) */
.callout { display: flex; align-items: center; gap: 16px; min-height: var(--tap); padding: 18px 20px; border-radius: var(--r-lg); background: var(--accent-soft); color: var(--text); text-decoration: none; }
.callout:hover { color: var(--text); }
.callout > .icon:first-child { width: 24px; height: 24px; color: var(--accent-text); }
.callout__body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.callout__title { font-weight: 600; font-size: 15px; }
.callout__text { font-size: var(--fs-sm); color: var(--text-2); }

/* ---------- Bloque de código con «Copiar» ---------- */
.code { min-width: 0; background: var(--code-bg); border-radius: var(--r-md); overflow: hidden; }
.code__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px 6px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.code__label { font-weight: 500; font-size: 12px; letter-spacing: .02em; color: var(--code-muted); }
.code__copy { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 14px; border: 1px solid rgba(255,255,255,.18); border-radius: var(--r-sm); background: transparent; color: #FFFFFF; font: 600 14px/1 var(--font-sans); cursor: pointer; }
.code__copy:hover { background: rgba(255,255,255,.08); }
.code__copy .icon { width: 16px; height: 16px; }
.code__body { display: block; margin: 0; padding: 14px; white-space: pre-wrap; word-break: break-all; font-size: 14px; line-height: 1.6; color: var(--code-text); }
.code--key .code__body { font-size: clamp(15px, 1.6vw, 18px); font-weight: 500; }
.code-inline { font: 500 .9em var(--font-mono); color: var(--text); }
.kbd { font: 500 .9em var(--font-mono); padding: 1px 6px; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--text); }

/* ---------- Lista responsive: tabla en ≥768 px, filas apiladas en móvil ---------- */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.list__head, .list__row { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 12px; align-items: center; padding: 10px 20px; }
.list__head { padding-block: 12px; background: var(--surface-2); font-weight: 600; font-size: 13px; color: var(--text-2); }
.list__row { border-top: 1px solid var(--border); font-size: 15px; }
.list__cell { min-width: 0; }
.list__cell--primary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-weight: 500; }
.list__cell--muted { color: var(--text-2); }
.list__sub { flex-basis: 100%; font-weight: 400; font-size: var(--fs-xs); color: var(--text-2); }
.list__cell--end { justify-self: end; }
@media (max-width: 767px) {
  .list__head { display: none; }
  .list__head + .list__row { border-top: 0; }
  .list__row { grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 16px; }
  .list__cell { grid-column: 1; font-size: 13px; color: var(--text-2); }
  .list__cell--primary { font-size: 15px; color: var(--text); }
  .list__cell[data-label]::before { content: attr(data-label) ": "; }
  .list__cell--end { grid-column: 2; grid-row: 1 / span 3; }
}

/* ---------- Estado vacío e iconos de estado ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: clamp(40px, 6vw, 80px) 24px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }
.empty__title { font-weight: 600; font-size: 19px; line-height: 1.3; }
.empty__text { max-width: 26em; font-size: 15px; color: var(--text-2); }
.status-icon { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--text-2); }
.status-icon .icon { width: 28px; height: 28px; }
.status-icon--success { background: var(--success-bg); color: var(--success); }
.status-icon--danger { background: var(--danger-bg); color: var(--danger); }
.status-icon--accent { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- Diálogo de confirmación ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--scrim); }
.dialog { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 16px; padding: 24px; border: 0; border-radius: var(--r-xl); background: var(--surface); color: var(--text); box-shadow: var(--shadow-3); }
dialog.dialog::backdrop { background: var(--scrim); }
.dialog__title { font-weight: 600; font-size: 21px; line-height: 1.3; }
.dialog__text { font-size: 15px; color: var(--text-2); }
.dialog__text strong { color: var(--text); font-weight: 600; }
.dialog__actions { display: flex; flex-wrap: wrap-reverse; gap: 10px; }
.dialog__actions .btn { flex: 1 1 140px; min-height: 48px; }
@media (max-width: 767px) { .modal { align-items: flex-end; padding: 12px; } }

/* ---------- Pasos numerados (guía) ---------- */
.guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 20px; align-items: start; }
.steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.step { display: flex; gap: 14px; }
.step__num { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 13px; }
.step__num--muted { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); }
.step__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-top: 3px; font-size: 15px; }
.path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 600; font-size: var(--fs-sm); }
.path__item { padding: 5px 9px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.path .icon { width: 14px; height: 14px; color: var(--text-3); }

/* ---------- Web pública ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--gutter); border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header__nav { display: flex; align-items: center; gap: 8px; }
.site-header__link { display: none; align-items: center; min-height: var(--tap); padding: 0 14px; color: var(--text); font-weight: 500; font-size: 15px; text-decoration: none; }
@media (min-width: 768px) { .site-header__link { display: inline-flex; } }
.hero { padding: clamp(48px, 8vw, 120px) var(--gutter); background: var(--surface); }
.hero__inner { max-width: var(--site-max); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: clamp(40px, 6vw, 96px); }
.hero__copy { flex: 1 1 440px; display: flex; flex-direction: column; gap: 24px; }
.hero__title { font-weight: 600; font-size: clamp(38px, 5.6vw, 68px); line-height: 1.04; letter-spacing: -.025em; }
.hero__lead { max-width: 34em; font-size: clamp(17px, 1.5vw, 20px); color: var(--text-2); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.draft { flex: 1 1 360px; max-width: 520px; padding: clamp(14px, 2vw, 24px); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-xl); }
.draft__card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden; }
.draft__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: var(--fs-sm); }
.draft__body { display: flex; flex-direction: column; gap: 12px; padding: 18px; font-size: 15px; line-height: 1.6; }
.draft__foot { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.draft__note { display: flex; gap: 8px; align-items: center; margin: 12px 4px 0; font-size: 13px; color: var(--text-2); }
.draft__note .icon { width: 16px; height: 16px; color: var(--accent-text); }
.section { padding: clamp(56px, 7vw, 104px) var(--gutter); }
.section--flush-top { padding-top: 0; }
.section--band { background: var(--band-bg); color: var(--on-band); }
.section__inner { max-width: var(--site-max); margin: 0 auto; display: flex; flex-direction: column; gap: clamp(24px, 3vw, 48px); }
.section__title { font-weight: 600; font-size: clamp(26px, 2.8vw, 38px); line-height: 1.15; letter-spacing: -.015em; }
.section__lead { max-width: 640px; margin-top: 12px; font-size: 17px; color: var(--text-2); }
.section--band .section__lead { color: var(--on-band-2); }
.how { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: clamp(16px, 2vw, 32px); }
.how__item { display: flex; flex-direction: column; gap: 12px; padding-top: 20px; border-top: 2px solid var(--text); }
.how__item:last-child { border-top-color: var(--accent); }
.how__num { font: 500 14px/1 var(--font-mono); color: var(--accent-text); }
.how__title { font-weight: 600; font-size: 20px; line-height: 1.3; }
.how__text { font-size: 15px; color: var(--text-2); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: clamp(20px, 3vw, 40px); }
.feature { display: flex; flex-direction: column; gap: 12px; }
.feature .icon { width: 28px; height: 28px; color: var(--accent); }
.feature__title { font-weight: 600; font-size: 18px; line-height: 1.3; }
.feature__text { font-size: 15px; color: var(--on-band-2); }
.cta { max-width: var(--site-max); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta__copy { flex: 1 1 380px; display: flex; flex-direction: column; gap: 10px; }
.cta__title { font-weight: 600; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; letter-spacing: -.01em; }
.site-footer { padding: 28px var(--gutter); border-top: 1px solid var(--border); background: var(--surface); }
.site-footer__inner { max-width: var(--site-max); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: var(--fs-sm); color: var(--text-2); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer__links a { display: inline-flex; align-items: center; min-height: var(--tap); }

/* ---------- Acceso (login, registro, recuperación) ---------- */
.auth { min-height: 100vh; display: flex; }
.auth__aside { display: none; }
@media (min-width: 768px) {
  .auth__aside { flex: 0 0 clamp(300px, 38vw, 560px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: clamp(32px, 4vw, 64px); background: var(--band-bg); color: var(--on-band); }
}
.auth__aside .brand { color: var(--on-band); }
.auth__claim { font-weight: 600; font-size: clamp(28px, 3vw, 40px); line-height: 1.1; letter-spacing: -.02em; }
.auth__points { list-style: none; padding: 0; margin-top: 28px; display: flex; flex-direction: column; gap: 14px; font-size: 15px; color: var(--on-band-2); }
.auth__points li { display: flex; gap: 12px; }
.auth__points .icon { color: var(--accent); }
.auth__legal { font-size: 13px; color: var(--on-band-2); }
.auth__legal a { color: var(--on-band); }
.auth__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.auth__topbar { display: flex; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
@media (min-width: 768px) { .auth__topbar { display: none; } }
.auth__center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 64px; padding: clamp(28px, 5vw, 72px) clamp(20px, 5vw, 72px); }
.auth__panel { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 24px; }
.auth__head { display: flex; flex-direction: column; gap: 8px; }
.auth__title { font-weight: 600; font-size: 28px; line-height: 1.2; letter-spacing: -.015em; }
.auth__desc { font-size: 15px; color: var(--text-2); }
.auth__desc strong { color: var(--text); font-weight: 600; }
.auth__foot { padding-top: 20px; border-top: 1px solid var(--border); font-size: 15px; color: var(--text-2); }
.auth__foot a { font-weight: 600; }

/* ---------- Consentimiento OAuth ---------- */
.consent-page { min-height: 100vh; display: flex; flex-direction: column; }
.consent-page__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px clamp(20px, 4vw, 40px); border-bottom: 1px solid var(--border); background: var(--surface); }
.consent-page__origin { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1.3 var(--font-mono); color: var(--text-2); }
.consent-page__origin .icon { width: 16px; height: 16px; color: var(--success); }
.consent-page__main { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 48px; padding: clamp(16px, 5vw, 72px) clamp(16px, 4vw, 40px); }
.consent { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 22px; padding: clamp(20px, 4vw, 36px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-2); }
.consent__parties { display: flex; align-items: center; gap: 10px; }
.consent__party { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); font-weight: 700; font-size: 20px; color: var(--text-2); }
.consent__party--warn { background: var(--warning-bg); border: 1px dashed var(--warning-border); color: var(--warning); }
.consent__party img { width: 48px; height: 48px; }
.consent__link { flex: 0 1 48px; height: 2px; background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 10px); }
.consent__title { font-weight: 600; font-size: clamp(22px, 2.2vw, 26px); line-height: 1.25; letter-spacing: -.01em; }
.consent__who { font-size: var(--fs-sm); color: var(--text-2); }
.consent__who strong { color: var(--text); font-weight: 600; }
.consent__scopes { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; padding: 18px 0; border-block: 1px solid var(--border); }
.consent__scopes h2 { margin-bottom: 10px; font-weight: 600; font-size: var(--fs-sm); }
.scope-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-sm); line-height: 1.45; }
.scope-list li { display: flex; gap: 10px; }
.scope-list .icon { width: 18px; height: 18px; margin-top: 1px; }
.scope-list--yes .icon { color: var(--success); }
.scope-list--no .icon { color: var(--danger); }
.return-domain { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.return-domain > .icon { color: var(--success); }
.return-domain__host { font: 600 17px/1.3 var(--font-mono); }
.return-domain__url { margin-top: 2px; font: 400 12px/1.4 var(--font-mono); color: var(--text-2); overflow-wrap: anywhere; }
.return-domain--warn { background: var(--warning-bg); border: 2px solid var(--warning-border); }
.return-domain--warn > .icon { color: var(--warning); }
.consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.consent__actions .btn { min-height: 48px; font-size: 16px; }

/* ---------- Zona privada: estructura y navegación ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.app__main { flex: 1; min-width: 0; padding: clamp(24px, 3.6vw, 56px) clamp(20px, 3.6vw, 56px) clamp(32px, 4vw, 64px); }
.app__content { max-width: var(--content-max); display: flex; flex-direction: column; gap: clamp(20px, 2.2vw, 32px); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head__text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; }
.page-head__title { font-weight: 600; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; letter-spacing: -.015em; }
.page-head__desc { max-width: 40em; font-size: 15px; color: var(--text-2); }

/* Móvil (< 768): barra superior + pestañas inferiores */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar__user { font-size: 13px; color: var(--text-2); }
.tabbar { position: sticky; bottom: 0; z-index: 10; display: flex; padding: 0 4px env(safe-area-inset-bottom); border-top: 1px solid var(--border); background: var(--surface); }
.tabbar__link { flex: 1; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 500; font-size: 12px; line-height: 1; color: var(--text-3); text-decoration: none; }
.tabbar__link .icon { width: 24px; height: 24px; }
.tabbar__link:hover { color: var(--text); }
.tabbar__link[aria-current="page"] { color: var(--accent-text); font-weight: 600; }
.sidenav, .nav-toggle { display: none; }

/* Tablet y escritorio (≥ 768): barra lateral */
@media (min-width: 768px) {
  .app { flex-direction: row; }
  .topbar, .tabbar { display: none; }
  .nav-toggle { display: block; }
  .sidenav { position: sticky; top: 0; flex: none; width: var(--sidenav-w); height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--border); }
}
.sidenav__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 20px; }
.sidenav__toggle { width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text-2); cursor: pointer; }
.sidenav__toggle:hover { background: var(--surface-2); color: var(--text); }
.sidenav__toggle .icon--expand { display: none; }
.nav-toggle:focus-visible ~ .sidenav .sidenav__toggle { outline: 3px solid var(--focus); outline-offset: 2px; }
.sidenav__link { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 0 12px; border-radius: var(--r-md); color: var(--text-2); font-weight: 500; font-size: 15px; line-height: 1.2; text-decoration: none; }
button.sidenav__link { width: 100%; border: 0; background: none; font-family: inherit; text-align: left; cursor: pointer; }
.sidenav__link:hover { background: var(--surface-2); color: var(--text); }
.sidenav__link[aria-current="page"] { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.sidenav__short { display: none; }
.sidenav__email { display: block; margin-top: 2px; font-weight: 400; font-size: 12px; color: var(--text-3); }
.sidenav__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }

/* Escritorio (≥ 1280): barra fija, sin botón de plegar */
@media (min-width: 1280px) { .nav-toggle, .sidenav__toggle { display: none; } }

/* Carril plegado: por defecto en 768–1023; al marcar el interruptor en 1024–1279 */
@media (min-width: 768px) and (max-width: 1023px) {
  .nav-toggle:not(:checked) ~ .sidenav { width: var(--rail-w); padding: 14px 8px; }
  .nav-toggle:not(:checked) ~ .sidenav .sidenav__top { flex-direction: column; padding: 0 0 10px; gap: 10px; }
  .nav-toggle:not(:checked) ~ .sidenav .brand__name,
  .nav-toggle:not(:checked) ~ .sidenav .sidenav__label,
  .nav-toggle:not(:checked) ~ .sidenav .sidenav__email,
  .nav-toggle:not(:checked) ~ .sidenav .icon--collapse { display: none; }
  .nav-toggle:not(:checked) ~ .sidenav .sidenav__short,
  .nav-toggle:not(:checked) ~ .sidenav .icon--expand { display: inline; }
  .nav-toggle:not(:checked) ~ .sidenav .sidenav__link { flex-direction: column; justify-content: center; gap: 5px; min-height: 64px; padding: 6px 4px; font-size: 12px; text-align: center; }
  .nav-toggle:not(:checked) ~ .sidenav .sidenav__link .icon { width: 22px; height: 22px; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .nav-toggle:checked ~ .sidenav { width: var(--rail-w); padding: 14px 8px; }
  .nav-toggle:checked ~ .sidenav .sidenav__top { flex-direction: column; padding: 0 0 10px; gap: 10px; }
  .nav-toggle:checked ~ .sidenav .brand__name,
  .nav-toggle:checked ~ .sidenav .sidenav__label,
  .nav-toggle:checked ~ .sidenav .sidenav__email,
  .nav-toggle:checked ~ .sidenav .icon--collapse { display: none; }
  .nav-toggle:checked ~ .sidenav .sidenav__short,
  .nav-toggle:checked ~ .sidenav .icon--expand { display: inline; }
  .nav-toggle:checked ~ .sidenav .sidenav__link { flex-direction: column; justify-content: center; gap: 5px; min-height: 64px; padding: 6px 4px; font-size: 12px; text-align: center; }
  .nav-toggle:checked ~ .sidenav .sidenav__link .icon { width: 22px; height: 22px; }
}


/* ---------- Selector de idioma (details/summary, sin JS) ---------- */
.lang { position: relative; }
.lang__btn { list-style: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: var(--tap); min-height: var(--tap); padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: 500 14px/1 var(--font-sans); cursor: pointer; user-select: none; }
.lang__btn::-webkit-details-marker { display: none; }
.lang__btn::marker { content: ""; }
.lang__btn:hover { background: var(--surface-2); }
.lang[open] > .lang__btn { background: var(--surface-2); border-color: var(--border-strong); }
.lang__menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; min-width: 200px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-2); }
.lang__opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); padding: 0 12px; border-radius: var(--r-sm); color: var(--text); font-size: 15px; text-decoration: none; }
.lang__opt:hover { background: var(--surface-2); color: var(--text); }
.lang__opt[aria-current="true"] { font-weight: 600; }
.lang__opt .icon { color: var(--accent-text); }
.lang__opt:not([aria-current="true"]) .icon { visibility: hidden; }
/* En la barra lateral: con aspecto de enlace de menú; el menú se abre hacia la derecha */
.lang--nav > .lang__btn { width: 100%; justify-content: flex-start; gap: 12px; padding: 0 12px; border: 0; background: none; color: var(--text-2); font-size: 15px; }
.lang--nav > .lang__btn:hover, .lang--nav[open] > .lang__btn { background: var(--surface-2); color: var(--text); }
.lang--nav .lang__menu { top: auto; bottom: 0; right: auto; left: calc(100% + 8px); }
/* Enlaces de idioma en el pie */
.lang-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.lang-links a { display: inline-flex; align-items: center; min-height: var(--tap); }
.lang-links a[aria-current="true"] { color: var(--text); font-weight: 600; text-decoration: none; }
.auth__aside .lang-links a { color: var(--on-band-2); }
.auth__aside .lang-links a[aria-current="true"] { color: var(--on-band); }

/* Cabeceras con selector */
.topbar__actions, .consent-page__actions { display: flex; align-items: center; gap: 12px; }
.auth__topbar { justify-content: space-between; gap: 12px; }
@media (min-width: 768px) {
  .auth__topbar { display: flex; justify-content: flex-end; padding: 20px clamp(20px, 4vw, 40px) 0; border-bottom: 0; background: transparent; }
  .auth__topbar .brand { display: none; }
}
@media (max-width: 420px) { .topbar__user { display: none; } }

/* ---------- Ajustes por idioma ---------- */
:lang(zh-Hans) { line-height: 1.7; }
:lang(zh-Hans) :is(.hero__title, .section__title, .auth__title, .auth__claim, .page-head__title, .consent__title, .cta__title, .dialog__title) { letter-spacing: 0; line-height: 1.3; }
:lang(zh-Hans) .eyebrow { letter-spacing: .02em; }
:lang(zh-Hans) .hero__title { font-size: clamp(36px, 5vw, 60px); }
/* Inglés: etiquetas cortas más largas; se ajusta el tamaño en lugar de partir palabras */
:lang(en) .tabbar__link { font-size: 11px; padding: 0 2px; text-align: center; }
@media (min-width: 768px) and (max-width: 1023px) {
  :lang(en) .nav-toggle:not(:checked) ~ .sidenav .sidenav__link { padding: 6px 2px; font-size: 11px; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  :lang(en) .nav-toggle:checked ~ .sidenav .sidenav__link { padding: 6px 2px; font-size: 11px; }
}

/* ---------- Solo para las maquetas estáticas (no usar en producción) ---------- */
.mock-state { width: 100%; max-width: var(--content-max); display: flex; align-items: center; gap: 12px; font: 600 12px/1 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.mock-state::after { content: ""; flex: 1; border-top: 1px dashed var(--border-strong); }
.auth__panel + .mock-state, .consent + .mock-state { max-width: 520px; }

/* ── M-ui-2: show-password toggle (button is created by forms.js) ─────────── */
.field--password { position: relative; }
.field--password .field__input { padding-right: 56px; }
.field__toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: none; color: var(--text-2); cursor: pointer; }
.field__toggle:hover { color: var(--text); }
.field__toggle[aria-pressed="true"] { color: var(--accent-text); }
.field__hint--ok { color: var(--success); }
.field__hint--ok .icon { color: var(--success); }
