/* Avisos MI — base compartida (tokens, reset, tipografía, botones, campos, marco HUD).
   Colores y tipografías tomados de mercadointeligente.net (mi-styles.css). */

:root {
  /* superficie */
  --bg: #04040A;
  --surface: #07070F;
  --surface-2: #0C0C1A;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);

  /* marca: los tres colores del hexágono de Mercado Inteligente */
  --acc: #30E962;
  --acc-rgb: 48, 233, 98;
  --acc-dim: rgba(48, 233, 98, .10);
  --sol: #FFCE00;
  --sol-rgb: 255, 206, 0;
  --cielo: #28A2DB;
  --cielo-rgb: 40, 162, 219;
  --alerta: #FF6B7A;
  --alerta-rgb: 255, 107, 122;

  /* texto (todos AA sobre --bg y --surface-2) */
  --text: #E4E4F2;
  --text-b: #FFFFFF;
  --muted: #9A9AB4;

  /* tipografías de la marca */
  --f-px: 'Press Start 2P', ui-monospace, monospace;      /* acentos HUD, solo etiquetas cortas */
  --f-display: 'Bungee', 'Archivo Black', system-ui, sans-serif;
  --f-ui: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --ease: cubic-bezier(.23, 1, .32, 1);
  --r: 10px;
  --corte: 12px;   /* esquina recortada del marco HUD */
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 80% 55% at 12% -5%, rgba(48, 233, 98, .10), transparent 60%),
    radial-gradient(ellipse 70% 55% at 100% 22%, rgba(40, 162, 219, .08), transparent 55%),
    radial-gradient(ellipse 90% 65% at 50% 108%, rgba(42, 77, 212, .09), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
/* líneas de barrido del sitio de la marca, muy tenues */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 1000; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0, 0, 0, .05) 3px 4px);
}

img, svg { display: block; max-width: 100%; }
a { color: var(--acc); text-underline-offset: 3px; }
code { font-family: var(--f-mono); font-size: .92em; color: var(--text-b); background: rgba(255, 255, 255, .06); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }
[hidden] { display: none !important; }

.solo-lector {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* foco visible en todo lo interactivo: amarillo de la marca, distinto del verde de acción */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--sol); outline-offset: 3px; }

/* ---------- etiquetas HUD ---------- */
.px {
  font-family: var(--f-px);
  font-size: .625rem;        /* 10px: es decoración de marca, el texto importante va en Poppins */
  letter-spacing: .18em;
  line-height: 2;
  text-transform: uppercase;
  color: var(--acc);
}

/* ---------- marca ---------- */
.marca { display: flex; align-items: center; gap: .65rem; color: var(--text-b); text-decoration: none; }
.marca img { width: 36px; height: 36px; flex: none; }
.marca-nombre { font-family: var(--f-display); font-size: 1.15rem; letter-spacing: .02em; line-height: 1; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .7rem 1.4rem;
  font: 700 .8rem/1.2 var(--f-ui); letter-spacing: .14em; text-transform: uppercase;
  color: var(--text); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 0;
  cursor: pointer; text-decoration: none; touch-action: manipulation;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { border-color: rgba(var(--acc-rgb), .5); color: var(--acc); background: var(--acc-dim); }
.btn:active { background: rgba(var(--acc-rgb), .18); }
/* los botones llenos llevan la esquina recortada de la marca; el recorte se come el outline, así que el foco va por dentro */
.btn-lleno, .btn-peligro-lleno { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px)); }
.btn-lleno:focus-visible, .btn-peligro-lleno:focus-visible { outline-offset: -5px; }

.btn-lleno { background: var(--acc); border-color: var(--acc); color: #000; }
.btn-lleno:hover { background: #5BF184; border-color: #5BF184; color: #000; box-shadow: 0 10px 34px rgba(var(--acc-rgb), .3); }
.btn-lleno:active { background: #22C452; }
.btn-lleno:focus-visible { outline-color: #000; }

.btn-peligro { color: var(--alerta); border-color: rgba(var(--alerta-rgb), .45); }
.btn-peligro:hover { color: var(--alerta); border-color: var(--alerta); background: rgba(var(--alerta-rgb), .10); }
.btn-peligro-lleno { background: var(--alerta); border-color: var(--alerta); color: #000; }
.btn-peligro-lleno:hover { background: #FF8C98; border-color: #FF8C98; color: #000; }
.btn-peligro-lleno:focus-visible { outline-color: #000; }

.btn-chico { min-height: 44px; padding: .5rem .9rem; font-size: .7rem; letter-spacing: .1em; }

.btn[disabled], .btn[aria-busy='true'] { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ---------- campos ---------- */
.campo { display: grid; gap: .4rem; min-width: 0; }
.campo label, .etiqueta { font-size: .85rem; font-weight: 600; color: var(--text-b); }
.ayuda { font-size: .82rem; color: var(--muted); }
input[type='text'], input[type='password'], input[type='url'], select {
  width: 100%; min-height: 48px; padding: .65rem .85rem;
  font: 400 1rem/1.3 var(--f-ui);   /* 16px: evita el zoom automático de iOS */
  color: var(--text-b); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 6px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input:hover, select:hover { border-color: rgba(255, 255, 255, .3); }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--sol); box-shadow: 0 0 0 3px rgba(var(--sol-rgb), .3); }
input[readonly] { color: var(--acc); background: var(--surface-2); font-family: var(--f-mono); font-size: .9rem; }
select { appearance: none; padding-right: 2.5rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239A9AB4' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center; background-size: 18px; }
select option { background: var(--surface-2); color: var(--text-b); }

/* ---------- marco HUD: borde fino con esquinas verdes en L ---------- */
.hud {
  position: relative;
  background: linear-gradient(180deg, rgba(12, 12, 26, .92), rgba(7, 7, 15, .92));
  border: 1px solid var(--line);
}
.hud::before, .hud::after {
  content: ''; position: absolute; width: 18px; height: 18px; pointer-events: none;
  border-color: var(--acc); border-style: solid;
}
.hud::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.hud::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
