/* ===== Ojito — estilos compartidos ===== */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Instrument+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #F6F3EA;
  --card: #FFFFFF;
  --text: #2A332B;
  --muted: #5A6557;
  --primary: #E29A3C;          /* signal — acción principal */
  --primary-dark: #C9852B;
  --border: #D8DECF;
  --shadow: 0 20px 50px -24px rgba(51, 80, 60, 0.35);
  --radius: 16px;
  --green: #2E8B57;
  --sage: #7C9885;
  --sage-deep: #33503C;
  --sage-darker: #27402F;
  --sage-soft: #E3EBE0;
  --on-dark: #EEF3EA;
  --on-dark-soft: #BCCDBB;
  --signal: #E29A3C;
}

body {
  background: var(--bg);
  font-family: 'Instrument Sans', sans-serif;
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Nav ===== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(39, 64, 47, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
/* Nav oscuro: textos claros */
nav .logo, nav .nav-user { color: #fff; }
nav .nav-link { color: var(--on-dark-soft); }
nav .nav-link:hover { color: #fff; }
nav .btn-ghost { color: var(--on-dark-soft); }
nav .btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }

.nav-wrap {
  max-width: 1180px;
  margin: auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Bricolage Grotesque', serif;
  font-size: 1.5rem;
  font-weight: 900;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

/* Logo: ojo animado (SVG) que "busca" de lado a lado */
.logo-eye {
  display: inline-flex;
  align-items: center;
}

.logo-eye svg {
  display: block;
  height: 42px;
  width: 42px;
}

.logo-word {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
}

/* Ojo animado (el de siempre): "busca" de lado a lado */
.logo-eye-bg { fill: var(--primary); }
.logo-iris { animation: eye-search 4s ease-in-out infinite; }
@keyframes eye-search {
  0%, 12%   { transform: translateX(0); }
  26%, 40%  { transform: translateX(-4px); }
  54%, 68%  { transform: translateX(4px); }
  82%, 100% { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-iris { animation: none; }
}

.nav-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
}

.nav-link:hover {
  color: var(--text);
}

.nav-user {
  font-weight: 700;
  color: var(--text);
}

/* ===== Botones ===== */
.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  transition: 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: #2A2014;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(226, 154, 60, 0.4);
}

.btn-secondary {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ===== Layout genérico ===== */
.section {
  max-width: 1180px;
  margin: auto;
  padding: 64px 24px;
}

.section-title {
  font-family: 'Bricolage Grotesque', serif;
  font-size: 2rem;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.section-sub {
  color: var(--muted);
  max-width: 700px;
  margin-bottom: 40px;
  font-size: 0.98rem;
}

/* ===== Auth / formularios ===== */
.auth-wrap {
  max-width: 460px;
  margin: 60px auto;
  padding: 0 24px;
}

.auth-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-family: 'Bricolage Grotesque', serif;
  font-size: 2.2rem;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.auth-card .sub {
  color: var(--muted);
  margin-bottom: 28px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.field input,
.field select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: 0.2s ease;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-error {
  background: rgba(255, 111, 97, 0.12);
  color: var(--primary-dark);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 18px;
  display: none;
}

.form-error.show {
  display: block;
}

.auth-foot {
  text-align: center;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-foot a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

/* ===== Categorías / chips selección ===== */
.cat-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}

.cat-option {
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  transition: 0.2s ease;
  font-weight: 700;
  font-size: 0.9rem;
}

.cat-option .emoji {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 6px;
}

.cat-option:hover {
  border-color: var(--primary);
}

.cat-option.selected {
  border-color: var(--primary);
  background: rgba(255, 111, 97, 0.08);
  color: var(--primary-dark);
}

.channels {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chan {
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  background: var(--bg);
  font-weight: 700;
  font-size: 0.88rem;
  transition: 0.2s ease;
}

.chan.selected {
  border-color: var(--primary);
  background: rgba(255, 111, 97, 0.08);
  color: var(--primary-dark);
}

/* ===== Panel / dashboard ===== */
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 40px;
}

.panel-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  flex: 1;
  min-width: 160px;
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  font-family: 'Bricolage Grotesque', serif;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.alerts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.alert-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  position: relative;
}

.alert-card.paused {
  opacity: 0.65;
}

.alert-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.alert-emoji {
  font-size: 2rem;
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active {
  background: rgba(0, 200, 83, 0.12);
  color: #06913f;
}

.status-paused {
  background: rgba(109, 109, 109, 0.12);
  color: var(--muted);
}

.alert-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.alert-meta {
  list-style: none;
  margin: 0 0 18px;
}

.alert-meta li {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.alert-meta li::before {
  content: '';
  margin: 0;
}

.alert-actions {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.alert-actions .btn {
  padding: 9px 16px;
  font-size: 0.85rem;
  flex: 1;
}

.empty-state {
  text-align: center;
  padding: 70px 24px;
  background: white;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state .emoji {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-family: 'Bricolage Grotesque', serif;
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.empty-state p {
  color: var(--muted);
  margin-bottom: 24px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: #111;
  color: white;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 500;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ===== Footer ===== */
footer {
  background: linear-gradient(200deg, #3C5A45 0%, var(--sage-deep) 45%, var(--sage-darker) 100%);
  color: var(--on-dark-soft);
  margin-top: 40px;
}
.footer-grid .logo .logo-word { color: #fff; }

.footer-grid {
  max-width: 1180px;
  margin: auto;
  padding: 60px 24px 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}

.footer-grid .logo {
  color: white;
}

.footer-grid h4 {
  color: white;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.footer-grid nav {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: none;
  border: none;
  backdrop-filter: none;
}

.footer-grid nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 500;
}

.footer-grid nav a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 22px 24px;
  text-align: center;
  font-size: 0.9rem;
}

/* ===== Skip link (accesibilidad) ===== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: white;
  padding: 12px 18px;
  border-radius: 0 0 12px 0;
  z-index: 999;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

/* ===== Feed de oportunidades (panel) ===== */
.notif-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 48px;
}

.notif {
  background: white;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.notif.unseen {
  background: rgba(255, 111, 97, 0.05);
}

.notif .n-main strong {
  display: block;
  font-size: 1.05rem;
}

.notif .n-main span {
  color: var(--muted);
  font-size: 0.88rem;
}

.notif .n-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

/* ===== Tarjeta de integración Telegram ===== */
.tg-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.tg-card .tg-icon {
  font-size: 2rem;
}

.tg-card .tg-text strong {
  display: block;
  font-size: 1.1rem;
}

.tg-card .tg-text span {
  color: var(--muted);
  font-size: 0.92rem;
}

.tg-connected {
  border-left: 4px solid var(--green);
}

.unseen-badge {
  background: var(--primary);
  color: white;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  margin-left: 8px;
}

@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 640px) {
  .section-title {
    font-size: 2.2rem;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .auth-card {
    padding: 28px 22px;
  }
}
