/* Paleta CloudFuel V2 (LEEME-logotipo). */
:root {
  --cf-cobalt: #075BEB;
  --cf-cyan: #00CFE8;
  --cf-amber: #FFC400;
  --cf-navy: #061C44;
  --cf-panel: rgba(6, 28, 68, 0.55);
  --cf-border: rgba(0, 207, 232, 0.28);
}

/* Wallpaper V4 */
body.cf-wallpaper {
  background-color: var(--cf-navy);
  background-image: image-set(
    url('/img/cloudfuel-wallpaper-v4-1920x1280.webp') type('image/webp'),
    url('/img/cloudfuel-wallpaper-v4-1920x1280.png') type('image/png')
  );
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  color: #f3f4f6;
}

@media (max-width: 768px) {
  body.cf-wallpaper {
    background-attachment: scroll;
  }
}

/* Botón primario: cobalto → cian, como el CTA del mockup de login. */
.cf-btn-primary {
  background: linear-gradient(135deg, var(--cf-cobalt) 0%, #0a8fd4 55%, var(--cf-cyan) 100%) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 0 0 1px rgba(0, 207, 232, 0.25), 0 8px 24px rgba(7, 91, 235, 0.35);
}

.cf-btn-primary:hover,
.cf-btn-primary:focus {
  filter: brightness(1.08);
  outline: none;
  box-shadow: 0 0 0 2px var(--cf-navy), 0 0 0 4px var(--cf-cyan);
}

/* Inputs alineados a la marca */
.cf-input {
  background-color: rgba(6, 28, 68, 0.72) !important;
  border-color: rgba(0, 207, 232, 0.35) !important;
  color: #f9fafb !important;
}

.cf-input:focus {
  border-color: var(--cf-cyan) !important;
  box-shadow: 0 0 0 1px var(--cf-cyan) !important;
  outline: none !important;
}

/* Checkbox "Mantener sesión" */
.cf-check {
  color: var(--cf-cyan) !important;
  background-color: rgba(6, 28, 68, 0.8) !important;
  border-color: rgba(0, 207, 232, 0.45) !important;
}

.cf-check:focus {
  --tw-ring-color: var(--cf-cyan) !important;
  box-shadow: 0 0 0 2px var(--cf-navy), 0 0 0 4px var(--cf-cyan) !important;
}

/* Enlaces de acento */
.cf-link {
  color: var(--cf-cyan) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cf-link:hover {
  color: #7dedf8 !important;
}

/* Paneles / cards */
.cf-panel {
  background: var(--cf-panel) !important;
  border-color: var(--cf-border) !important;
  backdrop-filter: blur(12px);
}

/* Dropdown usuario */
.cf-user-btn {
  background: rgba(6, 28, 68, 0.75) !important;
  border: 1px solid var(--cf-border) !important;
  color: #f3f4f6 !important;
}

.cf-user-btn:hover {
  border-color: var(--cf-cyan) !important;
}

/* Fecha/hora del header */
.cf-datetime {
  color: #e8f7ff;
  text-shadow: 0 0 18px rgba(0, 207, 232, 0.25);
}

/* Indicadores: ámbar de marca para "parcial / <10%" */
.cf-dot-ok { background-color: #34d399; }
.cf-dot-warn { background-color: var(--cf-amber); }
.cf-dot-err { background-color: #ef4444; }
.cf-box-warn { border: 2px solid var(--cf-amber); }
.cf-box-err { border: 2px solid #ef4444; }

/* Menú móvil */
.cf-mobile-menu {
  background: rgba(6, 28, 68, 0.92) !important;
  border: 1px solid var(--cf-border);
}

/* --- Alineación del grid de estaciones --- */

/* Nombre a la izquierda y clave arriba a la derecha, en un solo renglón: los
   nombres largos ya no estiran la tarjeta ni desalinean los tanques. */
.cf-station-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.9rem; /* un renglón de text-xl leading-tight */
  margin-bottom: 0.25rem;
}

.cf-station-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  /* Habilita cqw en el hijo para medir cuánto se desborda el nombre. */
  container-type: inline-size;
}

.cf-station-name__text {
  display: inline-block;
  white-space: nowrap;
  animation: cf-station-name-scroll 9s ease-in-out infinite alternate;
}

/*
  100% = ancho del texto, 100cqw = ancho visible. La resta es el sobrante, y
  min(0px, …) lo anula cuando el nombre cabe: los nombres cortos quedan quietos
  sin necesidad de medir nada en JS.

  ponytail: depende de unidades de container query (Chrome 105+, Safari 16+). En
  navegadores viejos el calc es inválido, no hay animación y el nombre queda
  recortado, que es exactamente el comportamiento previo.
*/
@keyframes cf-station-name-scroll {
  0%,
  18% {
    transform: translateX(0);
  }
  82%,
  100% {
    transform: translateX(min(0px, calc(100cqw - 100%)));
  }
}

.cf-station-key {
  margin: 0;
  flex-shrink: 0;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .cf-station-name__text {
    animation: none;
  }
}

.cf-station-brand {
  height: 3.75rem; /* logo de marca a la misma altura en todas las cards */
}

.cf-tank-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  white-space: nowrap;
}
