:root {
  --brief-ink: #172044;
  --brief-muted: #66708a;
  --brief-indigo: #5b5ce2;
  --brief-violet: #a45cf2;
  --brief-line: rgba(91, 92, 226, 0.14);
  --brief-shadow: 0 22px 60px rgba(70, 73, 155, 0.14);
  --brief-field-radius: 20px;
  --brief-button-radius: 100px;
  --brief-section-space: clamp(2rem, 4vw, 2.75rem);
  --brief-action-space: clamp(2rem, 4vw, 3rem);
}

body {
  background: #f6f7ff;
}

/* The animation canvas must paint the whole browser width; its inner content
   remains constrained by the React layout. */
#root {
  max-width: none !important;
}

.animated-bg.brief-canvas {
  isolation: isolate;
  background:
    radial-gradient(circle at 8% 16%, rgba(155, 111, 245, 0.18), transparent 24rem),
    radial-gradient(circle at 92% 80%, rgba(93, 190, 255, 0.16), transparent 30rem),
    linear-gradient(135deg, #fbfbff 0%, #f4f5ff 55%, #fbfaff 100%) !important;
}

.animated-bg.brief-canvas::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.52;
  background-image:
    linear-gradient(rgba(91, 92, 226, 0.042) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 92, 226, 0.042) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
}

.animated-bg.brief-canvas::after {
  content: "";
  position: fixed;
  width: 30rem;
  height: 30rem;
  right: -16rem;
  top: -15rem;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(135, 100, 242, 0.24), rgba(135, 100, 242, 0) 68%);
  filter: blur(8px);
  animation: brief-aura 13s ease-in-out infinite alternate;
}

.brief-canvas .circles {
  z-index: -1;
  opacity: 0.7;
}

.brief-canvas .circles li {
  filter: blur(1px);
  animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1) !important;
}

.brief-canvas header {
  position: sticky !important;
  top: 10px;
  z-index: 20;
  min-height: 54px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(250, 250, 255, 0.72);
  box-shadow: 0 12px 28px rgba(70, 73, 155, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brief-canvas .brief-progress {
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(91, 92, 226, 0.055);
}

.brief-canvas .brief-progress > div {
  box-shadow: 0 0 0 1px rgba(91, 92, 226, 0.05);
}

.brief-canvas .brief-form-heading {
  letter-spacing: -0.045em !important;
  text-wrap: balance;
  margin-bottom: 0.7rem !important;
}

.brief-canvas .brief-form-heading + p {
  max-width: 42rem;
  margin: 0 auto var(--brief-section-space) !important;
  line-height: 1.55;
}

.brief-canvas button {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease !important;
}

.brief-canvas button:focus-visible,
.brief-canvas input:focus-visible,
.brief-canvas textarea:focus-visible {
  outline: 3px solid rgba(164, 92, 242, 0.34) !important;
  outline-offset: 3px;
}

.brief-canvas .brief-choice {
  position: relative;
  min-height: 174px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 1rem !important;
  border: 1px solid rgba(91, 92, 226, 0.14) !important;
  box-shadow: 0 14px 35px rgba(71, 77, 157, 0.1);
}

.brief-canvas .brief-choice::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.65), transparent 35%),
    linear-gradient(135deg, #5b5ce2, #9a5be9 62%, #c260e8);
  transition: opacity 220ms ease;
}

.brief-canvas .brief-choice::after {
  content: attr(data-brief-hint);
  position: absolute;
  top: 15px;
  right: 17px;
  padding: 5px 9px;
  border: 1px solid rgba(91, 92, 226, 0.12);
  border-radius: 999px;
  color: #69728c;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: color 220ms ease, background 220ms ease, border-color 220ms ease;
}

.brief-canvas .brief-choice > * {
  position: relative;
  z-index: 1;
}

.brief-canvas .brief-choice:hover {
  transform: translateY(-7px) rotate(-0.35deg) !important;
  box-shadow: 0 26px 50px rgba(80, 73, 183, 0.22) !important;
}

.brief-canvas .brief-choice:hover::before,
.brief-canvas .brief-choice[data-brief-choice="detailed"]::before {
  opacity: 1;
}

.brief-canvas .brief-choice:hover h3,
.brief-canvas .brief-choice:hover p,
.brief-canvas .brief-choice[data-brief-choice="detailed"] h3,
.brief-canvas .brief-choice[data-brief-choice="detailed"] p {
  color: #fff !important;
}

.brief-canvas .brief-choice:hover::after,
.brief-canvas .brief-choice[data-brief-choice="detailed"]::after {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.16);
}

.brief-canvas .brief-primary {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.36) !important;
  background: linear-gradient(110deg, #5a5ce4, #8b5ce8 53%, #b55ae8) !important;
  box-shadow: 0 16px 28px rgba(91, 92, 226, 0.27) !important;
}

.brief-canvas .brief-primary::after {
  content: "";
  position: absolute;
  top: -80%;
  left: -30%;
  width: 22%;
  height: 260%;
  pointer-events: none;
  transform: rotate(22deg);
  background: rgba(255, 255, 255, 0.26);
  animation: brief-shine 4.8s ease-in-out infinite;
}

.brief-canvas .brief-primary:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 22px 34px rgba(91, 92, 226, 0.35) !important;
}

.brief-canvas .brief-select-card,
.brief-canvas .brief-option-card {
  border-color: rgba(91, 92, 226, 0.1) !important;
  box-shadow: 0 8px 20px rgba(72, 78, 154, 0.035);
}

.brief-canvas .brief-site-type-card {
  border-radius: 1rem !important;
}

.brief-canvas .brief-select-card:hover,
.brief-canvas .brief-option-card:hover {
  transform: translateY(-3px) !important;
  border-color: rgba(91, 92, 226, 0.42) !important;
  box-shadow: 0 17px 30px rgba(72, 78, 154, 0.12) !important;
}

.brief-canvas .brief-option-card {
  overflow: hidden;
}

.brief-canvas .brief-field {
  border-radius: var(--brief-field-radius) !important;
  border-color: rgba(91, 92, 226, 0.13) !important;
  box-shadow: 0 8px 22px rgba(72, 78, 154, 0.035);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease !important;
}

/* Text entry keeps one gentle radius throughout the brief. Cards and controls
   deliberately use a different radius, so the interface is easier to scan. */
.brief-canvas :is(input, textarea) {
  border-radius: var(--brief-field-radius) !important;
}

.brief-canvas button:not(.brief-choice):not(.brief-option-card) {
  border-radius: var(--brief-button-radius) !important;
}

/* The original form used several almost-identical vertical margins (20–64px).
   Normalizing action spacing makes every step feel like one flow. */
.brief-canvas div[style*="text-align: center"][style*="margin-top"] {
  margin-top: var(--brief-action-space) !important;
}

.brief-canvas button[style*="margin-top"] {
  margin-top: var(--brief-action-space) !important;
}

.brief-canvas .brief-field:hover {
  border-color: rgba(91, 92, 226, 0.3) !important;
}

.brief-canvas .brief-field:focus {
  border-color: #6c5eea !important;
  box-shadow: 0 0 0 4px rgba(108, 94, 234, 0.12), 0 14px 28px rgba(72, 78, 154, 0.07) !important;
}

/* Examples stay clearly distinguishable from answers already entered. */
.brief-canvas input::placeholder,
.brief-canvas textarea::placeholder {
  color: rgba(80, 93, 122, 0.42) !important;
  -webkit-text-fill-color: rgba(80, 93, 122, 0.42) !important;
  opacity: 1 !important;
}

@keyframes brief-aura {
  0% { transform: translate3d(0, 0, 0) scale(0.95); }
  100% { transform: translate3d(-8rem, 8rem, 0) scale(1.18); }
}

@keyframes brief-shine {
  0%, 59% { transform: translateX(-320%) rotate(22deg); }
  77%, 100% { transform: translateX(810%) rotate(22deg); }
}

@media (max-width: 640px) {
  .animated-bg.brief-canvas {
    padding: 14px 12px !important;
  }

  .brief-canvas header {
    top: 4px;
    min-height: 48px;
    padding: 5px 8px;
    border-radius: 15px;
  }

  .brief-canvas .brief-choice {
    min-height: 146px;
  }

  .brief-canvas .brief-choice:hover {
    transform: translateY(-3px) !important;
  }

  .brief-canvas .brief-primary {
    min-width: min(100%, 18rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
