/* ============================================================
   auth.css — Estilos compartidos para login.html y register.html
   Misma identidad visual que landing.html (Sora + Inter, naranja)
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primario:       #f97316;
  --primario-hover: #ea6c0a;
  --oscuro:         #1e293b;
  --oscuro-2:       #0f172a;
  --texto:          #1e293b;
  --texto-suave:    #64748b;
  --fondo:          #f8fafc;
  --borde:          #e2e8f0;
  --error:          #dc2626;
  --error-fondo:    #fef2f2;
  --error-borde:    #fecaca;
  --display:        'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  --cuerpo:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radio:          12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--cuerpo);
  background: var(--fondo);
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* ---- Fondo decorativo: íconos de comida flotando ---- */
.comida-flotante {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.comida-icono {
  position: absolute;
  left: var(--x);
  bottom: -60px;
  font-size: 2rem;
  opacity: 0;
  animation: flotar-comida var(--dur) ease-in var(--delay) infinite;
  filter: blur(.3px);
}

@keyframes flotar-comida {
  0%   { transform: translateY(0) rotate(0deg);     opacity: 0; }
  8%   { opacity: .22; }
  50%  { transform: translateY(-52vh) rotate(14deg); opacity: .22; }
  92%  { opacity: .22; }
  100% { transform: translateY(-104vh) rotate(-10deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .comida-icono { animation: none; display: none; }
}

.auth-logo, .auth-card { position: relative; z-index: 1; }

/* ---- Logo ---- */
.auth-logo {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  color: var(--oscuro);
  text-decoration: none;
  display: block;
  margin-bottom: 1.75rem;
  text-align: center;
}

/* ---- Tarjeta ---- */
.auth-card {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 18px;
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

.auth-titulo {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  letter-spacing: -0.5px;
}

.auth-subtitulo {
  font-size: 0.88rem;
  color: var(--texto-suave);
  margin-bottom: 1.75rem;
}

/* ---- Campos ---- */
.campo {
  margin-bottom: 1.1rem;
}

.campo label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--texto);
}

.campo input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--borde);
  border-radius: var(--radio);
  font-family: var(--cuerpo);
  font-size: 0.95rem;
  color: var(--texto);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.campo input:focus {
  border-color: var(--primario);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
}

.campo input.invalido {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}

.campo-hint {
  font-size: 0.78rem;
  color: var(--texto-suave);
  margin-top: 0.3rem;
}

.campo-error-msg {
  font-size: 0.78rem;
  color: var(--error);
  margin-top: 0.3rem;
  display: none;
}

.campo-error-msg.visible { display: block; }

/* ---- Error general (servidor) ---- */
.auth-error {
  background: var(--error-fondo);
  border: 1px solid var(--error-borde);
  border-radius: var(--radio);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--error);
  margin-bottom: 1.1rem;
  display: none;
}

.auth-error.visible { display: block; }

/* ---- Botón principal ---- */
.btn-auth {
  display: block;
  width: 100%;
  padding: 0.85rem;
  background: var(--primario);
  color: #fff;
  border: none;
  border-radius: var(--radio);
  font-family: var(--cuerpo);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(249,115,22,0.3);
  margin-top: 0.5rem;
}

.btn-auth:hover {
  background: var(--primario-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249,115,22,0.4);
}

.btn-auth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ---- Botón secundario (ej. "Ingresar con Face ID / huella") ---- */
.btn-auth--secundario {
  background: transparent;
  color: var(--primario);
  border: 1.5px solid var(--primario);
  box-shadow: none;
}

.btn-auth--secundario:hover {
  background: rgba(249,115,22,0.08);
  box-shadow: none;
}

.oculto { display: none !important; }

/* ---- Botón "Continuar con Google" ---- */
/* ---- Link al otro formulario ---- */
.auth-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--texto-suave);
}

.auth-link a {
  color: var(--primario);
  font-weight: 600;
  text-decoration: none;
}

.auth-link a:hover { text-decoration: underline; }

/* ---- Vista previa del slug (solo lectura — el slug lo genera el backend) ---- */
.slug-preview {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--texto-suave);
}

.slug-preview strong {
  color: var(--texto);
  font-weight: 600;
}

/* ---- Responsive ---- */
@media (min-width: 480px) {
  .auth-card { padding: 2.25rem 2.25rem; }
}
