@font-face {
  font-family: "Speli Sans";
  src: url("assets/montserrat-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Speli Display";
  src: url("assets/Montserrat-ExtraBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:root {
  --ink: #17142f;
  --ink-soft: #5b5570;
  --violet: #6849f6;
  --violet-dark: #4b31c8;
  --rose: #ff9bb5;
  --sun: #ffc95c;
  --mist: #f0ecff;
  --paper: #f8f6ff;
  --white: #fff;
  --line: rgba(23, 20, 47, .12);
  --error: #c63d61;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: "Speli Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::selection { color: var(--ink); background: var(--rose); }
button, input, textarea { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }

.wizard-header {
  position: relative;
  z-index: 20;
  display: flex;
  height: 86px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { display: block; width: clamp(146px, 12.5vw, 190px); height: auto; }
.header-actions { display: flex; align-items: center; gap: 27px; }
.support-link { color: var(--ink); font-size: 13px; font-weight: 800; text-decoration-thickness: 1px; text-underline-offset: 5px; }

.wizard-shell { min-height: calc(100vh - 86px); }
.question-area {
  position: relative;
  min-height: calc(100vh - 86px);
  overflow: hidden;
  padding: 42px clamp(20px, 5vw, 76px) 64px;
  background:
    radial-gradient(ellipse 54% 48% at 96% 4%, rgba(255, 194, 223, .24), transparent 68%),
    radial-gradient(ellipse 55% 55% at 2% 100%, rgba(123, 91, 255, .11), transparent 72%),
    linear-gradient(180deg, #fbfaff 0%, #fff 65%);
}
#songBrief, .mobile-progress { position: relative; z-index: 1; width: min(1060px, 100%); margin-right: auto; margin-left: auto; }
.mobile-progress { display: block; margin-bottom: 44px; }
.mobile-progress-copy { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; color: #756e88; font-family: "Speli Display", "Speli Sans", Arial, sans-serif; font-size: 15px; font-weight: 800; }
.progress-tools { display: inline-flex; align-items: center; gap: 20px; }
.mobile-progress-copy b { color: var(--violet); }
.progress-bar { height: 6px; overflow: hidden; border-radius: 99px; background: #e9e4f8; }
.progress-bar span { display: block; width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--rose)); transition: width .35s ease; }
.reset-button { padding: 3px 0; border: 0; border-bottom: 1px solid rgba(23, 20, 47, .24); color: #817a96; background: transparent; font-size: 14px; font-weight: 700; cursor: pointer; }
.reset-button:hover { color: var(--violet); border-color: currentColor; }
.question-card { animation: cardIn .35s ease both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.question-number { margin-bottom: 15px; color: var(--violet); font-family: "Speli Display", "Speli Sans", Arial, sans-serif; font-size: 14px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.complete-label { color: #4e9a74; }
.question-card h2, .success-dialog h2 { max-width: 980px; margin: 0; font-family: "Speli Display", "Speli Sans", Arial, sans-serif; font-size: clamp(60px, 6.2vw, 88px); font-weight: 800; line-height: .97; letter-spacing: -.057em; }
.question-intro { max-width: 860px; margin: 22px 0 34px; color: var(--ink-soft); font-size: 22px; line-height: 1.55; }

.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.choice-card { position: relative; display: grid; min-height: 88px; grid-template-columns: 48px 1fr 24px; align-items: center; gap: 15px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.72); cursor: pointer; transition: border-color .2s ease, background-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.choice-card:hover { transform: translateY(-2px); border-color: rgba(104,73,246,.33); background: white; box-shadow: 0 9px 25px rgba(51,36,117,.08); }
.choice-card input, .voice-card input, .method-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; background: var(--mist); font-size: 22px; }
.choice-card b { font-size: 20px; line-height: 1.3; }
.choice-card i, .voice-card i, .method-card i { display: grid; width: 19px; height: 19px; place-items: center; border: 1.5px solid #bbb4cc; border-radius: 50%; }
.choice-card i::after, .voice-card i::after, .method-card i::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: white; transform: scale(0); transition: transform .15s ease; }
.choice-card:has(input:checked), .voice-card:has(input:checked), .method-card:has(input:checked) { border-color: var(--violet); background: #f2efff; box-shadow: 0 0 0 3px rgba(104,73,246,.08); }
.choice-card:has(input:checked) i, .voice-card:has(input:checked) i, .method-card:has(input:checked) i { border-color: var(--violet); background: var(--violet); }
.choice-card:has(input:checked) i::after, .voice-card:has(input:checked) i::after, .method-card:has(input:checked) i::after { transform: scale(1); }
.wide-choice { grid-column: 1 / -1; }
.accent-choice .choice-icon { color: white; background: var(--violet); }

.fields-stack { display: grid; gap: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 9px; }
.field label, .label-row label { font-size: 20px; font-weight: 800; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); outline: none; background: white; transition: border-color .2s ease, box-shadow .2s ease; }
.field input { height: 64px; padding: 0 19px; font-size: 18px; }
.field textarea { min-height: 150px; padding: 17px 19px; resize: vertical; font-size: 18px; line-height: 1.6; }
.field input:focus, .field textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(104,73,246,.09); }
.field input::placeholder, .field textarea::placeholder { color: #aaa4b8; }
.conditional-field { margin-top: 16px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.char-count, .optional-label, .field-hint { color: #918aa3; font-size: 14px; font-weight: 650; }
.textarea-field { gap: 8px; }
.compact-textarea { margin-top: 17px; }
.compact-textarea textarea { min-height: 90px; }
.prompt-notes { display: flex; flex-wrap: wrap; gap: 7px; margin: -8px 0 19px; }
.prompt-notes span { padding: 9px 13px; border-radius: 999px; color: #625a78; background: #ece8fb; font-size: 14px; font-weight: 700; }
.form-error { min-height: 22px; margin: 14px 0 0; color: var(--error); font-size: 16px; font-weight: 700; }

.genre-grid { grid-template-columns: repeat(4, 1fr); }
.genre-choice { min-height: 128px; grid-template-columns: 1fr 20px; align-content: center; }
.genre-choice .choice-icon { grid-column: 1 / -1; margin-bottom: 6px; }
.genre-choice b { align-self: center; }
.voice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.voice-card { position: relative; display: grid; min-height: 264px; grid-template-rows: 128px 1fr; padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.75); cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.voice-card:hover { transform: translateY(-3px); border-color: rgba(104,73,246,.4); box-shadow: 0 12px 30px rgba(47,33,105,.09); }
.voice-portrait { display: grid; place-items: center; border-radius: 16px; color: var(--ink); font-family: Georgia, serif; font-size: 36px; font-style: italic; }
.voice-female { background: linear-gradient(145deg, #ffd3df, #efdbff); }
.voice-male { background: linear-gradient(145deg, #d8e8ff, #c8c0ff); }
.voice-duet { background: linear-gradient(145deg, #ffd2df 0 48%, #cbd8ff 52% 100%); }
.voice-child { background: linear-gradient(145deg, #fff2b8, #d8f3ff); }
.voice-card > span:nth-of-type(2) { display: grid; align-content: end; gap: 7px; padding-top: 17px; }
.voice-card b { font-size: 20px; line-height: 1.25; }
.voice-card small { color: var(--ink-soft); font-size: 16px; line-height: 1.45; }
.voice-card i { position: absolute; top: 24px; right: 24px; background: rgba(255,255,255,.85); }

.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.method-card { position: relative; display: grid; min-height: 160px; grid-template-columns: 58px 1fr 21px; align-items: center; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.76); cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.method-card:hover { transform: translateY(-3px); border-color: rgba(104,73,246,.4); box-shadow: 0 12px 30px rgba(47,33,105,.09); }
.method-symbol { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 19px; color: white; background: var(--violet); font-family: Georgia, serif; font-size: 20px; }
.method-card:nth-child(2) .method-symbol { color: var(--ink); background: var(--rose); font-style: italic; }
.method-card > span:nth-of-type(2) { display: grid; gap: 8px; }
.method-card b { font-size: 20px; }
.method-card small { color: var(--ink-soft); font-size: 16px; line-height: 1.5; }

.wizard-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.back-button, .next-button { display: inline-flex; min-height: 58px; align-items: center; justify-content: center; gap: 9px; padding: 0 24px; border-radius: 999px; font: inherit; font-size: 17px; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease; }
.back-button { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.next-button { min-width: 180px; margin-left: auto; border: 0; color: white; background: var(--violet); box-shadow: 0 13px 28px rgba(104,73,246,.24); }
.back-button:hover, .next-button:hover { transform: translateY(-2px); }
.next-button:hover { background: var(--violet-dark); }
.next-button:disabled { cursor: wait; opacity: .72; transform: none; }
.next-button.loading svg { animation: buttonPulse .8s ease-in-out infinite alternate; }
@keyframes buttonPulse { to { transform: translateX(4px); opacity: .45; } }
.back-button svg, .next-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.choice-card:focus-within, .voice-card:focus-within, .method-card:focus-within { outline: 2px solid rgba(104, 73, 246, .2); outline-offset: 2px; }
.back-button:focus-visible, .next-button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid rgba(104, 73, 246, .32); outline-offset: 3px; }

.summary-list { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.82); }
.summary-item { display: grid; grid-template-columns: 180px 1fr auto; gap: 22px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.summary-item:last-child { border-bottom: 0; }
.summary-item > span { color: #8c849f; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.summary-item p { max-height: 124px; overflow: auto; margin: 0; font-size: 18px; font-weight: 650; line-height: 1.55; }
.summary-item button { align-self: start; padding: 0; border: 0; border-bottom: 1px solid currentColor; color: var(--violet); background: transparent; font-size: 15px; font-weight: 800; cursor: pointer; }

.success-dialog { width: min(520px, calc(100% - 28px)); padding: 38px; border: 0; border-radius: 28px; color: var(--ink); box-shadow: 0 30px 100px rgba(18,13,48,.35); }
.success-dialog::backdrop { background: rgba(18,14,45,.7); backdrop-filter: blur(6px); }
.success-dialog h2 { font-size: 42px; }
.success-dialog > p:not(.kicker) { color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.success-icon { display: grid; width: 56px; height: 56px; margin-bottom: 25px; place-items: center; border-radius: 19px; color: white; background: var(--violet); font-size: 24px; transform: rotate(-4deg); }
.dialog-close { position: absolute; top: 15px; right: 18px; border: 0; color: #8e879f; background: transparent; font-size: 27px; cursor: pointer; }
.dialog-actions { display: grid; gap: 10px; margin-top: 24px; }
.dialog-actions .next-button, .dialog-actions .back-button { width: 100%; }

@media (max-width: 1020px) {
  .question-area { padding: 36px 28px 56px; }
  .genre-grid { grid-template-columns: repeat(2, 1fr); }
  .voice-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .wizard-header { height: 68px; padding: 0 15px; }
  .brand img { width: 132px; }
  .support-link { font-size: 11px; }
  .wizard-shell { min-height: calc(100vh - 68px); }
  .question-area { min-height: calc(100vh - 68px); padding: 18px 14px 28px; }
  #songBrief { width: 100%; }
  .mobile-progress { width: 100%; margin: 0 auto 30px; }
  .mobile-progress-copy { margin-bottom: 9px; font-size: 14px; }
  .progress-tools { gap: 12px; }
  .question-number { margin-bottom: 12px; }
  .question-card h2 { font-size: clamp(48px, 13.2vw, 62px); line-height: .96; letter-spacing: -.055em; }
  .question-intro { margin: 18px 0 28px; font-size: 20px; line-height: 1.5; }
  .option-grid, .field-row, .voice-grid, .method-grid { grid-template-columns: 1fr; }
  .wide-choice { grid-column: auto; }
  .choice-card { min-height: 82px; }
  .genre-grid { grid-template-columns: repeat(2, 1fr); }
  .genre-choice {
    min-width: 0;
    min-height: 112px;
    grid-template-columns: minmax(0, 1fr) 18px;
    gap: 8px;
    padding: 12px;
  }
  .genre-choice .choice-icon { width: 42px; height: 42px; margin-bottom: 3px; font-size: 20px; }
  .genre-choice b { min-width: 0; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
  .genre-choice i { width: 18px; height: 18px; }
  .voice-card { min-height: 128px; grid-template-columns: 80px minmax(0, 1fr); grid-template-rows: 1fr; column-gap: 18px; padding: 16px; }
  .voice-portrait { min-height: 92px; }
  .voice-card > span:nth-of-type(2) { align-content: center; padding: 0; }
  .voice-card b { padding-right: 30px; font-size: 20px; }
  .voice-card small { padding-right: 8px; font-size: 16px; }
  .voice-card i { top: 16px; right: 16px; }
  .method-card { min-height: 126px; }
  .prompt-notes { display: grid; grid-template-columns: 1fr 1fr; }
  .prompt-notes span { border-radius: 10px; text-align: center; }
  .field textarea { min-height: 170px; }
  .field input, .field textarea { font-size: 18px; }
  .compact-textarea textarea { min-height: 100px; }
  .wizard-actions { position: sticky; z-index: 10; bottom: 0; margin: 24px -14px -28px; padding: 13px 14px 15px; border-top: 1px solid var(--line); background: rgba(248,246,255,.94); backdrop-filter: blur(15px); }
  .back-button { min-width: 104px; padding: 0 15px; }
  .next-button { min-width: 0; flex: 1; }
  .summary-item { grid-template-columns: 1fr; gap: 8px; padding: 19px 17px; }
  .summary-item > span { font-size: 12px; }
  .summary-item p { max-height: 160px; font-size: 18px; }
  .summary-item button { grid-column: 1; justify-self: start; }
  .success-dialog { padding: 32px 23px 24px; }
  .success-dialog h2 { font-size: 38px; }
}

@media (max-width: 340px) {
  .genre-grid { grid-template-columns: 1fr; }
  .genre-choice { min-height: 94px; }
}

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