﻿/* =========================================================
   Xyra Spinning Wheel — theme + layout
   Palette is defined as variables; swap these hex values for
   the exact thexyra.ai brand colours any time.
   ========================================================= */
:root {
  --xyra-bg: #0a0a12;
  --xyra-bg-2: #0e0e1c;
  --xyra-surface: #15152400;
  --xyra-card: #16162a;
  --xyra-card-2: #1d1d35;
  --xyra-border: #2a2a45;
  --xyra-primary: #6d28d9;   /* violet */
  --xyra-primary-2: #4f46e5; /* indigo */
  --xyra-accent: #06b6d4;    /* cyan   */
  --xyra-gold: #f5b700;      /* gold   */
  --xyra-pink: #db2777;      /* pink   */
  --xyra-text: #f4f4fb;
  --xyra-muted: #9a9ab8;
  --xyra-green: #22c55e;
  --xyra-red: #ef4444;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --grad: linear-gradient(135deg, var(--xyra-primary), var(--xyra-primary-2) 55%, var(--xyra-accent));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--xyra-text);
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(109, 40, 217, .35), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(6, 182, 212, .22), transparent 55%),
    radial-gradient(800px 700px at 50% 120%, rgba(219, 39, 119, .18), transparent 60%),
    var(--xyra-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--xyra-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1120px, 92vw); margin: 0 auto; }

/* ---------- Top brand bar ---------- */
.brandbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; gap: 16px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; letter-spacing: .3px; font-size: 1.25rem;
}
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px; background: var(--grad);
  display: grid; place-items: center; font-weight: 900; color: #fff;
  box-shadow: 0 8px 24px rgba(109, 40, 217, .5);
}
.brand .logo span { transform: translateY(-1px); }
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--xyra-muted); letter-spacing: 2px; }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-logo.lg { height: 46px; }
@media (max-width: 480px) { .brand-logo { height: 30px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font-weight: 700; font-size: .95rem;
  padding: 12px 22px; border-radius: 999px; color: #fff;
  background: var(--grad); transition: transform .12s ease, box-shadow .2s ease, opacity .2s;
  box-shadow: 0 10px 30px rgba(79, 70, 229, .4); text-decoration: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(79, 70, 229, .55); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: transparent; border: 1px solid var(--xyra-border); color: var(--xyra-text); box-shadow: none; }
.btn.ghost:hover { border-color: var(--xyra-accent); }
.btn.gold { background: linear-gradient(135deg, #f5b700, #ff8a00); box-shadow: 0 10px 30px rgba(245, 183, 0, .4); color: #211a00; }
.btn.danger { background: linear-gradient(135deg, #ef4444, #b91c1c); box-shadow: none; }
.btn.sm { padding: 8px 14px; font-size: .82rem; }
.btn.block { width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--xyra-card), var(--xyra-card-2));
  border: 1px solid var(--xyra-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* =========================================================
   PUBLIC WHEEL PAGE
   ========================================================= */
.hero { text-align: center; padding: 8px 0 4px; }
.hero h1 {
  font-size: clamp(1.8rem, 4.6vw, 3rem); margin: 6px 0 8px; line-height: 1.1;
  background: linear-gradient(120deg, #fff, var(--xyra-accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--xyra-muted); max-width: 560px; margin: 0 auto; font-size: 1.02rem; }
.pill {
  display: inline-flex; gap: 8px; align-items: center; font-size: .78rem; font-weight: 700;
  padding: 6px 14px; border-radius: 999px; color: var(--xyra-accent);
  background: rgba(6, 182, 212, .12); border: 1px solid rgba(6, 182, 212, .3); letter-spacing: 1px;
}

.wheel-stage {
  display: flex; flex-direction: column; align-items: center; gap: 26px;
  margin: 26px 0 60px;
}

.wheel-wrap {
  position: relative; width: min(600px, 88vw, 68vh); aspect-ratio: 1; margin: 0 auto;
}
.wheel-wrap::before { /* glow ring */
  content: ""; position: absolute; inset: -14px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--xyra-primary), var(--xyra-accent), var(--xyra-gold), var(--xyra-pink), var(--xyra-primary));
  filter: blur(14px); opacity: .55; z-index: 0;
}
.wheel-ring {
  position: absolute; inset: 0; border-radius: 50%; z-index: 1;
  padding: 10px; background: linear-gradient(145deg, #2a2a48, #0c0c18);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.06), var(--shadow);
}
#wheel {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  transition: transform 5.2s cubic-bezier(.12, .66, 0, 1);
  will-change: transform;
}
.wheel-hub {
  position: absolute; z-index: 3; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 20%; height: 20%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #c7c7e6 40%, #6d28d9);
  display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.5), inset 0 2px 6px rgba(255,255,255,.6);
  border: 3px solid #fff; cursor: pointer; transition: transform .12s ease, box-shadow .2s ease;
  outline: none;
}
.wheel-hub:hover { transform: translate(-50%, -50%) scale(1.07); box-shadow: 0 10px 26px rgba(109,40,217,.6), inset 0 2px 6px rgba(255,255,255,.6); }
.wheel-hub:active { transform: translate(-50%, -50%) scale(.95); }
.wheel-hub:focus-visible { box-shadow: 0 0 0 4px rgba(6,182,212,.6), 0 6px 20px rgba(0,0,0,.5); }
.wheel-hub span { font-weight: 900; color: #3b0d79; font-size: clamp(.6rem, 2.2vw, .9rem); letter-spacing: .5px; }
.wheel-pointer {
  position: absolute; z-index: 4; top: -6px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 17px solid transparent; border-right: 17px solid transparent;
  border-top: 30px solid var(--xyra-gold);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.5));
}

.wheel-side { }
.wheel-side h2 { margin: 0 0 6px; font-size: 1.35rem; }
.wheel-side .muted { color: var(--xyra-muted); margin-top: 0; }
.legend { display: grid; gap: 8px; margin: 18px 0 24px; }
.legend .row { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.legend .dot { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.legend .row small { color: var(--xyra-muted); margin-left: auto; }

.spin-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Result + modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(5, 5, 12, .72); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.overlay.open { display: flex; }

/* Balloon blast — rises behind the popup card on the reward reveal */
.balloons { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.balloon-rise {
  position: absolute; bottom: -24%;
  animation-name: balloonrise; animation-timing-function: ease-in; animation-fill-mode: forwards;
}
.balloon {
  position: relative; width: var(--size, 48px); height: calc(var(--size, 48px) * 1.22);
  border-radius: 48% 48% 50% 50% / 58% 58% 42% 42%;
  background:
    radial-gradient(ellipse 26% 18% at 30% 22%, rgba(255,255,255,.95), rgba(255,255,255,0) 60%),
    radial-gradient(circle at 36% 30%, rgba(255,255,255,.4), rgba(255,255,255,0) 45%),
    radial-gradient(circle at 60% 78%, rgba(0,0,0,.22), rgba(0,0,0,0) 55%),
    var(--c, #f5b700);
  box-shadow: inset -5px -9px 14px rgba(0,0,0,.22), inset 4px 4px 9px rgba(255,255,255,.3);
  filter: drop-shadow(0 7px 7px rgba(0,0,0,.28));
  animation-name: balloonsway; animation-duration: 2.6s; animation-timing-function: ease-in-out;
  animation-iteration-count: infinite; animation-direction: alternate;
}
.balloon::before { /* knot */
  content: ""; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 10px solid var(--c, #f5b700);
  filter: brightness(.88);
}
.balloon::after { /* curly string */
  content: ""; position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  width: 20px; height: 62px;
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2064'%3E%3Cpath%20d='M10%200%20C3%2011%2017%2020%2010%2031%20C3%2042%2017%2051%2010%2064'%20fill='none'%20stroke='%23ffffff'%20stroke-opacity='0.5'%20stroke-width='1.6'/%3E%3C/svg%3E") no-repeat center / contain;
}
@keyframes balloonrise {
  0% { transform: translateY(0) scale(.5); opacity: 0; }
  10% { transform: translateY(-6vh) scale(1); opacity: 1; }
  86% { opacity: 1; }
  100% { transform: translateY(-140vh) scale(1); opacity: 0; }
}
@keyframes balloonsway {
  from { transform: translateX(-11px) rotate(-6deg); }
  to   { transform: translateX(11px) rotate(6deg); }
}
@media (prefers-reduced-motion: reduce) {
  .balloon { animation: none; }
}

.modal {
  width: min(460px, 100%); padding: 30px 26px; text-align: center; position: relative; z-index: 2;
  animation: pop .35s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { font-size: 1.5rem; margin: 6px 0 4px; }
.modal .won-label {
  font-size: 1.8rem; font-weight: 900; margin: 10px 0;
  background: linear-gradient(120deg, var(--xyra-gold), #ff8a00); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.modal .close {
  position: absolute; top: 12px; right: 14px; background: none; border: 0; color: var(--xyra-muted);
  font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.modal .close:hover { color: #fff; }

.field { text-align: left; margin-bottom: 14px; }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; color: var(--xyra-muted); }
.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; font-size: .95rem;
  background: #0f0f1e; border: 1px solid var(--xyra-border); color: var(--xyra-text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--xyra-primary); box-shadow: 0 0 0 3px rgba(109,40,217,.3); }
.field .err { color: var(--xyra-red); font-size: .78rem; margin-top: 5px; display: none; }
.field.invalid .err { display: block; }
.field.invalid .input { border-color: var(--xyra-red); }

.reward-box {
  margin: 16px 0; padding: 18px; border-radius: 14px; border: 1px dashed var(--xyra-accent);
  background: rgba(6,182,212,.08);
}
.reward-box .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.1rem; font-weight: 800;
  letter-spacing: 1px; color: var(--xyra-gold); word-break: break-word;
}
.reward-box p { margin: 8px 0 0; color: var(--xyra-text); }

.toast-note { font-size: .8rem; color: var(--xyra-muted); margin-top: 10px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

.footer { text-align: center; color: var(--xyra-muted); font-size: .85rem; padding: 26px 0 40px; }
.footer a { color: var(--xyra-muted); }

/* ---------- 1-2-3 steps strip ---------- */
.steps {
  list-style: none; margin: 4px 0 0; padding: 0;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
}
.step {
  display: flex; align-items: center; gap: 12px; padding: 12px 22px 12px 12px;
  background: #fff; color: #1a1033; border-radius: 18px; font-weight: 800; line-height: 1.15;
  opacity: .55; transform: scale(.96); transition: opacity .3s, transform .3s, box-shadow .3s;
}
.step.active { opacity: 1; transform: scale(1.04); box-shadow: 0 0 0 3px #8b5cf6, 0 12px 30px rgba(109,40,217,.5); }
.step-n {
  width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-weight: 900;
}
.step-ico { font-size: 1.6rem; }
.step-arrow { color: var(--xyra-muted); font-size: 1.6rem; font-weight: 900; }

/* Phones / narrow screens */
@media (max-width: 900px) {
  .step-arrow { display: none; }
  .step { padding: 10px 14px 10px 10px; font-size: .85rem; gap: 8px; }
  .step-ico { font-size: 1.2rem; }
}

/* =========================================================
   BUSINESS CALCULATOR
   ========================================================= */
.calc { width: min(1120px, 94vw); }
.calc-shell {
  display: grid; grid-template-columns: 380px 1fr; overflow: hidden; margin: 10px 0 8px;
  animation: pop .35s cubic-bezier(.2,.9,.3,1.2);
}

/* Value panel */
.calc-aside {
  position: relative; padding: 40px 34px; display: flex; flex-direction: column; gap: 18px;
  background:
    radial-gradient(420px 260px at 0% 0%, rgba(6,182,212,.35), transparent 70%),
    radial-gradient(380px 300px at 100% 100%, rgba(219,39,119,.28), transparent 70%),
    linear-gradient(160deg, #3b1d8f, #1e1a5e 55%, #12122a);
  border-right: 1px solid var(--xyra-border);
}
.calc-eyebrow { margin: 0; font-size: .74rem; font-weight: 800; letter-spacing: 2.4px; text-transform: uppercase; color: var(--xyra-accent); }
.calc-aside h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.12; font-weight: 900; }
.calc-lead { margin: 0; color: #cfcfe8; font-size: .98rem; }
.calc-benefits { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 14px; }
.calc-benefits li { display: flex; gap: 14px; align-items: flex-start; font-size: .88rem; color: #cfcfe8; }
.calc-benefits li > span {
  width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16);
}
.calc-benefits strong { display: block; color: #fff; font-size: .98rem; margin-bottom: 1px; }
.calc-trust { margin: auto 0 0; padding-top: 14px; font-size: .78rem; color: #b6b6d6; border-top: 1px solid rgba(255,255,255,.12); }

/* Form side */
.calc-main { padding: 34px 38px 32px; min-width: 0; }
.stepper { list-style: none; margin: 0 0 28px; padding: 0; display: flex; gap: 8px; }
.stepper li {
  flex: 1; display: flex; align-items: center; gap: 10px; padding-bottom: 12px;
  font-size: .84rem; font-weight: 700; color: var(--xyra-muted);
  border-bottom: 3px solid var(--xyra-border); transition: color .25s, border-color .25s;
}
.stepper li span {
  width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: .8rem; font-weight: 900; background: #0f0f1e; border: 1px solid var(--xyra-border);
  transition: background .25s, border-color .25s;
}
.stepper li.active { color: var(--xyra-text); border-bottom-color: var(--xyra-primary); }
.stepper li.active span { background: var(--grad); border-color: transparent; color: #fff; }
.stepper li.done { color: var(--xyra-text); border-bottom-color: var(--xyra-green); }
.stepper li.done span { background: var(--xyra-green); border-color: transparent; color: #04210f; }

.calc-step { border: 0; margin: 0; padding: 0; min-width: 0; animation: stepin .35s ease; }
.calc-step[hidden] { display: none; }
@keyframes stepin { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.calc-step legend { padding: 0; margin-bottom: 18px; font-size: 1.3rem; font-weight: 800; color: var(--xyra-text); }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.calc .field { margin-bottom: 18px; }
.calc .field label { color: #c4c4dc; }
.calc .input { padding: 14px 16px; border-radius: 12px; background: #0c0c1a; font-size: 1rem; }
.calc select.input {
  appearance: none; cursor: pointer; padding-right: 44px;
  background: #0c0c1a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239a9ab8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 14px center / 22px;
}
.calc select.input option, .calc select.input optgroup { background: #16162a; color: var(--xyra-text); }

.ifield { position: relative; }
.ifield svg { position: absolute; left: 15px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); fill: var(--xyra-muted); pointer-events: none; transition: fill .15s; }
.ifield .input { padding-left: 46px; }
.ifield:focus-within svg { fill: var(--xyra-accent); }
.affix { position: relative; }
.affix .cur {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%); min-width: 50px; padding: 6px 8px;
  border-radius: 8px; text-align: center; font-size: .78rem; font-weight: 800; letter-spacing: .5px;
  color: var(--xyra-gold); background: rgba(245,183,0,.1); border: 1px solid rgba(245,183,0,.25); pointer-events: none;
}
.affix .input { padding-left: 70px; font-weight: 700; }
.aed-hint { margin-top: 6px; font-size: .8rem; font-weight: 600; color: var(--xyra-accent); }
.aed-hint:empty { display: none; }

.calc-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.calc-nav .btn { padding: 14px 26px; font-size: 1rem; }

/* Snapshot */
.stat-hero {
  padding: 24px; border-radius: 16px; margin: 12px 0 16px;
  background: linear-gradient(135deg, rgba(109,40,217,.28), rgba(6,182,212,.12));
  border: 1px solid rgba(139,92,246,.35);
}
.stat-label { font-size: .74rem; font-weight: 700; letter-spacing: .5px; color: var(--xyra-muted); text-transform: uppercase; }
.stat-big { font-size: clamp(2.1rem, 5vw, 3.1rem); font-weight: 900; line-height: 1.1; margin-top: 4px; color: var(--xyra-green); }
.stat-big.neg { color: var(--xyra-red); }
.stat-alt { font-size: .92rem; font-weight: 600; color: var(--xyra-muted); margin-top: 2px; }
.stat-alt:empty { display: none; }
.margin-meter { height: 10px; margin-top: 16px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.margin-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--xyra-accent), var(--xyra-green)); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.margin-fill.neg { background: linear-gradient(90deg, var(--xyra-pink), var(--xyra-red)); }
.stat-sub { margin-top: 10px; font-size: .9rem; color: var(--xyra-muted); }
.stat-sub strong { color: var(--xyra-text); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { padding: 16px; border-radius: 14px; background: #0c0c1a; border: 1px solid var(--xyra-border); min-width: 0; }
.stat-val { font-size: 1.15rem; font-weight: 800; margin-top: 6px; overflow-wrap: anywhere; }
.stat.highlight { border-color: var(--xyra-gold); background: rgba(245,183,0,.08); }
.stat.highlight .stat-val { color: var(--xyra-gold); }
.calc .toast-note:empty { display: none; }

/* Health check (step 2): sliders on the left, live score panel on the right */
.calc [hidden] { display: none !important; }
.calc-shell.wide { grid-template-columns: 1fr; }
.calc-shell.wide .calc-aside { display: none; }
.hc-intro { margin: -6px 0 22px; color: var(--xyra-muted); font-size: .95rem; max-width: 620px; }
.hc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 36px; align-items: start; }
.hc-group { margin-bottom: 26px; }
.hc-q { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 10px; font-weight: 600; color: var(--xyra-text); }
.hc-q label { cursor: pointer; }
.hc-val { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.hc-val .cur {
  padding: 3px 7px; border-radius: 6px; font-size: .72rem; font-weight: 800; letter-spacing: .5px;
  color: var(--xyra-gold); background: rgba(245,183,0,.1); border: 1px solid rgba(245,183,0,.25);
}
.hc-val .unit { color: var(--xyra-muted); font-size: .9rem; font-weight: 600; }
.hc-val .val {
  width: 9ch; padding: 4px 2px; text-align: right; font-family: inherit; font-weight: 800; font-size: 1.2rem; line-height: 1.2; color: var(--xyra-text);
  background: transparent; border: 0; border-bottom: 1.5px dashed var(--xyra-border); border-radius: 0; outline: none;
}
.hc-val .val:focus { border-bottom: 1.5px solid var(--xyra-accent); }
.hc-group .aed-hint { margin-top: 2px; text-align: right; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label {
  padding: 8px 15px; font-size: .9rem; font-weight: 600; cursor: pointer; border-radius: 999px;
  color: #c4c4dc; background: #0c0c1a; border: 1.5px solid var(--xyra-border);
  transition: background .15s, border-color .15s, color .15s;
}
.chips label:hover { border-color: var(--xyra-primary); }
.chips input:checked + label { background: var(--grad); border-color: transparent; color: #fff; }
.chips input:focus-visible + label { outline: 3px solid var(--xyra-gold); outline-offset: 3px; }

.calc input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; margin: 0; background: transparent; cursor: pointer; --p: 50%; }
.calc input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: linear-gradient(to right, var(--xyra-accent), var(--xyra-primary) var(--p), #26263f var(--p)); }
.calc input[type=range]::-moz-range-track { height: 8px; border-radius: 8px; background: #26263f; }
.calc input[type=range]::-moz-range-progress { height: 8px; border-radius: 8px; background: linear-gradient(to right, var(--xyra-accent), var(--xyra-primary)); }
.calc input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%;
  background: #fff; border: 4px solid var(--xyra-primary); box-shadow: 0 0 0 5px rgba(109,40,217,.25), 0 4px 10px rgba(0,0,0,.4);
}
.calc input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 4px solid var(--xyra-primary); }
.calc input[type=range]:focus-visible { outline: 3px solid var(--xyra-gold); outline-offset: 4px; border-radius: 8px; }

.link-btn { display: block; margin: 0 0 8px; padding: 0; background: none; border: 0; cursor: pointer; font-family: inherit; font-weight: 600; font-size: .95rem; color: var(--xyra-accent); text-decoration: underline; text-underline-offset: 4px; }
.clear-btn { display: block; margin-top: 6px; padding: 0; background: none; border: 0; cursor: pointer; font-family: inherit; font-weight: 500; font-size: .9rem; color: var(--xyra-muted); text-decoration: underline; text-underline-offset: 4px; }
#extra { margin-top: 20px; }

.whatif { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--xyra-border); }
.whatif h2 { margin: 0 0 4px; font-size: 1.2rem; }
.whatif > p { margin: 0 0 14px; color: var(--xyra-muted); font-size: .9rem; }
.sc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.sc-t {
  padding: 10px 15px; border-radius: 12px; cursor: pointer; text-align: left; font-family: inherit; font-weight: 600; font-size: .92rem;
  color: var(--xyra-text); background: transparent; border: 1.5px dashed #4a4a6a; transition: background .15s, border-color .15s;
}
.sc-t:hover { border-color: var(--xyra-gold); }
.sc-t[aria-pressed=true] { background: var(--xyra-gold); border: 1.5px solid var(--xyra-gold); color: #211a00; }
.sc-c { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; color: var(--xyra-muted); }
.sc-c input {
  width: 7.5em; padding: 7px 8px; text-align: center; font-family: inherit; font-weight: 700; font-size: .95rem; color: var(--xyra-text);
  background: #0c0c1a; border: 1.5px solid var(--xyra-border); border-radius: 9px; outline: none;
}
.sc-c input:focus { border-color: var(--xyra-accent); }
.sc-c input.short { width: 4em; }
.sc-c .sep { margin-left: 8px; }
.st { width: 32px; height: 32px; padding: 0; border-radius: 50%; cursor: pointer; font-weight: 800; line-height: 1; color: var(--xyra-text); background: #0c0c1a; border: 1.5px solid var(--xyra-border); }
.st:hover { border-color: var(--xyra-accent); }

/* Live result panel */
.hc-panel {
  position: sticky; top: 20px; padding: 26px 24px 24px; border-radius: 22px; overflow: hidden;
  background:
    radial-gradient(320px 200px at 100% 0%, rgba(6,182,212,.22), transparent 70%),
    linear-gradient(160deg, #2c1873, #1a1748 60%, #12122a);
  border: 1px solid rgba(139,92,246,.35); box-shadow: var(--shadow);
}
.gauge { position: relative; width: 100%; max-width: 320px; margin: 0 auto; }
.gauge svg { display: block; width: 100%; height: auto; }
.gauge path:last-child { transition: stroke-dashoffset .5s cubic-bezier(.3,.9,.3,1), stroke .4s; }
.gauge .score { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; }
.gauge .score b { display: block; font-size: 4.2rem; font-weight: 900; line-height: 1; letter-spacing: -.03em; }
.gauge .score span { font-size: 1.02rem; font-weight: 700; }
.was { min-height: 1.5em; margin-top: 8px; text-align: center; font-size: .9rem; color: #b6b6d6; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 18px 0; overflow: hidden; border-radius: 14px; background: rgba(255,255,255,.14); }
.tile { padding: 14px 8px; text-align: center; background: #1c1850; }
.tile b { display: block; font-size: 1.15rem; font-weight: 800; white-space: nowrap; }
.tile span { display: block; margin-top: 2px; font-size: .76rem; line-height: 1.3; color: #b6b6d6; }
.insight { margin: 0 0 20px; min-height: 4.4em; font-size: 1rem; line-height: 1.45; }
.cta-note { margin: 0 0 14px; font-size: .86rem; color: #b6b6d6; }
.hc-error { margin: 10px 0 0; font-size: .86rem; font-weight: 600; color: #fca5a5; }
.final-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 12px; }
.final-grid .hc-panel { position: static; }
.final-grid .stat-hero { margin-top: 0; }
.final-grid .insight { margin: 16px 0 0; min-height: 0; }

/* Mobile: the live score follows the visitor down the sliders */
.score-pill {
  position: fixed; left: 16px; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: none; justify-content: space-between; align-items: center; padding: 10px 20px; border-radius: 999px;
  font-weight: 700; color: #fff; background: #1c1850; border: 1px solid rgba(139,92,246,.5); box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.score-pill b { font-size: 1.5rem; }
.score-pill i { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--xyra-green); }

@media (max-width: 900px) {
  .hc-grid, .final-grid { grid-template-columns: 1fr; }
  .hc-panel { position: static; }
  .score-pill { display: flex; }
  .score-pill[hidden] { display: none; }
  .calc { padding-bottom: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  .gauge path:last-child, .chips label { transition: none; }
}

@media (max-width: 960px) {
  .calc-shell { grid-template-columns: 1fr; }
  .calc-aside { padding: 28px 24px; border-right: 0; border-bottom: 1px solid var(--xyra-border); }
  .calc-benefits { grid-template-columns: repeat(3, 1fr); }
  .calc-benefits li { flex-direction: column; gap: 8px; }
  .calc-trust { display: none; }
}
@media (max-width: 640px) {
  .calc-main { padding: 24px 18px; }
  .calc-grid { grid-template-columns: 1fr; }
  .calc-benefits { grid-template-columns: 1fr; }
  .calc-benefits li { flex-direction: row; }
  .stepper li { font-size: 0; gap: 0; justify-content: center; }
  .stepper li span { font-size: .8rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .calc-nav .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .calc-step, .calc-shell { animation: none; }
}

/* =========================================================
   ADMIN
   ========================================================= */
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
@media (max-width: 820px) { .admin-shell { grid-template-columns: 1fr; } }

.sidebar {
  background: linear-gradient(180deg, #11111f, #0c0c17); border-right: 1px solid var(--xyra-border);
  padding: 22px 16px; position: sticky; top: 0; height: 100vh;
}
@media (max-width: 820px) { .sidebar { position: static; height: auto; } }
.sidebar .brand { margin-bottom: 26px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 11px;
  color: var(--xyra-muted); font-weight: 600; font-size: .95rem; text-decoration: none;
}
.nav a:hover { background: var(--xyra-card); color: var(--xyra-text); text-decoration: none; }
.nav a.active { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(79,70,229,.35); }
.sidebar .logout { margin-top: 18px; }

.admin-main { padding: 26px clamp(16px, 4vw, 38px); }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-head h1 { margin: 0; font-size: 1.6rem; }
.admin-head .sub { color: var(--xyra-muted); font-size: .9rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat { padding: 20px; }
.stat .n { font-size: 2rem; font-weight: 900; line-height: 1; }
.stat .l { color: var(--xyra-muted); font-size: .85rem; margin-top: 8px; }
.stat .n.accent { color: var(--xyra-accent); }
.stat .n.gold { color: var(--xyra-gold); }
.stat .n.green { color: var(--xyra-green); }

.panel { padding: 0; overflow: hidden; margin-bottom: 24px; }
.panel .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--xyra-border); flex-wrap: wrap; }
.panel .panel-head h2 { margin: 0; font-size: 1.1rem; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
table.data th, table.data td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--xyra-border); vertical-align: middle; }
table.data th { color: var(--xyra-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .6px; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: rgba(255,255,255,.02); }

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge.type { background: rgba(109,40,217,.2); color: #c9b6ff; }
.badge.pending { background: rgba(245,183,0,.16); color: var(--xyra-gold); }
.badge.approved { background: rgba(34,197,94,.16); color: #7ff0a8; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 5px; vertical-align: middle; border: 1px solid rgba(255,255,255,.2); }

.chip { font-size: .78rem; color: var(--xyra-muted); }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .input { width: auto; min-width: 200px; padding: 9px 12px; }
.toolbar select.input { min-width: 150px; }

.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 600; font-size: .9rem; }
.alert.ok { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.4); color: #9df0b8; }
.alert.err { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.4); color: #ffb4b4; }

/* Prize editor grid */
.prize-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; padding: 18px 20px; }
.prize-form .field { margin-bottom: 0; }
.prize-form .field.wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .prize-form { grid-template-columns: 1fr 1fr; } }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); padding: 34px 30px; }
.login-card h1 { margin: 6px 0 4px; font-size: 1.5rem; text-align: center; }
.login-card p.sub { text-align: center; color: var(--xyra-muted); margin: 0 0 22px; font-size: .9rem; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; padding: 16px 20px; }
.pagination a, .pagination span { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--xyra-border); font-size: .85rem; color: var(--xyra-text); }
.pagination .active span, .pagination span[aria-current] { background: var(--grad); border-color: transparent; }
.pagination a:hover { border-color: var(--xyra-accent); text-decoration: none; }

label.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .85rem; color: var(--xyra-muted); }
