/* ============================================================
   SpesaChiara UI Kit — shared CSS
   Imports the design tokens then defines real components used
   across home, map, auth screens. Vanilla CSS, no frameworks.
   ============================================================ */

@import url("../../colors_and_type.css");

* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }

/* ============================================================
   Layout primitives
   ============================================================ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   Navbar (light)
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--border-2);
  transition: box-shadow var(--t-base);
}
.nav.scrolled { box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.nav-inner {
  height: 64px;
  display: flex; align-items: center; gap: 20px;
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.brand-plate {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--green-800);
  display: flex; align-items: center; justify-content: center;
}
.brand-word {
  font-size: 18px; font-weight: var(--fw-extra);
  letter-spacing: -0.035em; color: var(--zinc-900);
}
/* Brand convention: CamelCase wordmark, "Chiara" in #22c55e */
.brand-word .accent { color: var(--green-500); }

.nav-links {
  display: flex; align-items: center; gap: 2px;
  margin-left: 4px;
}
.nav-link {
  position: relative;
  padding: 8px 14px; border-radius: 10px;
  font-size: 13px; font-weight: var(--fw-semibold);
  color: var(--zinc-500); text-decoration: none;
  transition: color var(--t-fast), background var(--t-fast);
  border: none; background: none; cursor: pointer; font-family: inherit;
}
.nav-link:hover { color: var(--zinc-900); }
.nav-link::after {
  content: ''; position: absolute;
  left: 50%; right: 50%; bottom: -3px;
  height: 2px; background: var(--primary);
  border-radius: 2px;
  transition: left 0.22s, right 0.22s;
}
.nav-link:hover::after, .nav-link.active::after { left: 12px; right: 12px; }
.nav-spacer { flex: 1; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: inherit; font-weight: var(--fw-bold);
  font-size: 14px; letter-spacing: -0.01em;
  border-radius: 12px; cursor: pointer; border: none;
  transition: all var(--t-base);
  padding: 11px 18px;
  text-decoration: none;
  position: relative; overflow: hidden;
}
.btn:active { transform: translateY(1px) scale(0.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-cta-green);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(22,163,74,0.4);
}

/* Shimmer overlay -- triggers via .shimmer class on click */
.btn-primary::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg,
    transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(-100%);
  pointer-events: none;
}
.btn-primary.shimmer::before {
  animation: btnShimmer 0.85s ease-out;
}
@keyframes btnShimmer { to { transform: translateX(100%); } }

.btn-secondary {
  background: #fff; color: var(--zinc-700);
  border: 1px solid var(--border-1);
}
.btn-secondary:hover {
  background: var(--bg-2); border-color: var(--zinc-300);
  transform: translateY(-1px);
}
.btn-tint {
  background: var(--green-50); color: var(--green-700);
  border: 1px solid var(--green-200); font-weight: var(--fw-semibold);
}
.btn-tint:hover { background: var(--green-100); }
.btn-ghost {
  background: transparent; color: var(--zinc-600);
  font-weight: var(--fw-semibold);
}
.btn-ghost:hover { background: var(--zinc-100); color: var(--zinc-900); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ============================================================
   Pills / badges / chips
   ============================================================ */
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 13px; border-radius: 9999px;
  background: var(--green-50); color: var(--primary);
  border: 1px solid var(--green-200);
  font-size: 11px; font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 6px var(--green-500);
}

/* Pulse animation for "live" / "verified" badges */
.pulse-badge { animation: pulseBadge 2.4s ease-in-out infinite; }
@keyframes pulseBadge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 9999px;
  font-size: 11px; font-weight: var(--fw-bold); border: 1px solid;
}
.badge-good { background: var(--conv-good-bg); color: var(--conv-good-fg); border-color: var(--conv-good-line); }
.badge-mid  { background: var(--conv-mid-bg);  color: var(--conv-mid-fg);  border-color: var(--conv-mid-line); }
.badge-bad  { background: var(--conv-bad-bg);  color: var(--conv-bad-fg);  border-color: var(--conv-bad-line); }

.chip {
  padding: 6px 14px; border-radius: 9999px;
  border: 1.5px solid var(--border-1); background: #fff;
  font-size: 13px; font-weight: var(--fw-semibold); color: var(--zinc-500);
  cursor: pointer; transition: all 0.16s;
  font-family: inherit;
}
.chip:hover { border-color: var(--green-300); color: var(--primary); background: var(--green-50); }
.chip.active {
  border-color: var(--primary);
  color: var(--primary); background: var(--green-50);
  /* Improvement 5: active filter glow */
  box-shadow: var(--shadow-glow-green);
}
/* Improvement 5: press feedback */
.chip.pressing { transform: scale(0.95); transition: transform 0.1s; }

/* ============================================================
   Form fields (light)
   ============================================================ */
.form-field { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px; font-weight: var(--fw-bold);
  color: var(--zinc-600); letter-spacing: 0.02em;
  margin-bottom: 7px;
}
.form-input {
  display: block; width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border-1);
  border-radius: 11px;
  font-size: 15px; font-family: inherit; font-weight: var(--fw-medium);
  color: var(--zinc-900); background: #fff;
  outline: none;
  /* Improvement 7: smooth focus transition */
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.form-input::placeholder { color: var(--zinc-400); font-weight: 400; }
.form-input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus-green);
  background: #fff;
}
.form-input:disabled {
  background: var(--zinc-100); color: var(--zinc-400);
  cursor: not-allowed;
}
.form-input.error {
  border-color: var(--conv-bad-dot);
  box-shadow: var(--shadow-focus-red);
}

/* ============================================================
   Toasts (Improvement 8)
   Container in bottom-right; each toast slides in from right
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column;
  gap: 10px; z-index: 1000;
  max-width: calc(100vw - 32px); width: 380px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px 14px 14px;
  background: #fff; border-radius: 12px;
  border: 1px solid var(--border-1);
  border-left: 4px solid var(--zinc-300);
  box-shadow: 0 8px 30px rgba(0,0,0,0.10);
  animation: toastIn 0.36s var(--t-slow);
}
.toast.leaving { animation: toastOut 0.32s ease-in forwards; }
.toast-success { border-left-color: var(--green-500); }
.toast-error   { border-left-color: var(--conv-bad-dot); }
.toast-info    { border-left-color: #3b82f6; }
.toast-icon {
  width: 22px; height: 22px; border-radius: 50%;
  flex-shrink: 0; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
}
.toast-success .toast-icon { background: var(--green-500); }
.toast-error   .toast-icon { background: var(--conv-bad-dot); }
.toast-info    .toast-icon { background: #3b82f6; }
.toast-body { flex: 1; min-width: 0; }
.toast-title {
  font-size: 13px; font-weight: var(--fw-bold);
  color: var(--zinc-900);
  letter-spacing: -0.01em;
}
.toast-desc {
  font-size: 12px; color: var(--zinc-500);
  margin-top: 2px; line-height: 1.45;
}
@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  to { transform: translateX(20px); opacity: 0; }
}

/* ============================================================
   Misc helpers
   ============================================================ */
.hidden { display: none !important; }
.flex { display: flex; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Subtle reveal on scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.reveal.in { opacity: 1; transform: translateY(0); }
