/* Web de credenciales de proveedores.
   Sin recursos externos (la CSP solo permite estilos propios): fuente del
   sistema y todo lo grafico dibujado con CSS. */

:root {
  --fondo: #f3f5f8;
  --fondo-2: #e9edf3;
  --tarjeta: #ffffff;
  --texto: #121826;
  --suave: #5b6476;
  --tenue: #8a93a5;
  --borde: #dfe4ec;
  --campo: #f8fafc;
  --acento: #0f766e;
  --acento-hover: #0b5f58;
  --acento-suave: rgba(15, 118, 110, .12);
  --sobre-acento: #ffffff;
  --bien: #146c43;
  --bien-fondo: #e6f4ec;
  --mal: #b42318;
  --mal-fondo: #fdecea;
  --regular: #93370d;
  --regular-fondo: #fef3e2;
  --sombra: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .14);
  --radio: 14px;
  --marca-fondo: linear-gradient(150deg, #0b3b38 0%, #0f5e57 45%, #12857a 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0d1117;
    --fondo-2: #121821;
    --tarjeta: #161c26;
    --texto: #e8ebf1;
    --suave: #a3acbd;
    --tenue: #747e91;
    --borde: #262e3b;
    --campo: #10151d;
    --acento: #2dd4bf;
    --acento-hover: #5eead4;
    --acento-suave: rgba(45, 212, 191, .14);
    --sobre-acento: #04201d;
    --bien: #6ee7a8;
    --bien-fondo: rgba(34, 197, 94, .12);
    --mal: #ff8f84;
    --mal-fondo: rgba(240, 68, 56, .14);
    --regular: #fdba74;
    --regular-fondo: rgba(249, 115, 22, .13);
    --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    --marca-fondo: linear-gradient(150deg, #06201e 0%, #0a3a36 50%, #0f5e57 100%);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--texto);
  background: var(--fondo);
  font: 15.5px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.6rem; margin: 0 0 6px; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 1.05rem; margin: 0; letter-spacing: -.01em; }
a { color: var(--acento); text-decoration: none; }
a:hover { text-decoration: underline; }
.nota { color: var(--suave); font-size: .9rem; margin: 0 0 22px; }

/* -------------------------------- Marca -------------------------------- */
.marca { display: flex; align-items: center; gap: 12px; }

/* Logo: una llave dibujada con CSS sobre un cuadrado con degradado */
.logo {
  position: relative;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2dd4bf, #0f766e 60%, #115e59);
  box-shadow: 0 6px 16px -6px rgba(15, 118, 110, .7), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.logo::before {                       /* ojo de la llave */
  content: "";
  position: absolute;
  left: 8px;
  top: 13px;
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
}
.logo::after {                        /* pala con dientes */
  content: "";
  position: absolute;
  left: 22px;
  top: 19.5px;
  width: 13px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 8px 3px 0 -0.5px #fff, 4px 3px 0 -0.5px #fff;
}

.titulo { margin: 0; font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; }
.subtitulo { margin: 0; font-size: .8rem; color: var(--suave); }

/* ============================ Pantallas de acceso ============================ */
.acceso {
  display: grid;
  grid-template-columns: minmax(380px, 46%) 1fr;
  min-height: 100vh;
}

.acceso-marca {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 48px clamp(32px, 5vw, 72px);
  color: #e9fbf7;
  background: var(--marca-fondo);
}
/* Halos de luz decorativos */
.acceso-marca::before,
.acceso-marca::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.acceso-marca::before {
  width: 520px;
  height: 520px;
  right: -180px;
  top: -160px;
  background: radial-gradient(circle, rgba(45, 212, 191, .35), transparent 65%);
}
.acceso-marca::after {
  width: 420px;
  height: 420px;
  left: -160px;
  bottom: -180px;
  background: radial-gradient(circle, rgba(255, 255, 255, .10), transparent 65%);
}
.acceso-marca > * { position: relative; z-index: 1; }
.acceso-marca .subtitulo { color: rgba(233, 251, 247, .7); }
.acceso-marca .logo { background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }

.acceso-lema { max-width: 460px; }
.acceso-lema h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.03em;
  margin: 0 0 14px;
}
.acceso-lema p { margin: 0 0 28px; color: rgba(233, 251, 247, .8); font-size: 1.02rem; }

.garantias { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.garantias li {
  position: relative;
  padding-left: 32px;
  color: rgba(233, 251, 247, .92);
  font-size: .95rem;
}
.garantias li::before {               /* circulo con check */
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(45, 212, 191, .22);
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, .5);
}
.garantias li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 5px;
  width: 5px;
  height: 9px;
  border: solid #5eead4;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.acceso-pie { margin: 0; font-size: .82rem; color: rgba(233, 251, 247, .55); }

.acceso-formulario {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background:
    radial-gradient(800px 400px at 70% 0%, var(--acento-suave), transparent 70%),
    var(--fondo);
}
.acceso-caja { width: 100%; max-width: 400px; }

.pasos {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  font-size: .85rem;
  color: var(--tenue);
}
.pasos li { display: flex; align-items: center; gap: 8px; }
.pasos li + li::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--borde);
  margin-right: 2px;
}
.pasos span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--borde);
  font-size: .75rem;
  font-weight: 700;
}
.pasos .actual { color: var(--texto); font-weight: 600; }
.pasos .actual span { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.pasos .hecho span { background: var(--acento-suave); border-color: transparent; color: var(--acento); }

.volver { margin: 20px 0 0; text-align: center; font-size: .9rem; }

/* ================================== Panel ================================== */
.barra {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--tarjeta) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--borde);
}
.barra-dentro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 56px);
}
.barra .logo { width: 36px; height: 36px; border-radius: 10px; }
.barra .logo::before { left: 6px; top: 10px; width: 14px; height: 14px; }
.barra .logo::after { left: 18px; top: 15.5px; width: 12px; }

.salir { display: flex; align-items: center; gap: 12px; }
.quien {
  font-size: .85rem;
  color: var(--suave);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel {
  padding: 40px clamp(16px, 4vw, 56px) 64px;
  min-height: calc(100vh - 62px);
  background: radial-gradient(1000px 360px at 50% -120px, var(--acento-suave), transparent 70%);
}
.panel-intro { max-width: 760px; margin-bottom: 28px; }
.panel-intro p { margin: 0; color: var(--suave); }
.panel-intro b { color: var(--texto); }

.rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  align-items: start;
}

.tarjeta {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 22px;
}
.proveedor { display: flex; flex-direction: column; height: 100%; }
.proveedor .cambio { margin-top: auto; }

.proveedor-cabecera {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ultimo-cambio { margin: 12px 0 0; text-align: center; font-size: .8rem; color: var(--tenue); }

/* --------------------------- Estados y avisos -------------------------- */
.pastilla {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
}
.pastilla::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pastilla.bien { background: var(--bien-fondo); color: var(--bien); }
.pastilla.mal { background: var(--mal-fondo); color: var(--mal); }
.pastilla.regular { background: var(--regular-fondo); color: var(--regular); }
.pastilla.neutro { background: var(--fondo-2); color: var(--suave); }
.pastilla.mal::before { animation: latido 1.6s ease-in-out infinite; }

@keyframes latido {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.estado {
  margin: 0 0 20px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .86rem;
}
.estado.bien { color: var(--suave); background: var(--campo); }
.estado.mal { background: var(--mal-fondo); color: var(--mal); }
.estado.regular { background: var(--regular-fondo); color: var(--regular); }
.estado.neutro { background: var(--campo); color: var(--suave); }

.aviso {
  margin: 0 0 22px;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: .93rem;
  font-weight: 500;
}
.panel .aviso { max-width: 760px; }
.aviso.ok { background: var(--bien-fondo); color: var(--bien); border-color: color-mix(in srgb, var(--bien) 25%, transparent); }
.aviso.error { background: var(--mal-fondo); color: var(--mal); border-color: color-mix(in srgb, var(--mal) 25%, transparent); }

/* ----------------------------- Formularios ----------------------------- */
label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--suave);
  margin-bottom: 14px;
}

input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  font: inherit;
  font-weight: 400;
  font-size: 1rem;
  color: var(--texto);
  background: var(--campo);
  border: 1px solid var(--borde);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input::placeholder { color: var(--tenue); }
input:hover { border-color: color-mix(in srgb, var(--acento) 35%, var(--borde)); }
input:focus {
  outline: none;
  background: var(--tarjeta);
  border-color: var(--acento);
  box-shadow: 0 0 0 4px var(--acento-suave);
}

input.codigo {
  font-family: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-size: 1.6rem;
  letter-spacing: .45em;
  text-align: center;
  padding: 14px 13px 14px calc(13px + .45em);
}

button {
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  padding: 11px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--acento);
  color: var(--sobre-acento);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 6px 14px -8px var(--acento);
  transition: background-color .15s, transform .05s;
}
button:hover { background: var(--acento-hover); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--acento-suave); }
button.ancho { width: 100%; padding: 13px 18px; margin-top: 6px; }

button.secundario {
  background: transparent;
  color: var(--suave);
  border: 1px solid var(--borde);
  box-shadow: none;
  padding: 6px 14px;
  font-weight: 500;
  font-size: .85rem;
}
button.secundario:hover { background: var(--fondo); color: var(--texto); }

/* -------------------------------- Movil -------------------------------- */
@media (max-width: 860px) {
  .acceso { grid-template-columns: 1fr; }
  .acceso-marca { padding: 24px 20px; gap: 0; }
  .acceso-lema, .acceso-pie { display: none; }
  .acceso-formulario { align-items: flex-start; padding: 32px 20px 48px; }
}

@media (max-width: 560px) {
  .quien { display: none; }
  .panel { padding-top: 24px; }
  .rejilla { grid-template-columns: 1fr; }
  .tarjeta { padding: 18px; }
  h1 { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
