:root {
  /* iPolish brand crimson — matches the Influencer portal's --brand tokens */
  --brand: hsl(350 73% 44%);
  --brand-deep: hsl(350 75% 28%);
  --brand-tint: hsl(350 73% 96%);
  --ink: hsl(222.2 84% 4.9%);
  --muted: hsl(215.4 16.3% 46.9%);
  --border: hsl(214.3 31.8% 91.4%);
  --paper: hsl(0 0% 98%);
  --radius: 0.5rem;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must win over element display rules below
   (e.g. .status uses display:flex, which would otherwise keep it — and its
   spinner — visible even while hidden). */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

/* Thin crimson bar at the very top — small but reads as "iPolish". */
.brand-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: linear-gradient(to right, var(--brand-deep), var(--brand), var(--brand-deep));
}

.card {
  width: min(560px, 92vw);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem 2.25rem;
  margin: 2rem 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.brand-header img {
  width: 208px;
  height: auto;
}

.brand-header .wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
h1 .accent { color: var(--brand); }

.tagline {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--muted);
}

.subtitle { margin: 0 0 1.5rem; color: var(--muted); text-align: center; }

.banner {
  background: var(--brand-tint);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--brand-deep);
}

.steps { padding-left: 1.4rem; margin: 0 0 1.75rem; }
.steps li { margin-bottom: 1rem; }
.steps li::marker { color: var(--brand); font-weight: 600; }
.steps h2 { margin: 0 0 0.2rem; font-size: 1.05rem; font-weight: 600; }
.steps p { margin: 0; color: var(--muted); }

.button-row { text-align: center; margin-bottom: 1.5rem; }

.update-btn {
  font: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: var(--radius);
  padding: 0.9rem 2.5rem;
  cursor: pointer;
  transition: background 0.15s;
}
.update-btn:hover { background: var(--brand-deep); }
.update-btn:focus-visible,
.trouble summary:focus-visible {
  outline: 3px solid var(--brand-deep);
  outline-offset: 2px;
}
.update-btn:active { background: var(--brand-deep); }

/* "Heads up" style callout, borrowed from the portal's admin shell. */
.trouble {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  background: #fff;
}
.trouble summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--brand);
}
.trouble ul { margin: 0.75rem 0 0; padding-left: 1.3rem; }
.trouble li { margin-bottom: 0.6rem; color: var(--muted); font-size: 0.925rem; }
.trouble li strong { color: var(--ink); }

/* --- check-and-flash UI --------------------------------------------------- */
.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  color: var(--ink);
  font-weight: 500;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid var(--brand-tint);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress {
  height: 12px;
  width: 100%;
  background: var(--brand-tint);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg,
    #ff004c, #ff8a00, #ffe600, #33d17a, #00b3ff, #7a5cff, #ff004c);
  background-size: 200% 100%;
  animation: rainbow-slide 1.2s linear infinite;
  transition: width 0.2s ease;
}
@keyframes rainbow-slide {
  from { background-position: 0 0; }
  to   { background-position: 200% 0; }
}

/* Celebration burst on completion. */
.fireworks {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.fireworks span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: firework-fly 1.2s ease-out forwards;
}
@keyframes firework-fly {
  0%   { transform: translate(0, 0) scale(1);   opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.3); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill { animation: none; }
  .fireworks { display: none; }
}

.refuse {
  border: 1px solid var(--brand);
  background: var(--brand-tint);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  color: var(--ink);
}
.refuse p { margin: 0 0 0.75rem; }
.refuse p:last-child { margin-bottom: 0; }

.override-row { display: flex; gap: 0.5rem; }
#override-input {
  flex: 1;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
#override-input:focus-visible { outline: 3px solid var(--brand-deep); outline-offset: 1px; }

.override-btn {
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: var(--radius);
  padding: 0.6rem 1.1rem;
  cursor: pointer;
}
.override-btn:hover { background: var(--brand-deep); }
.override-btn:focus-visible { outline: 3px solid var(--brand-deep); outline-offset: 2px; }

.override-error { color: var(--brand-deep); font-weight: 600; margin: 0.6rem 0 0; }

.update-btn:disabled { opacity: 0.55; cursor: default; }
