/* Portal de afiliados: reutiliza el lenguaje visual del panel administrativo
   (../admin/admin.css debe estar publicado junto a /afiliados/) y añade lo propio. */
@import url('../admin/admin.css');

body.aff { min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1100px 520px at 0% -10%, #ffd9c2 0, transparent 60%), var(--bg); }
.aff-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 1040px; width: 100%; margin: 0 auto; padding: 16px; }
.aff-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.aff-brand strong { display: block; font-size: 1.2rem; letter-spacing: -0.03em; }
.aff-brand span { color: var(--orange-dark); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.aff-session { display: flex; align-items: center; gap: 10px; min-width: 0; }
.aff-session span { word-break: break-all; }
.aff-main { max-width: 1040px; width: 100%; margin: 0 auto; padding: 0 16px 40px; flex: 1; min-width: 0; }
.aff-foot { text-align: center; padding: 20px 16px 28px; }

.aff-hero { margin-bottom: 8px; }
.eyebrow { margin: 8px 0 6px; color: var(--orange-dark); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; }
.aff-hero h1 { font-size: clamp(1.6rem, 4.2vw, 2.5rem); line-height: 1.15; max-width: 760px; }
.hl { color: var(--orange); }
.lead { font-size: 1.05rem; color: var(--ink-2); max-width: 720px; margin: 14px 0 22px; }
.how { list-style: none; counter-reset: how; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.how li { counter-increment: how; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px; }
.how li::before { content: counter(how); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px;
  background: var(--orange); color: #fff; font-weight: 800; margin-bottom: 6px; }
.how span { color: var(--muted); font-size: .9rem; }
.example .card { margin: 0; }
.example .dl { margin: 10px 0; }
.example ul.plain li { margin-bottom: 6px; }

.aff-card { max-width: 640px; margin: 8px auto 24px; display: flex; flex-direction: column; gap: 14px; }
.aff-card h2 { font-size: 1.15rem; }
.aff-card p { margin: 0; }
.btn-link { background: transparent; color: var(--orange-dark); padding: 5px 4px; min-height: 32px; font-weight: 600; text-decoration: underline; }
.small-legend { font-weight: 700; font-size: .9rem; margin-bottom: 0; }
.small-legend small { font-weight: 400; color: var(--muted); }
fieldset.stack { padding: 0; }
#btn-add-channel { align-self: flex-start; }
.channels { display: flex; flex-direction: column; gap: 8px; }
.channel { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.channel select { width: 100%; }
.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; }
.check input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--orange); }

.share .copy-row { display: flex; gap: 8px; margin-top: 10px; }
.copy-field { flex: 1; min-width: 0; font-weight: 600; background: #faf9f7; }
.code-field { font-size: 1.3rem; letter-spacing: .14em; color: var(--orange-dark); font-weight: 800; }
#kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis .kpi .value { font-size: 1.35rem; word-break: break-word; }
.pad-x { padding: 0 16px 14px; margin: 10px 0 0; }
h3.sub { margin: 14px 0 6px; }
ol.plain { margin: 6px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }
.placeholder { background: #fff4d6; color: var(--warn); border: 1px dashed #e5a000; border-radius: 6px; padding: 0 6px; font-weight: 700; }

/* Términos */
.terms { max-width: 760px; margin: 0 auto; }
.terms h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin: 6px 0 12px; }
.terms h2 { font-size: 1.05rem; margin: 22px 0 6px; }
.terms p, .terms li { color: var(--ink-2); }
.terms ol, .terms ul { padding-left: 22px; }
.draft { margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: #fff4d6; border: 1px solid #f3d9a0; border-left: 5px solid #e5a000; color: var(--warn); font-weight: 600; }

/* Enlace /r/ */
.r-card { text-align: center; margin-top: 24px; }
.r-card h1 { font-size: clamp(1.4rem, 5vw, 1.9rem); line-height: 1.2; }
.r-code-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; border-radius: 14px; background: var(--orange-soft); }
.r-code { text-align: center; font-size: 2rem; max-width: 320px; width: 100%; background: #fff; }
.r-stores { justify-content: center; }
.r-stores .btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 900px) {
  .how { grid-template-columns: 1fr; }
  #kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r-stores .btn { width: 100%; }
}
@media (max-width: 520px) {
  .channel { grid-template-columns: minmax(0, 1fr) auto; }
  .channel select { grid-column: 1 / -1; }
  .share .copy-row { flex-direction: column; }
  .aff-session .muted { display: none; }
  .table th, .table td { padding: 9px 12px; }
}

/* Selector de idioma ES | EN */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; font-size: .8rem; color: var(--muted); }
.lang-switch button { background: none; border: 0; padding: 4px 6px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; border-radius: 6px; }
.lang-switch button:hover { color: var(--orange-dark); }
.lang-switch button[aria-current] { color: var(--orange-dark); text-decoration: underline; text-underline-offset: 3px; }
.lang-host { display: flex; justify-content: flex-end; margin: -6px -6px -10px 0; }
.aff-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
