:root {
  --fondo: #0e0e0e;
  --superficie: #181818;
  --texto: #f4f4f4;
  --texto-suave: #b0b0b0;
  --rojo: #d71920;
  --rojo-oscuro: #b01217;
  --borde: #3a3a3a;
  --error-fondo: #3a1214;
  --error-texto: #ffb3b6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--texto);
  background: var(--fondo);
  line-height: 1.5;
}

/* ---------- Login ---------- */
.pagina-login {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  /* La foto tiene un ancho que depende del alto de la pantalla,
     para que el logo se vea completo y no recortado. */
  grid-template-columns: clamp(320px, calc(100vh * 0.86), 50vw) 1fr;
}

.portada {
  position: relative;
  overflow: hidden;
  background: #000;
  border-right: 4px solid var(--rojo);
}

.portada img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
}

.zona-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.tarjeta-login {
  width: 100%;
  max-width: 24rem;
}

.tarjeta-login h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.subtitulo {
  margin: 0 0 1.5rem;
  color: var(--texto-suave);
}

label {
  display: block;
  margin-top: 1.1rem;
  font-weight: 700;
}

input {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.75rem 0.85rem;
  font-size: 1rem;
  color: var(--texto);
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: 6px;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

button {
  width: 100%;
  margin-top: 1.75rem;
  padding: 0.85rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--rojo);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

button:hover { background: var(--rojo-oscuro); }

.mensaje-error {
  margin: 0 0 0.5rem;
  padding: 0.75rem 0.85rem;
  color: var(--error-texto);
  background: var(--error-fondo);
  border-left: 4px solid var(--rojo);
  border-radius: 4px;
}

/* Celular y pantallas angostas: foto arriba, formulario abajo */
@media (max-width: 800px) {
  .pagina-login {
    grid-template-columns: 1fr;
    grid-template-rows: 30vh minmax(0, 1fr);
    grid-template-rows: 30dvh minmax(0, 1fr);
  }
  .portada {
    border-right: 0;
    border-bottom: 4px solid var(--rojo);
  }
  .zona-form { align-items: flex-start; padding-top: 1.25rem; }
  .tarjeta-login h1 { font-size: 1.9rem; }
  .subtitulo { margin-bottom: 1rem; }
  button { margin-top: 1.25rem; }
}

/* ---------- Panel ---------- */
.barra {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--superficie);
  border-bottom: 3px solid var(--rojo);
}

.barra strong { font-weight: 900; font-size: 1.15rem; }
.barra a { color: var(--texto); font-weight: 700; }

.contenido {
  max-width: 48rem;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.contenido h1 { font-weight: 900; }
