/* Arctic16 Afiliados — estilos (marca Arctic16: azul marino, naranja y azul cielo) */
@font-face { font-family: "Inter"; src: url("../fonts/inter-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --navy: #0B2F7E; --navy-2: #082460; --navy-soft: #D5E1F7;
  --orange: #F25C05; --orange-text: #B84300; --orange-soft: #FFF1E8; --orange-line: #F9C9A8;
  --sky: #00A3E0; --sky-soft: #E6F6FD;
  --bg: #F3F6FB; --card: #FFFFFF; --line: #DCE3EE; --input: #CBD5E4;
  --text: #0F1B33; --muted: #55627A; --green: #0B7A3E; --green-soft: #E7F6EE; --red: #B42318;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-2); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-family: "Poppins", sans-serif; font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: calc(var(--safe-top) + 14px) 20px calc(var(--safe-bottom) + 24px); }
.app.with-nav { padding-bottom: calc(var(--safe-bottom) + 104px); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; } .xs { font-size: 12px; }
.center { text-align: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orange { color: var(--orange-text); } .green { color: var(--green); } .red { color: var(--red); } .navy { color: var(--navy); }
.money { font-family: "Poppins", sans-serif; font-weight: 700; }

/* encabezado */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; }
.topbar .logo { height: 46px; width: auto; }
.lang-btn { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--input); background: var(--card); color: var(--navy); font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.avatar { width: 40px; height: 40px; border-radius: 20px; background: var(--navy); color: #fff; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.page-title { display: flex; align-items: center; gap: 12px; }

/* héroe (registro) */
.hero { background: var(--navy); color: #fff; margin: calc(-14px - var(--safe-top)) -20px 0; padding: calc(var(--safe-top) + 20px) 20px 26px; border-radius: 0 0 28px 28px; display: flex; flex-direction: column; gap: 16px; }
.hero .logo-chip { background: #fff; border-radius: 14px; padding: 6px 10px; display: inline-flex; }
.hero .logo-chip img { height: 44px; width: auto; }
.hero h1 { color: #fff; font-size: 26px; }
.hero p { color: var(--navy-soft); }
.hero .lang-btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }

/* tarjetas */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.card.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.card.soft { background: var(--sky-soft); border-color: var(--sky-soft); color: var(--navy); }
.card.warn { background: var(--orange-soft); border-color: var(--orange-line); }
.tile { border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; min-width: 0; }
.tile .k { font-size: 12px; font-weight: 600; }
.tile .v { font-family: "Poppins", sans-serif; font-size: 20px; font-weight: 700; }
.tile.orange { background: var(--orange); color: #fff; }
.tile.ghost { background: rgba(255,255,255,.12); color: #fff; }
.tile.ghost .k { color: var(--navy-soft); }
.tile.white { background: var(--card); border: 1px solid var(--line); }
.tile.white .k { color: var(--muted); }
.tile.navy { background: var(--navy); color: #fff; }
.tile.navy .k { color: var(--navy-soft); }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--text); }
a.item:hover { border-color: var(--input); color: var(--text); }
.item.hot { border-color: var(--orange-line); }
.item-title { font-weight: 600; font-size: 15px; }
.item-sub { font-size: 12px; color: var(--muted); }
.bars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.bars i { height: 6px; border-radius: 3px; background: var(--line); }
.bars i.on { background: var(--sky); }
.bars.done i.on { background: var(--green); }
.empty { text-align: center; padding: 26px 16px; color: var(--muted); border: 1px dashed var(--input); border-radius: 14px; background: var(--card); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--sky-soft); color: var(--navy); font-size: 14px; }
.alert.warn { background: var(--orange-soft); color: #8A3300; }
.alert.error { background: #FDECEC; color: var(--red); }
.alert.ok { background: var(--green-soft); color: var(--green); }
a.alert:hover { filter: brightness(.98); }
.chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--sky-soft); color: var(--navy); white-space: nowrap; }
.chip.orange { background: var(--orange-soft); color: #8A3300; }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: #FDECEC; color: var(--red); }
.chip.gray { background: #EEF1F6; color: var(--muted); }
.breakdown { background: var(--bg); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.breakdown .total { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 600; }
.copy-row { display: flex; align-items: center; gap: 8px; background: var(--sky-soft); border-radius: 12px; padding: 8px 8px 8px 14px; }
.copy-row span { flex: 1; min-width: 0; font-weight: 600; color: var(--navy); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.steps li.on { color: var(--text); font-weight: 600; }
.steps .dot { width: 28px; height: 28px; border-radius: 14px; border: 1px solid var(--input); background: var(--card); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.steps li.on .dot { background: var(--navy); border-color: var(--navy); color: #fff; }
.timeline { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.timeline > div { display: flex; gap: 10px; } .timeline i { width: 8px; height: 8px; border-radius: 4px; background: var(--sky); margin-top: 6px; flex-shrink: 0; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.t td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t .n { text-align: right; white-space: nowrap; }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 12px; border: 0; cursor: pointer; background: var(--orange); color: #fff; font-weight: 600; font-size: 16px; text-align: center; transition: transform .15s ease, filter .15s ease; }
.btn:hover { color: #fff; filter: brightness(1.05); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.navy { background: var(--navy); }
.btn.outline { background: var(--card); color: var(--text); border: 1px solid var(--input); }
.btn.outline:hover { color: var(--text); }
.btn.ghost { background: transparent; color: var(--navy); min-height: 44px; }
.btn.ghost:hover { color: var(--navy-2); }
.btn.danger { background: transparent; color: var(--red); min-height: 44px; }
.btn.sm { min-height: 40px; font-size: 14px; padding: 8px 14px; width: auto; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.outline .spinner, .btn.ghost .spinner { border-color: rgba(11,47,126,.2); border-top-color: var(--navy); }
@keyframes spin { to { transform: rotate(360deg); } }

/* pestañas y opciones */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.segmented button, .segmented a { min-height: 40px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 6px; text-align: center; line-height: 1.15; }
.segmented .on { background: var(--navy); color: #fff; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--input); background: var(--card); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; }
.choice.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.choices.boxes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.choices.boxes .choice { border-radius: 12px; }
.choices.boxes .choice.on { background: var(--sky-soft); color: var(--navy); border: 2px solid var(--navy); }

/* formularios */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 14px; font-weight: 500; }
.input, .select, .textarea { width: 100%; min-height: 50px; border-radius: 12px; border: 1px solid var(--input); background: var(--card); color: var(--text); padding: 0 14px; font: inherit; font-size: 16px; outline: none; }
.textarea { padding: 12px 14px; min-height: 84px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2355627A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11,47,126,.12); }
.input::placeholder, .textarea::placeholder { color: #7A869C; }
.input[readonly] { background: var(--bg); color: var(--muted); }
.input-group { display: flex; align-items: center; min-height: 50px; border-radius: 12px; border: 1px solid var(--input); background: var(--card); padding: 0 6px 0 14px; }
.input-group:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11,47,126,.12); }
.input-group .input { border: 0; padding: 0; min-height: 48px; box-shadow: none; }
.input-group .prefix { color: var(--muted); font-weight: 600; margin-right: 4px; }
.input.code { text-align: center; font-size: 26px; letter-spacing: 10px; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--navy); }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); cursor: pointer; }
.rules { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.rules span { display: flex; gap: 8px; align-items: center; } .rules i { width: 8px; height: 8px; border-radius: 4px; background: var(--input); }
.rules .ok { color: var(--green); } .rules .ok i { background: var(--green); }
.form-error { color: var(--red); font-size: 14px; }
.hint { font-size: 12px; color: var(--muted); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 14px; font-weight: 500; margin-bottom: 8px; padding: 0; }

/* navegación inferior */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom); }
.nav-inner { max-width: 480px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); height: 66px; }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 600; position: relative; }
.nav a.on { color: var(--navy); }
.nav .dot { position: absolute; top: 8px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--orange); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* avisos y diálogos */
.toast-wrap { position: fixed; left: 0; right: 0; top: calc(var(--safe-top) + 10px); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { max-width: 440px; width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 14px; box-shadow: 0 12px 30px rgba(11,47,126,.25); animation: drop .25s ease; }
.toast.error { background: var(--red); }
@keyframes drop { from { transform: translateY(-12px); opacity: 0; } }
dialog.sheet { border: 0; border-radius: 18px; padding: 20px; width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 48px); background: var(--card); color: var(--text); box-shadow: 0 30px 60px rgba(15,27,51,.3); }
dialog.sheet::backdrop { background: rgba(15,27,51,.45); }
.loading { display: flex; justify-content: center; padding: 48px 0; }
.loading .spinner { width: 28px; height: 28px; border-color: rgba(11,47,126,.15); border-top-color: var(--navy); }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; width: 232px; height: 232px; margin: 0 auto; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
