/* =========================================================
   MIO — shared design tokens & primitives
   App di community locale · quiz da fiera
   ========================================================= */

:root {
  /* Brand */
  --mio: #EF7D05;
  --mio-2: #D86E00;
  --mio-3: #B85B00;
  --mio-soft: #FFEBD5;
  --mio-soft-2: #FFE0BD;
  --mio-tint: #FFF6EC;
  --ink: #333333;
  --ink-2: #1F1F1F;
  --ink-soft: #5A5A5A;
  --muted: #8A8A8A;
  --muted-2: #B6B6B6;
  --line: rgba(51, 51, 51, .12);
  --line-strong: rgba(51, 51, 51, .22);
  --paper: #FFFFFF;
  --paper-warm: #FFFBF5;

  /* Accent friends (kept harmonious with the orange) */
  --grape: #6E4DBF;
  --teal: #2BA89A;
  --rose: #E9486B;
  --lemon: #F5C443;

  /* States */
  --success: #2BA877;
  --danger: #E14848;

  /* Type */
  --display: "Raleway", "Helvetica Neue", Arial, sans-serif;
  --ui: "Nunito", "Helvetica Neue", Arial, sans-serif;

  /* Radii — round-everything vibe */
  --r-xs: 8px;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ui);
  color: var(--ink);
  background: var(--mio-soft);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Atoms ---------- */

.eyebrow {
  font-family: var(--ui);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--mio);
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 999px; background: var(--mio); display: inline-block;
}

.display {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: .98;
}

/* MIO mark (text-based since we don't have the real logo) */
.mio-mark {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--mio);
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.mio-mark .o {
  display: inline-block;
  width: 0.72em;
  height: 0.72em;
  border-radius: 999px;
  background: var(--mio);
  margin-left: 0.02em;
  position: relative;
  top: 0.04em;
}
.mio-mark .o::after {
  content: "";
  position: absolute;
  inset: 22% 22% auto auto;
  width: 0.18em;
  height: 0.18em;
  background: var(--mio-soft);
  border-radius: 999px;
}
.mio-mark.business::after {
  content: "BUSINESS";
  font-family: var(--ui);
  font-size: 0.22em;
  letter-spacing: .25em;
  font-weight: 800;
  color: var(--ink);
  margin-left: 0.5em;
  align-self: center;
}

/* Co-brand lockup */
.cobrand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.cobrand .mio-mark { font-size: 24px; }
.cobrand .div { width: 1px; height: 22px; background: var(--line-strong); }
.cobrand .by {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.cobrand .by em {
  font-style: normal;
  color: var(--ink);
  font-weight: 800;
}

/* Buttons — pill-shaped, friendly */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .01em;
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s var(--ease), background .15s var(--ease), border .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
  background: var(--mio);
  color: #fff;
  box-shadow: 0 8px 0 -2px var(--mio-3), 0 14px 26px -10px rgba(239, 125, 5, .55);
}
.btn-primary:hover { background: var(--mio-2); transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: #fff; border-color: var(--ink); }
.btn-light {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn-light:hover { border-color: var(--mio); color: var(--mio); }
.btn-lg { padding: 18px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 16px; font-size: 13px; }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
}
.input {
  appearance: none;
  font-family: var(--ui);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--r);
  padding: 14px 18px;
  outline: none;
  transition: border .15s var(--ease), box-shadow .15s var(--ease);
}
.input:focus {
  border-color: var(--mio);
  box-shadow: 0 0 0 4px rgba(239, 125, 5, .15);
}
.input::placeholder { color: var(--muted-2); font-weight: 500; }

/* Card */
.card {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: 0 1px 0 rgba(51,51,51,.04), 0 22px 40px -28px rgba(51,51,51,.18);
}

/* Tag */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  background: var(--mio-soft);
  color: var(--mio-3);
}
.tag.solid { background: var(--mio); color: #fff; }
.tag.dark  { background: var(--ink); color: #fff; }
.tag.grape { background: rgba(110, 77, 191, .12); color: var(--grape); }
.tag.teal  { background: rgba(43, 168, 154, .14); color: var(--teal); }
.tag.rose  { background: rgba(233, 72, 107, .12); color: var(--rose); }
.tag.lemon { background: rgba(245, 196, 67, .22); color: #8A6B00; }
.tag.success { background: rgba(43, 168, 119, .16); color: #1F7A55; }
.tag.danger  { background: rgba(225, 72, 72, .14); color: #B43030; }
.tag .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* Soft blobs that we use as background decor */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(0px);
  pointer-events: none;
}

/* Focus ring */
:focus-visible { outline: 3px solid var(--mio); outline-offset: 2px; border-radius: 4px; }

/* Scrollbar */
.scroll-thin::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll-thin::-webkit-scrollbar-thumb { background: var(--mio-soft-2); border-radius: 999px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }

/* Animations on/off — set [data-anim="off"] on <html> */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
html[data-anim="off"] *,
html[data-anim="off"] *::before,
html[data-anim="off"] *::after {
  animation: none !important;
  transition: none !important;
}

/* Soft confetti/ping animations (used in user/admin) */
@keyframes mio-pop {
  0% { transform: scale(.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes mio-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 125, 5, .55); }
  70% { box-shadow: 0 0 0 12px rgba(239, 125, 5, 0); }
}
@keyframes mio-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes mio-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
