/* ==========================================
   Tokens de diseño
   ========================================== */
:root {
  --fondo: #f6f5f1;
  --superficie: #ffffff;
  --superficie-2: #f1efe9;
  --borde: #e3e0d8;
  --texto: #1d2230;
  --texto-suave: #5d6372;
  --texto-tenue: #8a8f9c;
  --primario: #1f3a5f;
  --primario-hover: #172c49;
  --primario-suave: #e7edf5;
  --acento: #a8803c;
  --peligro: #a23b3b;
  --peligro-suave: #f8e9e9;

  --fuente: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fuente-titulos: "Source Serif 4", Georgia, "Times New Roman", serif;
  --fuente-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --radio: 10px;
  --radio-sm: 6px;
  --sombra: 0 1px 2px rgba(20, 24, 35, .04), 0 4px 16px rgba(20, 24, 35, .06);
  --sombra-foco: 0 0 0 3px rgba(31, 58, 95, .18);
  --ancho: 820px;
  --transicion: 150ms ease;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #12151c;
    --superficie: #1a1e27;
    --superficie-2: #222733;
    --borde: #2e3442;
    --texto: #e6e8ee;
    --texto-suave: #a7adbb;
    --texto-tenue: #767d8d;
    --primario: #7fa6d9;
    --primario-hover: #9bbbe4;
    --primario-suave: #1f2a3b;
    --acento: #d2ac68;
    --peligro: #e07a7a;
    --peligro-suave: #3a2224;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --sombra-foco: 0 0 0 3px rgba(127, 166, 217, .3);
    color-scheme: dark;
  }
}

/* ==========================================
   Base
   ========================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--fuente-titulos);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.2rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

a { color: var(--primario); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primario-hover); }

:focus-visible { outline: none; box-shadow: var(--sombra-foco); border-radius: var(--radio-sm); }

/* ==========================================
   Layout
   ========================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(1.4) blur(10px);
}
.topbar__inner {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: .8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.marca {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--texto);
  text-decoration: none;
  font-family: var(--fuente-titulos);
  font-size: 1.1rem;
  font-weight: 600;
}
.marca:hover { color: var(--texto); }
.marca__icono {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--primario);
  color: var(--superficie);
  font-size: 1.1rem;
}
.marca__texto em { font-style: normal; color: var(--acento); }

.nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.nav__link {
  padding: .4rem .75rem;
  border-radius: var(--radio-sm);
  color: var(--texto-suave);
  font-size: .92rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transicion), color var(--transicion);
}
.nav__link:hover { background: var(--superficie-2); color: var(--texto); }
.nav__link.is-activo { background: var(--primario-suave); color: var(--primario); }
.nav__link--salir:hover { background: var(--peligro-suave); color: var(--peligro); }

.contenedor {
  flex: 1;
  width: 100%;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.pie {
  /* border-top: 1px solid var(--borde); */
  color: var(--texto-tenue);
  font-size: .85rem;
  text-align: center;
  padding: 1.25rem 1rem;
}
.pie p { margin: 0; }

/* ==========================================
   Componentes
   ========================================== */
.encabezado { margin-bottom: 1.75rem; }
.encabezado h1 { margin-bottom: .25rem; }
.encabezado p { color: var(--texto-suave); margin: 0; }

.tarjeta {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1.5rem;
}

.campo { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.1rem; }
.campo label, .etiqueta {
  font-size: .85rem;
  font-weight: 500;
  color: var(--texto-suave);
}

input, select, textarea {
  width: 100%;
  padding: .65rem .8rem;
  font: inherit;
  font-size: 1rem;
  color: var(--texto);
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio-sm);
  transition: border-color var(--transicion), box-shadow var(--transicion);
}
input:hover, select:hover, textarea:hover { border-color: var(--texto-tenue); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primario);
  box-shadow: var(--sombra-foco);
}
textarea { resize: vertical; min-height: 6rem; line-height: 1.5; }
select {
  appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8f9c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .8rem center;
  cursor: pointer;
}

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem 1.1rem;
  font: inherit;
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--radio-sm);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transicion), border-color var(--transicion), color var(--transicion), transform var(--transicion);
}
.boton:active { transform: translateY(1px); }
.boton:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.boton--primario { background: var(--primario); color: var(--superficie); }
.boton--primario:hover:not(:disabled) { background: var(--primario-hover); color: var(--superficie); }

.boton--secundario { background: var(--superficie); color: var(--texto); border-color: var(--borde); }
.boton--secundario:hover:not(:disabled) { background: var(--superficie-2); border-color: var(--texto-tenue); color: var(--texto); }

.boton--bloque { width: 100%; }

.aviso {
  padding: .75rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radio-sm);
  background: var(--primario-suave);
  color: var(--primario);
  font-size: .92rem;
}
.aviso--error { background: var(--peligro-suave); color: var(--peligro); }

.texto-centrado {
  text-align: center;
}

@media (max-width: 560px) {
  .contenedor { padding-top: 1.5rem; }
  .tarjeta { padding: 1.1rem; }
  .marca__texto em { display: none; }
}
