/* ============================================================
   form.css — página pública (index.html)
   ============================================================ */

/* ---------- Abertura ---------- */
.loader {
  position: fixed; inset: 0; z-index: var(--z-loader);
  background: var(--ink); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  transition: opacity .5s, visibility .5s;
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader__brand { display: flex; align-items: center; gap: 12px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.loader__brand .eq { height: 28px; }
.loader__brand .eq i { width: 4px; }
.loader__bar { width: 180px; height: 4px; border-radius: 4px; background: var(--ink-3); overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; animation: load 1.4s ease forwards; }
@keyframes load { to { width: 100%; } }

/* ---------- Topo fixo ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-topbar);
  background: var(--ink); color: #fff;
}
.topbar__inner {
  max-width: 860px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 18px;
}
.progress { flex: 1; display: flex; gap: 6px; min-width: 0; }
.progress__seg { flex: 1; height: 5px; border-radius: 5px; background: var(--ink-3); transition: background var(--t-base); }
.progress__seg.is-done, .progress__seg.is-active { background: var(--accent); }
.progress__label { font-size: 12.5px; font-weight: 600; color: var(--on-dark); white-space: nowrap; }

/* ---------- Apresentação ---------- */
.hero { max-width: 700px; margin: 0 auto; padding: 104px 20px 6px; text-align: center; }
.hero__title { font-size: clamp(28px, 5vw, 38px); font-weight: 800; margin: 6px 0 12px; }
.hero__text { color: var(--muted); max-width: 580px; margin: 0 auto; }

/* ---------- Etapas ---------- */
.main { max-width: 860px; margin: 0 auto; padding: 28px 20px 150px; }
.step { animation: step-in .4s var(--ease) both; }
.step.is-back { animation-name: step-in-back; }
.step.hidden { display: none !important; }
@keyframes step-in      { from { opacity: 0; transform: translateX(28px); }  to { opacity: 1; transform: none; } }
@keyframes step-in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

.step__card { padding: 38px 40px; }
.step__header { margin-bottom: 28px; }
.step__title { font-size: 28px; font-weight: 800; margin: 4px 0 6px; }
.step__desc { color: var(--muted); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
.form-grid--nested { padding: 0; }
.span-2 { grid-column: 1 / -1; }

.section-title {
  font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-text); padding-bottom: 9px; border-bottom: 1.5px solid var(--accent-soft);
  margin-top: 10px;
}
.section-title:first-child { margin-top: 0; }

.note {
  font-size: 13.5px; color: var(--muted); line-height: 1.5;
  background: #FAF8F3; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 14px;
}

/* Campo que aparece só quando necessário (ex.: descrição das promoções) */
.reveal { display: none; }
.reveal.is-open { display: flex; animation: reveal .3s var(--ease) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Gêneros musicais ---------- */
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.genre {
  position: relative; display: flex; flex-direction: column;
  padding: 18px 18px 16px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--card);
  cursor: pointer; user-select: none;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.genre:hover { border-color: var(--accent); transform: translateY(-2px); }
.genre.is-selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-ring); }
.genre input[type="checkbox"] { display: none; }
.genre__check {
  position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line-strong); background: var(--card); color: transparent; font-size: 13px; font-weight: 800;
  transition: all var(--t-fast);
}
.genre.is-selected .genre__check { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.genre__icon { font-size: 30px; line-height: 1; margin-bottom: 12px; }
.genre__name { font-weight: 800; font-size: 15px; margin-bottom: 3px; }
.genre__desc { font-size: 13px; color: var(--muted); line-height: 1.45; margin-bottom: 14px; flex: 1; }
.genre__preview {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 12px; margin-left: -2px;
  border: 1.5px solid var(--line); border-radius: var(--r-pill); background: var(--card);
  color: var(--accent-text); font-weight: 700; font-size: 13px;
  transition: all var(--t-fast);
}
.genre__preview:hover { border-color: var(--accent); background: var(--accent-soft); }
.genre__playing {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 12px; font-weight: 800; color: var(--accent-text);
}
.genre__playing .eq { height: 12px; }
.genre__playing .eq i { width: 2px; }

/* ---------- Revisão (dentro da Etapa 3) ---------- */
.review { border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--card); }
.review > summary {
  cursor: pointer; list-style: none; padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-weight: 700; color: var(--accent-text);
}
.review > summary::-webkit-details-marker { display: none; }
.review > summary::after {
  content: ''; width: 9px; height: 9px; flex-shrink: 0;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform var(--t-fast);
}
.review[open] > summary { border-bottom: 1.5px solid var(--line); }
.review[open] > summary::after { transform: rotate(-135deg); }
.review__body { display: grid; gap: 14px; padding: 18px; }

.review-block { position: relative; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px 18px; background: #FDFCFA; }
.review-block__title { font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.review-row { display: flex; gap: 10px; font-size: 14px; margin-bottom: 5px; }
.review-row:last-of-type { margin-bottom: 0; }
.review-row dt { font-weight: 700; min-width: 150px; flex-shrink: 0; }
.review-row dd { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.review-edit {
  position: absolute; top: 12px; right: 12px; min-height: 32px; padding: 0 12px;
  border: none; border-radius: 8px; background: transparent; color: var(--accent-text); font-weight: 700; font-size: 13px;
}
.review-edit:hover { background: var(--accent-soft); }

/* ---------- Barra de ações ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bar);
  background: rgba(244, 241, 234, .92); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
}
.actionbar__inner { max-width: 860px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.actionbar .btn--primary { margin-left: auto; min-width: 150px; }

/* ---------- Player de prévias ---------- */
.player {
  position: fixed; right: 24px; bottom: 92px; z-index: var(--z-player);
  width: 360px; max-width: calc(100vw - 24px); padding: 16px;
  background: var(--ink); color: #fff; border-radius: 20px; box-shadow: var(--shadow-float);
  animation: player-in .3s var(--ease) both;
}
.player.hidden { display: none !important; }
@keyframes player-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

.player__close {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border: none; border-radius: 50%;
  background: var(--ink-3); color: #fff; display: flex; align-items: center; justify-content: center;
}
.player__close:hover { background: var(--accent-strong); }
.player__top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-right: 30px; }
.player__art {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 14px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, var(--accent-strong), #7A2A12);
  display: flex; align-items: center; justify-content: center;
}
.player__note { font-size: 24px; }
.player__cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player__cover.hidden, .player__note.hidden { display: none !important; }
.player__info { min-width: 0; display: flex; flex-direction: column; }
.player__track { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player__artist { font-size: 13px; color: var(--on-dark); }

.player__controls { display: flex; align-items: center; gap: 10px; }
.player__btn {
  width: 40px; height: 40px; flex-shrink: 0; border: none; border-radius: 50%;
  background: var(--accent-strong); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), transform var(--t-fast);
}
.player__btn:hover { background: var(--accent); transform: scale(1.06); }
.player__btn--sm { width: 30px; height: 30px; background: var(--ink-3); }
.player__btn--sm:hover { background: var(--ink-2); }
.player__btn.hidden, .player__btn .hidden { display: none !important; }
.player__progress { flex: 1; min-width: 0; }
.player__track-bar { height: 5px; border-radius: 5px; background: var(--ink-3); overflow: hidden; cursor: pointer; margin-bottom: 5px; }
.player__fill { height: 100%; width: 0; background: var(--accent); border-radius: 5px; pointer-events: none; transition: width .2s linear; }
.player__times { display: flex; justify-content: space-between; font-size: 11px; color: var(--on-dark); }
.player__volume { display: flex; align-items: center; gap: 6px; color: var(--on-dark); }
.player__volume input { width: 56px; accent-color: var(--accent); cursor: pointer; }
.player__unavailable { margin-top: 10px; text-align: center; font-size: 13px; color: var(--on-dark); font-style: italic; }
.player__unavailable.hidden { display: none !important; }

/* ---------- Sucesso e confete ---------- */
.success { position: fixed; inset: 0; z-index: var(--z-success); background: var(--paper); display: flex; align-items: center; justify-content: center; animation: step-in .4s var(--ease) both; }
.success.hidden { display: none !important; }
.success__inner { max-width: 440px; padding: 28px; text-align: center; position: relative; }
.success__icon { display: flex; justify-content: center; margin-bottom: 22px; }
.success__icon svg { animation: pop .7s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes pop { from { transform: scale(0) rotate(-10deg); } to { transform: none; } }
.success__title { font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.success__text { color: var(--muted); margin-bottom: 30px; }

.confetti { position: fixed; top: -10px; opacity: 0; pointer-events: none; z-index: calc(var(--z-success) + 1); animation: confetti-fall linear forwards; }
@keyframes confetti-fall { 0% { transform: translateY(-10px) rotate(0); opacity: 1; } 100% { transform: translateY(105vh) rotate(720deg); opacity: 0; } }

/* ---------- Telas pequenas ---------- */
@media (max-width: 680px) {
  .topbar__inner { padding: 12px 16px; gap: 12px; }
  .brand__name { display: none; }
  .hero { padding-top: 88px; }
  .main { padding: 22px 14px 150px; }
  .step__card { padding: 24px 18px; }
  .step__title { font-size: 24px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .genre { padding: 14px; }
  .player { right: 12px; left: 12px; width: auto; max-width: none; bottom: 88px; }
  .review-row { flex-direction: column; gap: 0; }
  .review-row dt { min-width: 0; }
  .review-edit { position: static; margin: 10px 0 0 -12px; }
}
@media (max-width: 400px) {
  .genre-grid { grid-template-columns: minmax(0, 1fr); }
}
