/*
 * Estilos de la página de comprobación. Se reproducen las reglas de front-css.css (web oficial) y
 * App.css (rrc-entraid-webapp) que usan MessagePage y Loader, en lugar de cargar la hoja oficial
 * completa (más de 11.000 líneas) en una página que se muestra durante menos de un segundo.
 * Al actualizar los estilos oficiales en rrc-entraid-webapp, se revisan estos valores.
 */

:root {
  --Racing-Dark: #0e3f27;
  --Racing-Gold-Dark: #9c7942;
  --Racing-Gold: #b69d76;
  --Racing-Gold-Light: #e5d8c3;
  --Racing-White: #fff;

  /* Reserva si el dominio no está permitido en el kit de Adobe Fonts */
  --font-text: "avenir-next-lt-pro", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-condensed: "avenir-next-lt-pro-condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;
}

html {
  font-size: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 1.125rem;
  color: var(--Racing-Dark);
  background-color: var(--Racing-Dark);
}

img {
  max-width: 100%;
}

/* Sin esto, el display de .button-m--gold anula el atributo hidden */
[hidden] {
  display: none !important;
}

/* ---------- Estructura (App.css: .App / .main-container) ---------- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--Racing-White);
}

.main-container {
  flex: 1 0 auto;
}

/* ---------- Cabecera sin sesión: solo el escudo centrado ---------- */
.main-header__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 79px;
  box-sizing: border-box;
  padding: 10px 16px;
  background: var(--Racing-Dark);
  border-bottom: 1px solid rgba(65, 182, 73, 0.2);
}

.main-header__logo {
  width: 66px;
}

.main-header__logo img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Bloque oficial .error-404 ---------- */
.grid-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0 16px;
}

/* Sin cabecera fija, no hace falta el padding superior oficial (105px/145px) */
.error-404 {
  min-height: 60vh;
  display: flex;
  align-items: center;
  padding: 48px 0 80px;

  /* Oro accesible sobre blanco (WCAG AA), igual que App.css y las páginas de Entra */
  --Racing-Gold: #856636;
  --Racing-Gold-Dark: #6b5129;
}

.error-404__inner {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.error-404__crest {
  display: block;
  width: 72px;
  height: auto;
  margin: 0 auto 24px;
}

.error-404__eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-condensed);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  line-height: 100%;
  color: var(--Racing-Gold);
}

.error-404__title {
  margin: 0 0 16px;
  color: var(--Racing-Dark);
}

.error-404__text {
  margin: 0 0 32px;
  color: var(--Racing-Dark);
}

.title-l {
  font-family: var(--font-text);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.75rem;
  line-height: 85%;
  letter-spacing: -0.56px;
}

.paragraph-m {
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 1rem;
  line-height: 150%;
}

.button-m--gold {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  box-sizing: border-box;
  padding: 14px 24px;
  border: 0;
  border-radius: 4px;
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 1rem;
  line-height: 100%;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--Racing-White);
  background: var(--Racing-Gold);
  transition: border-radius 0.2s ease, background 0.2s ease;
}

.button-m--gold:hover {
  border-radius: 25px;
  background: var(--Racing-Gold-Dark);
}

.button-m--gold:focus-visible {
  outline: 2px solid var(--Racing-Gold);
  outline-offset: 4px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .grid-container {
    padding: 0 24px;
  }
}

@media (min-width: 1024px) {
  .grid-container {
    padding: 0 32px;
  }

  .error-404 {
    padding: 64px 0 100px;
  }

  .title-l {
    font-size: 2.5rem;
    letter-spacing: -0.8px;
  }
}

/* ---------- Loader (App.css) ---------- */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
  font-family: var(--font-text);
  font-size: 1rem;
  color: var(--Racing-Gold);
}

.loader__spinner {
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 2px solid var(--Racing-Gold-Light);
  border-top-color: var(--Racing-Gold);
  border-radius: 50%;
  animation: loader-spin 0.8s linear infinite;
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader__spinner {
    animation-duration: 2.4s;
  }
}

/* ---------- Estados (data-state lo cambia check.js) ---------- */
body[data-state="working"] .error-404__text {
  display: none;
}

body[data-state="error"] .loader {
  display: none;
}

/* ---------- Pie: solo la fila legal del pie oficial ---------- */
.main-footer {
  padding: 24px 16px;
  background: url("https://www.realracingclub.es/images/bg-footer.webp") no-repeat center / cover var(--Racing-Dark);
}

.main-footer__legals {
  font-family: var(--font-text);
  font-size: 0.6875rem;
  line-height: 150%;
  color: var(--Racing-Gold);
  text-align: center;
}

.main-footer__legals__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin: 8px 0;
}

.main-footer__legals a {
  color: inherit;
  text-decoration: none;
}

.main-footer__legals a:hover,
.main-footer__legals a:focus-visible {
  text-decoration: underline;
}
