﻿@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('Fonts/PlusJakartaSans-VariableFont_wght.ttf') format('truetype');
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('Fonts/PlusJakartaSans-Italic-VariableFont_wght.ttf') format('truetype');
  font-weight: 200 800; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Radio Canada Big';
  src: url('Fonts/RadioCanadaBig-VariableFont_wght.ttf') format('truetype');
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Radio Canada Big';
  src: url('Fonts/RadioCanadaBig-Italic-VariableFont_wght.ttf') format('truetype');
  font-weight: 400 700; font-style: normal; font-display: swap;
}

/* ===== 2. TOKENS (oscuro por defecto) ===== */
:root {
  color-scheme: dark;

  --brand-red: #B91C1C;
  --brand-gold: #EAB308;
  --success: #10B981;
  --warning: #D97706;
  --error: #DC2626;

--primary: #EF4444;
--on-primary: #FFFFFF;
  --primary-container: #7F1D1D;
  --on-primary-container: #FEE2E2;
--secondary: #EAB308;
--on-secondary: #422006;
  --secondary-container: #713F12;
  --on-secondary-container: #FEF08A;

  --surface: #0F172A;
  --on-surface: #F8FAFC;
  --surface-container: #1E293B;
  --surface-container-high: #334155;
  --surface-container-highest: #475569;
  --outline: #94A3B8;
  --outline-variant: #334155;

  --card: #1E293B;
  --sec-btn-bg: #334155;
  --sec-btn-hover: #475569;
  --logo-bg: #FEF2F2;
  --logo-border: #FEE2E2;

  --error-text: #FCA5A5;
  --error-bg: rgba(239, 68, 68, 0.12);
  --error-border: rgba(239, 68, 68, 0.35);

  --shadow-card: 0 20px 25px -5px rgba(0, 0, 0, 0.45), 0 8px 10px -6px rgba(0, 0, 0, 0.35);
  --shadow-btn: 0 4px 6px -1px rgba(0, 0, 0, 0.35);

  --font-headline: 'Radio Canada Big', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --t-state: 120ms ease-out;
}

:root[data-theme="light"] {
  color-scheme: light;

  --primary: #B91C1C;
  --on-primary: #FFFFFF;
  --primary-container: #FEE2E2;
  --on-primary-container: #7F1D1D;
  --secondary: #D97706;
  --on-secondary: #2A2A2A;
  --secondary-container: #FEF3C7;
  --on-secondary-container: #78350F;

  --surface: #F8FAFC;
  --on-surface: #0F172A;
  --surface-container: #F1F5F9;
  --surface-container-high: #E2E8F0;
  --surface-container-highest: #CBD5E1;
  --outline: #64748B;
  --outline-variant: #CBD5E1;

  --card: #FFFFFF;
  --sec-btn-bg: #F1F5F9;
  --sec-btn-hover: #E2E8F0;

  --error-text: #991B1B;
  --error-bg: #FEF2F2;
  --error-border: #FECACA;

  --shadow-card: 0 20px 25px -5px rgba(15, 23, 42, 0.10), 0 8px 10px -6px rgba(15, 23, 42, 0.10);
  --shadow-btn: 0 4px 6px -1px rgba(15, 23, 42, 0.18);
}

/* ===== 3. BASE ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--on-surface);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
button, input { font-family: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ===== 4. LOGIN ===== */
.pagina {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.acceso {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tarjeta {
  width: 100%;
  max-width: 448px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--outline-variant);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.cabecera {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.logo {
  width: 170px;
  height: auto;
  margin: 0 auto 4px;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.logo img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.45));
}

.lema {
  margin: 0 0 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #f5b82e;
}

.titulo {
  margin: 0;
  font-family: var(--font-headline);
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.sub {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0.2px;
  color: var(--outline);
  text-wrap: balance;
}

.form { display: flex; flex-direction: column; gap: 16px; }

.campo > label,
.campo-fila label {
  display: block;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.campo > label { margin-bottom: 6px; }
.campo-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.enlace {
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}
.enlace:hover { text-decoration: underline; }

.caja { position: relative; }
.caja .ico {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--outline);
  pointer-events: none;
}
.caja input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 20px;
  color: var(--on-surface);
  font-size: 14px;
  outline: 0;
  transition: border-color var(--t-state), box-shadow var(--t-state);
}
.caja--clave input { padding-right: 46px; }
.caja input::placeholder { color: var(--outline); }
.caja input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.18);
}
.caja input:-webkit-autofill {
  -webkit-text-fill-color: var(--on-surface);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  caret-color: var(--on-surface);
}
.caja input.invalida {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-bg);
}
@media (pointer: coarse) { .caja input { font-size: 16px; } }

.ver {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--outline);
  cursor: pointer;
}
.ver:hover { color: var(--on-surface); }
.ver svg { width: 18px; height: 18px; }

/* Aviso de error: se oculta solo cuando está vacío */
.error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--error-text);
}
.error:empty { display: none; }
.error::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

.btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 28px;
  font-weight: 700;
  cursor: pointer;
  transition: filter var(--t-state), background var(--t-state), transform var(--t-state);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: default; }

.btn-primario {
  padding: 14px 16px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  line-height: 20px;
  box-shadow: var(--shadow-btn);
}
.btn-primario:hover:not(:disabled) { filter: brightness(1.1); }

.btn-secundario {
  padding: 12px 16px;
  background: var(--sec-btn-bg);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.5px;
}
.btn-secundario svg { color: var(--primary); }
.btn-secundario:hover:not(:disabled) { background: var(--sec-btn-hover); }

.ayuda {
  padding-top: 16px;
  border-top: 1px solid var(--outline-variant);
  text-align: center;
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.5px;
  color: var(--outline);
}

.pie-pagina {
  padding: 16px;
  background: var(--card);
  border-top: 1px solid var(--outline-variant);
  text-align: center;
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.5px;
  color: var(--outline);
}

@media (min-width: 640px) {
  .acceso { padding: 24px; }
  .tarjeta { padding: 32px; }
  .titulo { font-size: 32px; line-height: 38px; letter-spacing: -0.25px; }
}
@media (min-width: 1024px) {
  .acceso { padding: 40px; }
}

/* Pantallas bajas: compacta para que no haga falta desplazarse */
@media (max-height: 700px) {
  .acceso { padding: 8px 16px; }
  .tarjeta { padding: 16px; gap: 14px; }
  .form { gap: 12px; }
    .logo { width: 120px; height: auto; }
  .titulo { font-size: 22px; line-height: 28px; }
  .ayuda { padding-top: 10px; }
  .pie-pagina { padding: 10px 16px; }
}

html body {
  background:
    linear-gradient(rgba(13,18,36,.85), rgba(13,18,36,.85)),
    url("Assets/fondo-comida.jpg") center / cover no-repeat fixed;
}

html[data-theme="light"] body {
  background:
    linear-gradient(rgba(255,255,255,.88), rgba(255,255,255,.88)),
    url("Assets/fondo-comida.jpg") center / cover no-repeat fixed;
}

.pagina { background: transparent; }
