:root {
  --bg: #f6fbfa;
  --ink: #0f3b39;
  --muted: #5b7d7b;
  --card: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.9);
  --track: #e1efed;
  --grad-a: #f59e0b; /* warm sunrise  */
  --grad-b: #10b981; /* hopeful green */
  --grad-c: #0ea5a4; /* fresh teal    */
  --ring-from: #10b981;
  --ring-to: #0ea5a4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07211f;
    --ink: #ecfdf6;
    --muted: #9fc9c2;
    --card: rgba(13, 49, 46, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --track: #16403c;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

/* Soft animated aurora background ------------------------------------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  filter: blur(60px);
}

.blob {
  position: absolute;
  width: 42vmax;
  height: 42vmax;
  border-radius: 50%;
  opacity: 0.55;
  mix-blend-mode: multiply;
  animation: drift 18s ease-in-out infinite;
}

@media (prefers-color-scheme: dark) {
  .blob {
    mix-blend-mode: screen;
    opacity: 0.4;
  }
}

.blob-1 {
  background: var(--grad-a);
  top: -12vmax;
  left: -8vmax;
}
.blob-2 {
  background: var(--grad-b);
  bottom: -14vmax;
  right: -6vmax;
  animation-delay: -6s;
}
.blob-3 {
  background: var(--grad-c);
  top: 30%;
  left: 45%;
  animation-delay: -12s;
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(6vmax, -4vmax) scale(1.1);
  }
  66% {
    transform: translate(-5vmax, 5vmax) scale(0.95);
  }
}

/* Glass card ---------------------------------------------------------- */
.card {
  width: 100%;
  max-width: 460px;
  padding: clamp(1.75rem, 5vw, 2.75rem);
  text-align: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 20px 60px rgba(7, 59, 56, 0.18);
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
  min-width: 0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--grad-a), var(--grad-c));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.slogan {
  display: inline-block;
  text-align: left;
  max-width: 100%;
  overflow-wrap: break-word;
  margin: 0 0 1.5rem;
  font-size: clamp(1.15rem, 3.6vw, 1.5rem);
  font-weight: 700;
  line-height: 1.35;
}

/* Progress dial ------------------------------------------------------- */
.dial {
  position: relative;
  width: min(65vw, 210px);
  aspect-ratio: 1;
  margin: 0 auto 1rem;
}

.ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

/* Threshold marks on the ring (NOT rotated) --------------------------- */
.ring-marks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mark {
  stroke-width: 3.5;
  stroke-linecap: round;
}

.mark-submit {
  stroke: var(--grad-a);
}

.mark-pass {
  stroke: var(--ink);
  opacity: 0.6;
}

.ring-track {
  fill: none;
  stroke: var(--track);
  stroke-width: 16;
}

.ring-fill {
  fill: none;
  stroke: url(#hope-gradient);
  stroke-width: 16;
  stroke-linecap: round;
  stroke-dasharray: 540.4;
  stroke-dashoffset: 540.4;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.dial-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}

.percent {
  font-size: clamp(1.7rem, 9vw, 2.6rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--grad-b), var(--grad-c));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow: hidden;
}

.percent-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

/* Legend (progi) ------------------------------------------------------ */
.legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  margin: 0 0 1rem;
  text-align: left;
}

.legend-row {
  position: relative;
  padding-left: calc(12px + 0.55rem);
  font-size: clamp(0.82rem, 2.6vw, 0.95rem);
  color: var(--muted);
  transition: color 0.3s ease;
  overflow-wrap: break-word;
}

.legend-dot {
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-submit {
  background: var(--grad-a);
}

.dot-pass {
  background: var(--grad-c);
}

.legend-text {
  overflow-wrap: break-word;
}

.legend-text strong {
  font-weight: 800;
  color: var(--ink);
}

/* Stan „osiągnięty” — gdy poparcie przekroczy dany próg */
.legend-row.met {
  color: var(--ink);
}

.legend-row.met .legend-dot::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  font-size: 9px;
  font-weight: 900;
  color: #fff;
}

.updated {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .blob,
  .card {
    animation: none;
  }
  .ring-fill {
    transition: none;
  }
}
