/* Import Bristol font (debe ir primero) */
@import url('https://fonts.cdnfonts.com/css/bristol');

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #0b0c0e;
  --sub: #6b7280;
  --line: #e5e7eb;
  --brand: #0a0a0a;
  --accent: #111111;
  --highlight: #ffbd59; /* 🔶 naranja principal */
}

/* Reset & base */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.wrap { max-width: 900px; margin: 0 auto; padding: 24px; }

/* Header (centrado, con Bristol) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  text-align: center;
  padding: 6px 0; /* compacto */
}

/* El enlace del encabezado sin estilo */
.topbar a { text-decoration: none; color: inherit; }
.topbar a:visited, .topbar a:active, .topbar a:hover {
  text-decoration: none; color: inherit;
}

/* Logo principal */
.logo {
  font-family: 'Bristol', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-weight: 700;
  font-size: 36px;
  letter-spacing: 3px;
  color: var(--brand);
  margin: 0;
  transition: all 0.3s ease;
}
.logo:hover { letter-spacing: 4px; color: var(--accent); text-shadow: 0 0 8px rgba(0,0,0,0.08); }

/* Main area */
main.wrap { flex: 1; width: 100%; }

/* Typography */
h1, h2, h3 { margin: 8px 0 12px 0; }
h2 { font-size: 22px; }

/* Cards & grids */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .02);
}
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 8px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.kpi .label { font-size: 12px; color: var(--sub); }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 6px; }

/* Segmented control */
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--panel); }
.segmented a {
  padding: 8px 12px; text-decoration: none; color: #111; border-right: 1px solid var(--line); font-size: 13px;
}
.segmented a:last-child { border-right: none; }

/* Tables & forms */
.center { text-align: center; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; }
input, select, textarea {
  width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}

/* Enlaces dentro de tablas (ingredientes, etc.) */
table a {
  color: var(--highlight);
  text-decoration: none;
  font-weight: 500;
  transition: color .2s ease, opacity .2s ease;
}
table a:hover { opacity: .9; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, transform .05s ease;
}
.btn:hover { background: #000; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: #111; border: 1px solid var(--line); }
.btn.ghost:hover { background: #f2f2f2; }

.btn-ghost-light {
  background: #fff;
  border: 1px solid var(--line);
  color: #111 !important;
  border-radius: 12px;
  padding: 10px 14px;
  text-decoration: none;
  transition: background .2s ease, transform .05s ease;
}
.btn-ghost-light:hover { background: #f2f2f2; }
.btn-ghost-dark {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff !important;
  border-radius: 12px;
  padding: 10px 14px;
  text-decoration: none;
  transition: background .2s ease, transform .05s ease;
}
.btn-ghost-dark:hover { background: #000; }

/* Footer */
.footer {
  color: var(--sub);
  border-top: 1px solid var(--line);
  padding: 12px 0;
  background: var(--panel);
  text-align: center;
  font-size: 13px;
  margin-top: 0;
}
.footer a { color: var(--highlight); text-decoration: none; font-weight: 500; }
.footer a:hover { text-decoration: underline; }

/* Misc */
.small { font-size: 12px; color: var(--sub); }

/* Plain black link (e.g. "See all meals") — fuerza todos los estados */
.plain-link:link,
.plain-link:visited,
.plain-link:hover,
.plain-link:active,
.plain-link:focus {
  color: var(--text) !important;
  text-decoration: none !important;
  font-weight: 400 !important;
}

/* 🔻 Quick Navigation (barra de accesos rápidos sobre el footer) */
.quick-nav {
  display: flex;
  justify-content: center;
  gap: 56px;               /* 🔸 más separación entre iconos */
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;         /* algo más de aire */
  margin-top: 40px;
  position: sticky;        /* queda visible al llegar al final */
  bottom: 0;
  z-index: 5;
}
.quick-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;                /* espacio entre icono y texto */
  transition: color .2s ease, transform .1s ease;
}
.quick-nav a img {
  width: 28px;            /* iconos un pelín más grandes */
  height: 28px;
  opacity: 0.85;
  transition: opacity .2s ease, transform .1s ease, filter .2s ease;
}
.quick-nav a:hover { color: var(--highlight); transform: translateY(-1px); }
.quick-nav a:hover img {
  opacity: 1;
  transform: scale(1.08);
  filter: drop-shadow(0 0 3px rgba(255,189,89,.45));
}
.quick-nav a span { font-size: 11px; color: var(--sub); }

@media (max-width: 600px) {
  .quick-nav { gap: 30px; padding: 12px 0; }
  .quick-nav a img { width: 24px; height: 24px; }
  .quick-nav a span { font-size: 10px; }
}

/* ===== Auth pages ===== */
.auth-title {
  text-align: center;
  margin-top: 8px;
  margin-bottom: 12px;
}

.auth-wrap {
  max-width: 520px;
  margin: 0 auto;
}

.auth-card {
  padding: 22px 20px;
}

.grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.error-text {
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fecaca;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 0 0 10px 0;
}

.form-hint { margin-top: 10px; }
.muted { color: var(--sub); }
.muted-link {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.muted-link:hover { color: var(--accent); }

/* Opcional: desactivar la quick-nav en login/signup si quieres foco total */
body.auth .quick-nav { display: none; }