/* marca.css — sistema de marca odemás compartido por la app (index.html) y el instalador.
   Geometría tomada de officedepot.com.mx (banda con esquinas inferiores redondeadas, tarjetas y
   botones de radio 5 px, inputs "material" con subrayado, Montserrat) con la paleta odemás.
   La CSP del backend es style-src 'self': todo CSS vive en archivos, nunca inline.
   El símbolo nunca se recolorea. */

@font-face {
  font-family: "Montserrat";
  src: url("/fuentes/montserrat-latin.woff2?v=1") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --rojo: #e42110;
  --rojo-oscuro: #c41a0d;
  --rojo-tinta: #b3160b;
  --naranja: #eb6508;
  --azul: #3564ac;
  --navy: #2c4874;
  --navy-oscuro: #22395e;
  --gris: #6c6868;
  --barra-rojo-1: #ce1417;
  --barra-rojo-2: #e20a13;
  --barra-navy: #2e4975;
  --barra-gris: #6f6b6a;

  --fondo: #f4f5f8;
  --papel: #ffffff;
  --campo: #ffffff;
  --placa: #ffffff;
  --banda: #2c4874;
  --titulo: #2c4874;
  --texto: #3a4352;
  --suave: #6c6868;
  --enlace: #3564ac;
  --linea: #e2e6ee;
  --borde-control: #7e889a;   /* 3.57:1 sobre --papel (WCAG 1.4.11) */
  --chip: #eef1f6;
  --sombra: 0 10px 30px -14px rgba(44, 72, 116, .28), 0 1px 3px rgba(44, 72, 116, .08);
  --sombra-placa: 0 14px 34px -14px rgba(0, 0, 0, .45);
  --patron-opacidad: .13;

  --radio: 5px;          /* tarjetas y botones, como officedepot.com.mx */
  --radio-placa: 10px;
  --radio-banda: 25px;   /* esquinas inferiores de la banda superior */
  --fuente: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --suave-curva: cubic-bezier(.2, .8, .2, 1);
  --rebote: cubic-bezier(.34, 1.4, .64, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0f1523;
    --papel: #171f31;
    --campo: #171f31;
    --placa: #ffffff;
    --banda: #22395e;
    --titulo: #f2f5fa;
    --texto: #c6cfdd;
    --suave: #98a3b7;
    --enlace: #9dbcf0;
    --linea: #283350;
    --borde-control: #66759a;
    --chip: #212b42;
    --sombra: 0 18px 44px -16px rgba(0, 0, 0, .65);
    --patron-opacidad: .11;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ——— Movimiento (solo transform/opacity/filter; todo se apaga con reduced-motion) ——— */
@keyframes sube      { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes baja      { from { opacity: 0; transform: translateY(-28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes revela    { from { opacity: 0; transform: translateY(14px) scale(.94); filter: blur(8px); }
                       to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }
@keyframes aparece   { from { opacity: 0; } to { opacity: var(--patron-opacidad); } }
@keyframes deriva    { to { transform: translateX(-520px); } }
@keyframes dibuja    { to { transform: scaleX(1); } }
@keyframes destello  { 0%, 100% { transform: translateX(-130%); } 60% { transform: translateX(230%); } }
@keyframes destello-barra { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }
@keyframes respira   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes carga     { 0% { transform: translateX(-100%); } 100% { transform: translateX(200%); } }
@keyframes sacude    { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
                       30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }

/* ——— Banda superior: navy, esquinas inferiores 25 px, patrón oficial tenue, lockup en placa ——— */
.hero {
  position: relative;
  background: var(--banda);
  border-radius: 0 0 var(--radio-banda) var(--radio-banda);
  padding: 0 20px 28px;
  text-align: center;
  overflow: hidden;
  animation: baja .7s var(--suave-curva) both;
}
.patron {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: var(--patron-opacidad);
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
  animation: aparece 1.2s ease-out both;
}
.patron::before {
  content: "";
  position: absolute;
  inset: 0 -520px 0 0;
  background-image: url("/iconos/patron-arcos-blanco.svg?v=1");
  background-size: 520px 260px;
  background-repeat: repeat;
  background-position: 0 -40px;
  will-change: transform;
  animation: deriva 140s linear infinite;
}
.brillo {
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 120%;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .22), transparent 60%);
}
.lockup {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 40px;
  padding: 16px 26px 18px;
  border-radius: var(--radio-placa);
  background: var(--placa);
  box-shadow: var(--sombra-placa);
  animation: revela .9s var(--suave-curva) .2s both;
}
.simbolo { width: 72px; height: 72px; display: block; }
.wordmark { width: 192px; height: auto; display: block; }

.barra {
  position: relative;
  display: flex;
  width: 224px;            /* 1.17 × wordmark, como en el master */
  height: 4px;
  margin: 10px 0 0;
  overflow: hidden;
}
.barra i {
  display: block;
  flex: 1 1 0;
  transform: scaleX(0);
  transform-origin: left;
  animation: dibuja .55s var(--suave-curva) both;
}
/* 6 tramos iguales, colores exactos de la barra del master */
.barra i:nth-child(1) { background: var(--barra-rojo-1); animation-delay: .6s; }
.barra i:nth-child(2) { background: var(--barra-rojo-2); animation-delay: .7s; }
.barra i:nth-child(3) { background: var(--naranja);      animation-delay: .8s; }
.barra i:nth-child(4) { background: var(--azul);         animation-delay: .9s; }
.barra i:nth-child(5) { background: var(--barra-navy);   animation-delay: 1s; }
.barra i:nth-child(6) { background: var(--barra-gris);   animation-delay: 1.1s; }
/* destello periódico que recorre la barra */
.barra::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 25%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  transform: translateX(-100%);
  animation: destello-barra 1.4s ease-in-out 2.2s infinite;
  animation-delay: 2.2s;
}

/* ——— Título de página fuera de la banda (como "Iniciar sesión" en officedepot.com.mx) ——— */
.titulo-pagina {
  margin: 22px 20px 0;
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--titulo);
  animation: sube .6s var(--suave-curva) .55s both;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--suave);
}

/* ——— Botones: planos, radio 5, Montserrat Bold (officedepot.com.mx) + destello y estado de carga ——— */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--radio);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.btn::before {  /* destello que recorre el botón al pasar el cursor / al enfocar */
  content: "";
  position: absolute;
  top: -20%; bottom: -20%; left: 0;
  width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: translateX(-130%) skewX(-12deg);
  pointer-events: none;
}
.btn:hover::before, .btn:focus-visible::before { animation: destello 1.1s ease-in-out; }
.btn-primario { background: var(--rojo); color: #fff; }
.btn-primario:hover { background: var(--rojo-oscuro); transform: translateY(-1px); box-shadow: 0 10px 22px -12px rgba(228, 33, 16, .6); }
.btn-primario:active { transform: translateY(0) scale(.985); }
.btn-secundario { background: var(--chip); color: var(--titulo); }
.btn-secundario:hover { background: var(--linea); transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--azul); outline-offset: 3px; }
@media (prefers-color-scheme: dark) { .btn:focus-visible { outline-color: var(--enlace); } }
.btn[disabled], .btn[aria-busy="true"] { cursor: default; transform: none; box-shadow: none; }
.btn[aria-busy="true"] .btn-texto { opacity: .55; }
.btn .btn-carga {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  overflow: hidden;
  display: none;
}
.btn[aria-busy="true"] .btn-carga { display: block; }
.btn .btn-carga::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 45%;
  background: rgba(255, 255, 255, .85);
  animation: carga 1.1s ease-in-out infinite;
}
.btn-secundario .btn-carga::before { background: var(--azul); }

/* enlaces de acción (estilo "¿Olvidaste tu contraseña?") */
.liga {
  background: none;
  border: 0;
  padding: 6px 4px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--enlace);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  cursor: pointer;
  transition: color .18s ease, opacity .18s ease;
}
.liga:hover { color: var(--rojo); }
.liga[disabled] { color: var(--suave); text-decoration: none; cursor: default; }
.liga:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; border-radius: 3px; }
.separador {
  margin: 10px 0 2px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--suave);
}

/* ——— Campos "material": sin caja, subrayado que se ilumina desde el centro, etiqueta flotante ——— */
.campo { position: relative; margin: 22px 0 0; padding-top: 18px; }
.campo input {
  display: block;
  width: 100%;
  height: 40px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1.5px solid var(--borde-control);
  border-radius: 0;
  background: transparent;
  color: var(--titulo);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  outline: none;
  transition: border-color .2s ease;
}
.campo input::placeholder { color: transparent; }
.campo label {
  position: absolute;
  left: 0;
  right: 0;
  top: 26px;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--suave);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: top .22s var(--suave-curva), font-size .22s var(--suave-curva), letter-spacing .22s ease, color .22s ease;
}
.campo label .req { color: var(--rojo); margin-right: 2px; font-weight: 700; }
.campo .linea {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--rojo);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .28s var(--suave-curva);
}
.campo input:focus ~ .linea, .campo input[aria-invalid="true"] ~ .linea { transform: scaleX(1); }
.campo input:focus ~ label,
.campo input:not(:placeholder-shown) ~ label {
  top: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.campo input:focus ~ label { color: var(--rojo); }
.campo input[aria-invalid="true"] { border-bottom-color: var(--rojo); }
.campo input[aria-invalid="true"] ~ label { color: var(--rojo-tinta); }
@media (prefers-color-scheme: dark) {
  .campo input[aria-invalid="true"] ~ label { color: #ff8f86; }
}

/* ——— Avisos y errores ——— */
.aviso {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: var(--radio);
  background: rgba(44, 72, 116, .09);
  border-left: 3px solid var(--navy);
  color: var(--texto);
  font-size: 14px;
  line-height: 1.5;
}
.aviso:empty { display: none; }
@media (prefers-color-scheme: dark) { .aviso { background: rgba(157, 188, 240, .12); border-left-color: var(--enlace); } }
.error {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: var(--radio);
  background: rgba(228, 33, 16, .08);
  border-left: 3px solid var(--rojo);
  color: var(--rojo-tinta);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  animation: sube .35s var(--suave-curva) both;
}
@media (prefers-color-scheme: dark) { .error { background: rgba(228, 33, 16, .18); color: #ff8f86; } }

@media (min-width: 900px) {
  .hero { padding-bottom: 34px; }
  .lockup { margin-top: 44px; gap: 8px; }
  .simbolo { width: 88px; height: 88px; }
  .wordmark { width: 236px; }
  .barra { width: 276px; margin-top: 12px; }
  .titulo-pagina { font-size: 24px; margin-top: 28px; }
}

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