/* ============================================================
   Contexell "Signals" theme — shared tokens + primitives.
   Concept: live context signals (rain, heat, holidays) flow into
   your catalog and come out as today's ranked promotions.
   Fonts: Sora (display) + Inter (body). No build step.
   ============================================================ */

:root {
  /* Ink & paper */
  --ink: #070b19;
  --ink-2: #0d1428;
  --ink-soft: #3d4358;
  --muted: #676e83;
  --paper: #f7f8fc;
  --surface: #ffffff;
  --line: #e6e8f2;

  /* Brand */
  --primary: #5457f2;
  --primary-deep: #3d3fd8;
  --violet: #9b5cf7;
  --grad: linear-gradient(115deg, #5457f2 0%, #9b5cf7 60%, #c65cf7 100%);
  --grad-soft: linear-gradient(115deg, rgba(84, 87, 242, 0.12), rgba(155, 92, 247, 0.12));

  /* Signal colors — the visual identity of the product */
  --sig-rain: #38bdf8;
  --sig-heat: #fb923c;
  --sig-uv: #facc15;
  --sig-cold: #7dd3fc;
  --sig-pollen: #a3e635;
  --sig-wind: #94a3b8;
  --sig-holiday: #f472b6;
  --sig-weekend: #c084fc;

  --good: #10b981;
  --warn: #d97706;
  --bad: #e11d48;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(7, 11, 25, 0.05), 0 10px 30px rgba(7, 11, 25, 0.07);
  --shadow-lg: 0 6px 16px rgba(7, 11, 25, 0.09), 0 30px 70px rgba(7, 11, 25, 0.16);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Sora", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .display { font-family: var(--font-display); }

a { color: var(--primary-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 22px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.15s;
  text-decoration: none !important;
  line-height: 1.2;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 22px rgba(84, 87, 242, 0.38);
}
.btn-primary:hover { box-shadow: 0 12px 30px rgba(84, 87, 242, 0.5); }

.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.btn-ghost:hover { border-color: #cdd2e4; }

.btn-ghost-dark {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
}
.btn-ghost-dark:hover { background: rgba(255, 255, 255, 0.14); }

.btn-lg { padding: 15px 28px; font-size: 16px; border-radius: 14px; }
.btn-sm { padding: 8px 15px; font-size: 13.5px; border-radius: 10px; }
.btn-danger { background: #fff1f2; color: var(--bad); border-color: #fecdd3; }
.btn-danger:hover { background: #ffe4e6; }

/* ---------- Nav ---------- */

.nav { position: sticky; top: 0; z-index: 60; }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 28px;
  max-width: 1200px;
  margin: 0 auto;
}
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { font-size: 14.5px; font-weight: 500; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  text-decoration: none !important;
}
.brand-dot {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--grad);
  box-shadow: 0 4px 12px rgba(84, 87, 242, 0.55);
  display: inline-block;
}
.brand-dot::after {
  /* the "signal" — a small pulse in the logo */
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.95;
}

/* ---------- Signal chips (shared identity element) ---------- */

.sig-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}
.sig-chip .sig-ico { font-size: 14px; line-height: 1; }
.sig-chip[data-sig="rain"]    { border-color: rgba(56,189,248,.45);  background: rgba(56,189,248,.1);  color: #0369a1; }
.sig-chip[data-sig="heat"]    { border-color: rgba(251,146,60,.45);  background: rgba(251,146,60,.1);  color: #c2410c; }
.sig-chip[data-sig="uv"]      { border-color: rgba(250,204,21,.55);  background: rgba(250,204,21,.14); color: #a16207; }
.sig-chip[data-sig="cold"]    { border-color: rgba(125,211,252,.5);  background: rgba(125,211,252,.12);color: #0284c7; }
.sig-chip[data-sig="pollen"]  { border-color: rgba(163,230,53,.5);   background: rgba(163,230,53,.12); color: #4d7c0f; }
.sig-chip[data-sig="wind"]    { border-color: rgba(148,163,184,.5);  background: rgba(148,163,184,.14);color: #475569; }
.sig-chip[data-sig="holiday"] { border-color: rgba(244,114,182,.45); background: rgba(244,114,182,.1); color: #be185d; }
.sig-chip[data-sig="weekend"] { border-color: rgba(192,132,252,.45); background: rgba(192,132,252,.12);color: #7e22ce; }

/* dark-surface variant */
.on-dark .sig-chip { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.07); color: rgba(255,255,255,.92); }

/* ---------- Forms ---------- */

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field input {
  width: 100%;
  padding: 12px 15px;
  font-size: 15px;
  font-family: var(--font);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(84, 87, 242, 0.13); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.form-error, .form-success {
  display: none;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
}
.form-error { background: #fff1f2; border: 1px solid #fecdd3; color: var(--bad); }
.form-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.form-error.visible, .form-success.visible { display: block; }

/* ---------- Misc ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef0fc;
  color: var(--primary-deep);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: -2px;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35); }
  70% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399;
  animation: pulse-ring 2.2s ease-out infinite;
  display: inline-block;
}
