/* ==========================================================
   Projeto musical | Marcelo Sissá — briefing
   Niky Gonzaga
   ========================================================== */

:root {
  --ivory: #F5F1EB;
  --ink: #292524;        /* grafite: títulos e texto */
  --ink-soft: #5A524D;   /* dicas e textos de apoio */
  --tomato: #C94F3D;     /* SOMENTE: setas de Começar/Continuar e barra de progresso */
  --line: rgba(41, 37, 36, 0.14);
  --line-strong: rgba(41, 37, 36, 0.30);
  --error: var(--ink);   /* erros em grafite, identificados pelo texto e pelo ícone */

  --font: "EB Garamond", Garamond, "Times New Roman", serif;   /* única família da página */

  /* Vidro fosco dos campos */
  --glass-bg: rgba(255, 255, 255, 0.58);
  --glass-bg-focus: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(41, 37, 36, 0.17);
  --glass-shine: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  --glass-drop: 0 1px 2px rgba(41, 37, 36, 0.04), 0 8px 20px -14px rgba(41, 37, 36, 0.28);
  --radius: 12px;

  --gutter: 22px;
  --measure: 34rem;

  --cover-ink: #F4F0E9;
  --cover-bg: #141414;
  --cover-focus: 50% 36%;   /* CAPA: ponto de foco no celular (horizontal vertical) */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;        /* 18px */
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* marfim com luz bem suave, para o vidro dos campos ter o que desfocar */
  background:
    radial-gradient(90% 40% at 0% 18%, rgba(255, 253, 248, 0.9), transparent 70%),
    radial-gradient(80% 40% at 100% 62%, rgba(232, 225, 214, 0.7), transparent 70%),
    var(--ivory);
  background-attachment: fixed;
}

img { display: block; max-width: 100%; }

input, button, textarea, select { font-family: inherit; }

[hidden] { display: none !important; }

/* ---------- CAPA ----------
   Celular: a arte preenche a tela (recorte só nas laterais), com foco em --cover-focus.
   Telas mais largas que a arte: a arte aparece inteira no centro, sobre uma versão
   desfocada dela mesma, para não cortar o nome nem o subtítulo. */
.cover {
  position: relative;
  height: 92vh;
  height: 92svh;
  min-height: 540px;
  overflow: hidden;
  isolation: isolate;
  background: var(--cover-bg);
}

.cover__title { position: absolute; inset: 0; margin: 0; }
.cover__title picture { display: block; height: 100%; }

.cover__art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--cover-focus);
}

.cover__backdrop { display: none; }

@media (min-aspect-ratio: 5/8) {
  .cover__backdrop {
    display: block;
    position: absolute;
    inset: -6%;
    z-index: -1;
  }
  .cover__backdrop picture, .cover__backdrop img { width: 100%; height: 100%; }
  .cover__backdrop img {
    object-fit: cover;
    filter: blur(40px) brightness(0.5);
  }
  .cover__art {
    object-fit: contain;
    object-position: 50% 50%;
    /* laterais esmaecidas para a arte se fundir ao fundo desfocado */
    -webkit-mask-image: linear-gradient(to right, transparent calc(50% - 25.5svh), #000 calc(50% - 16svh), #000 calc(50% + 16svh), transparent calc(50% + 25.5svh));
    mask-image: linear-gradient(to right, transparent calc(50% - 25.5svh), #000 calc(50% - 16svh), #000 calc(50% + 16svh), transparent calc(50% + 25.5svh));
  }
}

.cover__cta {
  position: absolute;
  left: 50%;
  bottom: calc(30px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 24px;
  white-space: nowrap;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cover-ink);
  border: 1px solid rgba(244, 240, 233, 0.55);
  border-radius: 999px;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s, border-color .25s;
}

.cover__cta:hover { background: rgba(244, 240, 233, 0.08); border-color: var(--cover-ink); }
.cover__cta:focus-visible { outline: 2px solid var(--cover-ink); outline-offset: 4px; }

/* Seta em vermelho-tomate (Começar briefing e Continuar) */
.arrow {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 10px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'><path d='M0 5h14.5M10.5 1l4 4-4 4' fill='none' stroke='%23C94F3D' stroke-width='1.4'/></svg>") center / contain no-repeat;
}
.arrow--down { transform: rotate(90deg); }

/* ---------- Página ---------- */
.page {
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.intro {
  margin: 6px 0 0;
  padding: 14px 0 28px;
  border-bottom: 1px solid var(--line);
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--ink);
}

/* ---------- Progresso ---------- */
.progress {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px var(--gutter) 14px;
  margin: 8px calc(-1 * var(--gutter)) 0;
  background: rgba(245, 241, 235, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.progress__label {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.progress__track { height: 1px; background: var(--line); }

.progress__bar {
  height: 2px;
  margin-top: -0.5px;
  width: 33.33%;
  background: var(--tomato);
  transition: width 0.5s cubic-bezier(.2,.7,.2,1);
}

/* ---------- Etapas ---------- */
.form { padding-bottom: 20px; }

.step { border: 0; margin: 0; padding: 0; min-width: 0; }

.step.is-entering { animation: stepIn 0.45s cubic-bezier(.2,.7,.2,1) both; }
.step.is-entering.from-back { animation-name: stepInBack; }

@keyframes stepIn {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes stepInBack {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: none; }
}

.step__title {
  display: block;
  width: 100%;
  padding: 26px 0 6px;
  font-weight: 500;
  font-size: 2.55rem;
  line-height: 1.08;
  letter-spacing: -0.005em;
  color: var(--ink);
  outline: none;
}

/* ---------- Perguntas ---------- */
.q { padding: 30px 0 32px; border-bottom: 1px solid var(--line); }
.q:last-of-type { border-bottom: 0; }

.q__label {
  display: block;
  margin: 0 0 12px;
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.q__label--sub { font-size: 1.1rem; margin-top: 4px; }

.q__hint {
  margin: -6px 0 14px;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.opt {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  vertical-align: 1px;
}

/* Campos com vidro fosco */
.input {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  font: inherit;
  font-size: 1.15rem;         /* ~18,4px: confortável e sem zoom automático no iPhone */
  line-height: 1.45;
  color: var(--ink);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shine), var(--glass-drop);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.input--area { resize: vertical; min-height: 128px; }

.input::placeholder { color: #8F857E; }

.input:focus {
  outline: none;
  background: var(--glass-bg-focus);
  border-color: var(--ink);
  box-shadow: var(--glass-shine), 0 0 0 3px rgba(41, 37, 36, 0.22);
}

.input[aria-invalid="true"] { border-color: var(--ink); border-width: 1.5px; }

.q__error {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 10px 0 0;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--error);
}
.q__error::before {
  content: "!";
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  transform: translateY(2px);
}
.q__error:empty { display: none; }

/* ---------- Opções (mesmo vidro dos campos) ---------- */
.choices { display: grid; gap: 10px; }

.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 56px;
  padding: 15px 16px;
  font-size: 1.15rem;
  line-height: 1.4;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shine), var(--glass-drop);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
  -webkit-tap-highlight-color: transparent;
}

.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.choice::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  transition: all .2s;
}

.choice--check::before { border-radius: 6px; }

.choice:has(input:checked) {
  border-color: var(--ink);
  background: var(--glass-bg-focus);
}

.choice:has(input:checked)::before {
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: inset 0 0 0 4px #fff;
}

.choice--check:has(input:checked)::before {
  box-shadow: none;
  background: var(--ink) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='white' stroke-width='1.8'/></svg>") center / 18px no-repeat;
}

.choice:has(input:focus-visible) {
  border-color: var(--ink);
  box-shadow: var(--glass-shine), 0 0 0 3px rgba(41, 37, 36, 0.22);
}

.q[data-invalid] .choice { border-color: rgba(41, 37, 36, 0.55); }

.reveal {
  margin-top: 18px;
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
  animation: stepIn .35s ease both;
}

/* ---------- Fechamento e botões ---------- */
.closing {
  margin: 8px 0 0;
  padding: 26px 0 4px;
  border-top: 1px solid var(--line);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--ink);
}

.form__status {
  margin: 18px 0 0;
  padding: 14px 16px;
  font-size: 1.05rem;
  color: var(--ink);
  background: rgba(41, 37, 36, 0.05);
  border-left: 2px solid var(--ink);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.nav { display: flex; gap: 12px; padding: 28px 0 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 24px;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s, border-color .2s, opacity .2s;
}

/* Continuar e Enviar: contorno fino em grafite */
.btn--primary { flex: 1; border: 1px solid var(--ink); }
.btn--primary:hover { background: rgba(41, 37, 36, 0.05); }

/* Voltar: neutro, contorno mais leve */
.btn--ghost { color: var(--ink-soft); border: 1px solid var(--line-strong); }
.btn--ghost:hover { color: var(--ink); border-color: var(--ink-soft); }

.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.btn[disabled] { opacity: .55; cursor: progress; }

/* ---------- Confirmação ---------- */
.thanks {
  padding: 70px 0 60px;
  text-align: center;
  outline: none;
  animation: stepIn .5s ease both;
}
.thanks__mark { margin: 0; color: var(--ink-soft); font-size: 1.1rem; }
.thanks__title {
  margin: 18px auto 0;
  max-width: 24rem;
  font-weight: 500;
  font-size: 2.1rem;
  line-height: 1.2;
  color: var(--ink);
}
.thanks__sign { margin: 26px 0 0; font-style: italic; font-size: 1.15rem; color: var(--ink-soft); }

/* ---------- Rodapé ---------- */
.footer {
  padding: 40px var(--gutter) max(36px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.footer p { margin: 0; }

/* ---------- Telas maiores ---------- */
@media (min-width: 760px) {
  :root { --gutter: 40px; }
  .intro { font-size: 1.42rem; }
  .step__title { font-size: 3rem; }
  .btn--primary { flex: 0 0 auto; min-width: 210px; margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .step.is-entering, .reveal, .thanks { animation: none; }
  .progress__bar { transition: none; }
}
