/* =============================================================
   VARIABLES GENERALES
   ============================================================= */

:root {
  --azul-oscuro: #10233f;
  --azul: #1677db;
  --gris: #66758a;
  --borde: #dbe4ee;
  --amarillo: #ffbd33;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f4f7fa;
  color: #17263c;
  font-family: Arial, sans-serif;
}

/* =============================================================
   ENCABEZADO
   ============================================================= */

header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px max(20px, calc((100vw - 1120px) / 2));
  background: var(--azul-oscuro);
  color: #ffffff;
  border-bottom: 5px solid var(--amarillo);
}

header small,
main section > b,
.intro b,
.titulo-resultado b,
.conexion-titulo b {
  color: #6ba8e7;
  font-size: 11px;
  letter-spacing: 0.14em;
}

.logo {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: var(--amarillo);
  border-radius: 15px;
  font-size: 26px;
}

.logo-soa {
  width: 92px;
  height: 92px;
  margin-left: auto;
  padding: 5px;
  object-fit: contain;
  background: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

h1 {
  margin: 4px 0 0;
  font-size: clamp(22px, 3vw, 32px);
}

h1 em {
  color: var(--amarillo);
  font-style: normal;
}

@media (max-width: 600px) {
  header {
    gap: 10px;
  }

  .logo {
    display: none;
  }

  .logo-soa {
    width: 70px;
    height: 70px;
    padding: 4px;
  }
}

/* =============================================================
   CONTENIDO PRINCIPAL
   ============================================================= */

main {
  width: min(1120px, calc(100% - 32px));
  margin: 34px auto;
}

.intro,
.titulo-resultado {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.intro h2,
.titulo-resultado h2 {
  margin: 5px 0 10px;
  color: var(--azul-oscuro);
  font-size: clamp(26px, 4vw, 38px);
}

.intro p {
  max-width: 700px;
  color: var(--gris);
  line-height: 1.6;
}

.intro aside,
.titulo-resultado aside {
  min-width: 235px;
  padding: 15px 18px;
  background: #ffffff;
  border: 1px solid var(--borde);
  border-radius: 13px;
}

.intro aside span,
.titulo-resultado aside span,
.intro aside small,
.titulo-resultado aside small {
  display: block;
  color: var(--gris);
  font-size: 12px;
}

.intro aside strong,
.titulo-resultado aside strong {
  display: block;
  margin: 4px 0;
  color: var(--azul);
  font-size: 26px;
}

/* =============================================================
   MENSAJE DE ADVERTENCIA
   ============================================================= */

.aviso {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  padding: 13px 16px;
  background: #fff8e7;
  border: 1px solid #f4d386;
  border-left: 5px solid var(--amarillo);
  border-radius: 10px;
}

.aviso > strong {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  background: var(--amarillo);
  border-radius: 50%;
}

.aviso p {
  margin: 2px 0;
  font-size: 14px;
  line-height: 1.5;
}

/* =============================================================
   FORMULARIO DE CONSUMOS
   ============================================================= */

form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.tarjeta {
  position: relative;
  padding: 22px 22px 20px 88px;
  background: #ffffff;
  border: 1px solid var(--borde);
  border-radius: 15px;
  box-shadow: 0 8px 24px #16345d0d;
}

.tarjeta > i {
  position: absolute;
  top: 22px;
  left: 21px;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-style: normal;
  font-weight: bold;
}

.amarillo > i {
  background: #fff1c8;
  color: #946100;
}

.azul > i {
  background: #dff0ff;
  color: #1267bd;
}

.tarjeta > b,
.tarjeta > span {
  display: block;
}

.tarjeta > span {
  margin: 5px 0 12px;
  color: var(--gris);
  font-size: 13px;
}

.tarjeta div,
.fuente div {
  display: flex;
  height: 48px;
  border: 1px solid #bdcad8;
  border-radius: 8px;
  overflow: hidden;
}

.tarjeta input,
.fuente input {
  width: 100%;
  padding: 0 13px;
  border: 0;
  outline: 0;
  font-weight: bold;
}

.tarjeta u,
.fuente u {
  display: grid;
  place-items: center;
  padding: 0 13px;
  background: #eef2f6;
  color: var(--gris);
  text-decoration: none;
}

.error,
.mal {
  display: block;
  margin-top: 7px;
  color: #b42318;
}

.bien {
  display: block;
  margin-top: 7px;
  color: #198754;
}

/* Botones del formulario. */
.acciones {
  display: flex;
  grid-column: 1 / -1;
  justify-content: center;
  gap: 10px;
}

.acciones button {
  padding: 13px 22px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

.acciones button:first-child {
  background: var(--azul);
  color: #ffffff;
  border-color: var(--azul);
}

/* =============================================================
   RESULTADOS Y COMPROBACIÓN DE FUENTES
   ============================================================= */

.estado {
  margin: 18px 0;
  padding: 16px 19px;
  border-radius: 11px;
}

.estado strong,
.estado span {
  display: block;
}

.estado span {
  margin-top: 5px;
  font-size: 13px;
}

.ok {
  background: #edf9f2;
  color: #145c34;
  border: 1px solid #a9dfc1;
}

.atencion {
  background: #fff7e5;
  color: #75500b;
  border: 1px solid #f2d181;
}

.fuentes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fuente {
  padding: 15px;
  background: #ffffff;
  border: 1px solid var(--borde);
  border-radius: 11px;
}

.fuente > b,
.fuente > span {
  display: block;
}

.fuente > b {
  color: #ed7b2f;
  font-size: 11px;
}

.fuente > span {
  margin: 5px 0 10px;
}

/* =============================================================
   GRÁFICO DE CONEXIÓN
   ============================================================= */

.conexion {
  margin-top: 18px;
  padding: 21px;
  background: #ffffff;
  border: 1px solid var(--borde);
  border-radius: 15px;
}

.conexion-titulo {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--borde);
}

.conexion h3 {
  margin: 5px 0 0;
}

.conexion figure {
  margin: 20px 0 0;
}

.conexion img {
  display: block;
  width: 100%;
  background: #303030;
  border-radius: 9px;
}

.conexion figcaption {
  margin-top: 12px;
  padding: 13px;
  background: #fff8e7;
  border-left: 4px solid var(--amarillo);
  font-size: 13px;
  line-height: 1.5;
}

/* =============================================================
   PIE DE PÁGINA Y ELEMENTOS OCULTOS
   ============================================================= */

footer {
  margin-top: 22px;
  color: var(--gris);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

[hidden] {
  display: none !important;
}

/* =============================================================
   ADAPTACIÓN PARA CELULARES
   ============================================================= */

@media (max-width: 720px) {
  .intro,
  .titulo-resultado {
    flex-direction: column;
    align-items: stretch;
  }

  .intro aside,
  .titulo-resultado aside {
    min-width: 0;
  }

  form,
  .fuentes {
    grid-template-columns: 1fr;
  }

  .tarjeta {
    padding-left: 82px;
  }

  .acciones {
    flex-direction: column;
  }

  .acciones button {
    width: 100%;
  }
}
