/* Urboids limit box (limit-box.js; R58, R60, R63, R64), shared by the legal chat and the coordinates page: the
   person's limit, the progress bar toward unlimited, the survey cards and questions, the paid plans. Built on the
   colour names of styles.css, so dark mode follows. */

/* the person's limit */
.usage { max-width: 680px; margin-top: 24px; padding: 12px 14px; border-left: 3px solid var(--moss); border-radius: 0 10px 10px 0;
  background: var(--card); font-size: 0.92rem; color: var(--ink-soft); }
.usage p { margin: 0; }
.usage.is-limited { border-left-color: var(--clay); }
.usage-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.usage-cta { min-height: 40px; padding: 0 16px; font-size: 0.9rem; }
.usage-title { font-weight: 700; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--clay); }
.usage-countdown { margin-top: 10px !important; }
.usage-clock { font-variant-numeric: tabular-nums; color: var(--ink); }

.benefits { margin-top: 14px; }
.benefit-unlocked { margin: 0 0 10px !important; padding: 8px 12px; border-radius: 8px; color: var(--ink); font-weight: 600;
  background: color-mix(in srgb, var(--sage) 22%, transparent); }
.benefit-intro { margin-bottom: 10px !important; }
.benefit-grid { display: grid; gap: 8px; }
.benefit-card { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none;
  color: var(--ink); background: var(--bg); }
.benefit-card.is-next { border-color: var(--moss); }
.benefit-card:hover, .benefit-card:focus-visible { background: color-mix(in srgb, var(--sage) 14%, var(--bg)); }
.benefit-mark { font: 500 1.4rem/1.1 var(--serif); color: var(--moss); }
.benefit-title { font-weight: 600; }
.benefit-left { font-size: 0.82rem; color: var(--ink-soft); }
.benefit-next { font-size: 0.8rem; font-weight: 700; color: var(--moss); }

.plans { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.plans-title { font-weight: 700; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); }
.plans-body { margin-top: 6px !important; }
.plans-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.plan { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-align: left;
  background: var(--bg); color: var(--ink-soft); font: inherit; cursor: not-allowed; }
.plan-name { font-weight: 600; color: var(--ink); }
.plan-soon { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--na); }

/* ---- R63: the progress bar toward unlimited questions ---- */
.xp-track { position: relative; height: 18px; margin: 12px 0 4px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--sage) 22%, var(--bg)); border: 1px solid var(--line); box-shadow: inset 0 1px 3px rgba(31, 42, 36, 0.15); }
.xp-fill { position: absolute; inset: 0 auto 0 0; width: var(--fill, 15%); border-radius: 999px; transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: linear-gradient(180deg, #7fcf8c 0%, #4caf63 50%, #3a9a52 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 0 8px rgba(76, 175, 99, 0.45); }
.xp-fill::after { content: ""; position: absolute; inset: 0; width: 35%; border-radius: inherit;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.6), transparent); animation: xp-shine 2.4s ease-in-out infinite; }
@keyframes xp-shine { from { transform: translateX(-120%); } to { transform: translateX(380%); } }
.xp-marks { position: relative; height: 30px; font: 700 0.7rem/1.2 var(--sans); color: var(--na); }
.xp-mark { position: absolute; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.xp-mark::before { content: ""; display: block; width: 2px; height: 5px; margin: 0 auto 2px; background: currentColor; }
.xp-mark.got { color: var(--moss); }
.xp-mark:first-child { transform: none; text-align: left; } .xp-mark:first-child::before { margin-left: 0; }
.xp-mark:last-child { transform: translateX(-100%); text-align: right; } .xp-mark:last-child::before { margin-right: 0; }
.usage .xp-caption { margin: 0 0 4px; font-size: 0.84rem; }
.xp-caption b { color: var(--moss); }
.xp-max { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 14px;
  border: 1px solid #f4b400; border-radius: 12px; background: color-mix(in srgb, #ffd166 18%, var(--card)); animation: xp-glow 1.6s ease-in-out infinite; }
@keyframes xp-glow { 0%, 100% { box-shadow: 0 0 14px rgba(255, 209, 102, 0.35); }
  50% { box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.35), 0 0 30px rgba(255, 209, 102, 0.65); } }
.xp-max .xp-track { flex: 1 1 140px; margin: 0; }
.xp-max .xp-fill { background: linear-gradient(180deg, #fff1b8 0%, #ffd166 50%, #f4a52b 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), 0 0 12px rgba(255, 190, 60, 0.8); }
.xp-max .xp-fill::after { animation-duration: 1.2s; }
.xp-max-text { flex: 1 1 200px; }
.xp-max-text strong { display: block; font: 800 1.1rem/1.2 var(--sans); color: #b37400; }
.xp-max-text span { font-size: 0.85rem; }
.spark { position: absolute; width: 6px; height: 6px; border-radius: 1px; background: #f4b400; opacity: 0; animation: spark 1.8s linear infinite; }
@keyframes spark { 0% { opacity: 0; transform: translateY(0) rotate(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-36px) rotate(180deg); } }
.builder { flex: none; width: 66px; height: 80px; overflow: visible; }
.b-body { animation: b-jump 0.9s ease-in-out infinite; transform-origin: 40px 90px; }
@keyframes b-jump { 0%, 100% { transform: translateY(0) scaleY(1); } 15% { transform: translateY(2px) scaleY(0.94); } 45% { transform: translateY(-14px) scaleY(1.03); } 70% { transform: translateY(0); } }
.b-arm-l { transform-origin: 28px 48px; animation: b-wave-l 0.45s ease-in-out infinite alternate; }
.b-arm-r { transform-origin: 52px 48px; animation: b-wave-r 0.45s ease-in-out infinite alternate; }
@keyframes b-wave-l { from { transform: rotate(-20deg); } to { transform: rotate(18deg); } }
@keyframes b-wave-r { from { transform: rotate(20deg); } to { transform: rotate(-18deg); } }
.b-shadow { animation: b-shadow 0.9s ease-in-out infinite; transform-origin: 40px 90px; }
@keyframes b-shadow { 45% { transform: scaleX(0.6); opacity: 0.5; } }
button.benefit-card { width: 100%; font: inherit; text-align: left; cursor: pointer; }
/* the survey that opens inside the box: only the questions still missing for the card that was clicked */
.sv { margin-top: 12px; padding: 14px; border: 1px solid var(--moss); border-radius: 10px; background: var(--bg); }
.sv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sv-head strong { color: var(--ink); }
.sv-close { border: 0; background: none; color: var(--ink-soft); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.sv .survey-list { margin-top: 10px; gap: 10px; }
.sv .survey-card { padding: 12px 14px; }

/* the survey's question cards (inside the box and on the survey page) */
.survey-list { display: grid; gap: 14px; margin: 22px 0 0; padding: 0; list-style: none; }
.survey-card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.survey-card.is-done { border-color: var(--moss); }
.survey-q { display: flex; justify-content: space-between; gap: 12px; }
.survey-question { margin: 0; font-weight: 600; }
.survey-done { display: none; flex: none; align-self: start; padding: 2px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  background: var(--moss); color: var(--bg); }
.survey-card.is-done .survey-done { display: inline-block; }
.survey-hint { margin: 6px 0 10px; font-size: 0.82rem; color: var(--ink-soft); }
.survey-options { display: grid; gap: 6px; }
.survey-option { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.survey-option:hover { background: color-mix(in srgb, var(--sage) 12%, transparent); }
.survey-option input { margin-top: 4px; accent-color: var(--moss); }
.survey-option.is-off { opacity: 0.45; cursor: not-allowed; }
.survey-other, .survey-text { width: 100%; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: 0.95rem/1.4 var(--sans); }
.survey-note { margin: 8px 0 0; font-size: 0.85rem; }
.survey-note:empty { display: none; }
.survey-note.is-error { color: var(--danger); font-weight: 600; }

@media (min-width: 640px) {
  .benefit-grid { grid-template-columns: 1fr 1fr; }
  .plans-grid { grid-template-columns: repeat(4, 1fr); }
  .survey-card { padding: 20px 22px; }
}
@media (min-width: 900px) {
  .benefit-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .xp-fill { transition: none; }
  .xp-fill::after, .xp-max, .b-body, .b-arm-l, .b-arm-r, .b-shadow, .spark { animation: none; }
}
