/* Assinatura Floral — formulário "Conhecendo você"
   Herda os tokens de styles.css (café, creme, papel, linha). */

.assinatura-page {
  accent-color: var(--coffee);
  caret-color: var(--coffee);
}

.assinatura-page ::selection {
  background: rgba(77, 47, 18, 0.18);
  color: var(--ink);
}

.assinatura-page :focus-visible {
  outline: 2px solid var(--coffee);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.hp {
  display: none;
}

/* ---------- Abertura ---------- */

.form-hero {
  background: var(--cream);
  padding: clamp(40px, 6vw, 84px) clamp(20px, 5vw, 88px) clamp(36px, 5vw, 64px);
}

.form-hero-inner {
  align-items: center;
  display: grid;
  gap: clamp(32px, 5vw, 80px);
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  margin: 0 auto;
  max-width: 1240px;
}

/* Carrossel de arranjos */

.hero-carousel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.carousel-track {
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  overflow-x: auto;
  position: relative;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track:focus-visible {
  outline-offset: 4px;
}

.carousel-slide {
  aspect-ratio: 4 / 5;
  background: var(--linen);
  flex: 0 0 100%;
  margin: 0;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.carousel-slide img {
  height: 100%;
  object-fit: cover;
  object-position: center;
  width: 100%;
}

.carousel-ui {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: center;
}

.carousel-arrow {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--coffee);
  cursor: pointer;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  padding: 0;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
  width: 38px;
}

.carousel-arrow:hover {
  background: var(--coffee);
  border-color: var(--coffee);
  color: var(--cream);
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.carousel-dot {
  background: transparent;
  border: 0;
  cursor: pointer;
  display: grid;
  height: 22px;
  padding: 0;
  place-items: center;
  width: 22px;
}

.carousel-dot::before {
  background: var(--line);
  border-radius: 999px;
  content: "";
  height: 7px;
  transition: width 320ms cubic-bezier(0.16, 1, 0.3, 1), background 220ms ease;
  width: 7px;
}

.carousel-dot[aria-selected="true"]::before {
  background: var(--coffee);
  width: 22px;
}

.carousel-dot:focus-visible {
  outline-offset: 0;
}

.form-hero h1 {
  color: var(--coffee);
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.96;
  margin: 0 0 26px;
  text-wrap: balance;
}

.form-hero .eyebrow {
  color: var(--coffee-soft);
  margin-bottom: 14px;
}

.lead {
  color: var(--coffee-soft);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  margin: 0 0 14px;
  max-width: 62ch;
  text-wrap: pretty;
}

.lead-soft {
  color: var(--muted);
  margin-bottom: 0;
}

/* ---------- Layout ---------- */

.form-layout {
  align-items: start;
  display: grid;
  gap: clamp(28px, 4vw, 64px);
  grid-template-columns: minmax(240px, 0.36fr) minmax(0, 0.64fr);
  margin: 0 auto;
  max-width: 1240px;
  padding: clamp(36px, 5vw, 72px) clamp(20px, 5vw, 88px) clamp(64px, 8vw, 110px);
}

.form-aside {
  position: sticky;
  top: 150px;
}

/* Etapas (coluna esquerda) */

.stepper {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.stepper-item button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  cursor: default;
  display: grid;
  font: inherit;
  gap: 14px;
  grid-template-columns: 34px minmax(0, 1fr);
  padding: 10px 12px 10px 8px;
  text-align: left;
  transition: background 180ms ease, color 180ms ease;
  width: 100%;
}

.stepper-item.is-done button,
.stepper-item.is-visited button {
  cursor: pointer;
}

.stepper-item.is-done button:hover,
.stepper-item.is-visited button:hover {
  background: var(--cream);
  color: var(--coffee);
}

.stepper-mark {
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  display: grid;
  font-size: 0.8rem;
  font-weight: 800;
  height: 34px;
  place-items: center;
  position: relative;
  transition: background 220ms ease, border-color 220ms ease, color 220ms ease;
  width: 34px;
}

.stepper-mark i {
  font-style: normal;
}

.stepper-mark::after {
  border: solid var(--cream);
  border-width: 0 0 2px 2px;
  content: "";
  height: 6px;
  left: 50%;
  opacity: 0;
  position: absolute;
  top: 44%;
  transform: translate(-50%, -50%) rotate(-45deg) scale(0.6);
  transition: opacity 200ms ease, transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
  width: 11px;
}

.stepper-item.is-current .stepper-mark {
  background: var(--coffee);
  border-color: var(--coffee);
  color: var(--cream);
}

.stepper-item.is-current button {
  color: var(--coffee);
}

.stepper-item.is-done .stepper-mark {
  background: var(--cream);
  border-color: var(--coffee);
  color: transparent;
}

.stepper-item.is-done .stepper-mark::after {
  border-color: var(--coffee);
  opacity: 1;
  transform: translate(-50%, -50%) rotate(-45deg) scale(1);
}

.stepper-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.stepper-text strong {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
}

.stepper-item.is-current .stepper-text strong {
  font-weight: 800;
}

.stepper-text small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.aside-note {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 24px 0 0;
  padding-top: 18px;
}

.req {
  color: var(--coffee-soft);
  font-weight: 800;
}

/* ---------- Painel do formulário ---------- */

.form-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(77, 47, 18, 0.08);
  overflow: hidden;
  position: relative;
}

.panel-progress {
  background: var(--linen);
  height: 4px;
}

.panel-progress-bar {
  background: var(--coffee);
  display: block;
  height: 100%;
  transform: scaleX(var(--progress, 0.2));
  transform-origin: left center;
  transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.panel-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0;
  padding: 22px clamp(22px, 4vw, 48px) 0;
  text-transform: uppercase;
}

.form-steps {
  padding: 10px clamp(22px, 4vw, 48px) 8px;
}

.step {
  display: grid;
  gap: 22px;
}

.step[hidden] {
  display: none;
}

.step.is-entering {
  animation: step-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes step-in {
  from {
    filter: blur(6px);
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    filter: blur(0);
    opacity: 1;
    transform: translateY(0);
  }
}

.step-head {
  margin-bottom: 6px;
}

.step-head h2 {
  color: var(--coffee);
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0 0 8px;
  text-wrap: balance;
}

.step-head p {
  color: var(--muted);
  font-size: 1rem;
  margin: 0;
}

/* Campos */

.field {
  border: 0;
  display: grid;
  gap: 8px;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.field > label,
.field > legend {
  color: var(--ink);
  display: block;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  padding: 0;
  text-wrap: pretty;
}

fieldset.field > legend {
  float: left;
  width: 100%;
}

fieldset.field > legend + * {
  clear: both;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: -4px 0 0;
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="number"],
.field textarea {
  appearance: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  min-height: 50px;
  padding: 13px 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  width: 100%;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9a8a75;
}

.field input:hover,
.field textarea:hover {
  border-color: #c2b39d;
}

.field input:focus,
.field textarea:focus {
  background: #ffffff;
  border-color: var(--coffee);
  box-shadow: 0 0 0 4px rgba(77, 47, 18, 0.12);
  outline: none;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #9b3d2e;
}

.field input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 4px rgba(155, 61, 46, 0.14);
}

.field input[type="number"] {
  -moz-appearance: textfield;
}

.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.field-error {
  color: #9b3d2e;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
  margin: -2px 0 0;
  min-height: 0;
}

.field-error:empty {
  display: none;
}

.field-row {
  display: grid;
  gap: 22px 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-row-cep {
  grid-template-columns: minmax(0, 0.34fr) minmax(0, 0.66fr);
}

.field-narrow {
  max-width: 260px;
}

/* Chips (rádio e múltipla escolha) */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chip {
  cursor: pointer;
  position: relative;
}

.chip input {
  inset: 0;
  margin: 0;
  opacity: 0;
  position: absolute;
}

.chip span {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--coffee);
  display: inline-flex;
  font-size: 0.95rem;
  font-weight: 600;
  gap: 8px;
  line-height: 1.2;
  min-height: 42px;
  padding: 9px 18px;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
  user-select: none;
  width: 100%;
}

.chips-column .chip span {
  justify-content: flex-start;
}

.chip span::before {
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  content: "";
  flex: 0 0 auto;
  height: 14px;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  width: 14px;
}

.chip input[type="checkbox"] + span::before {
  border-radius: 4px;
}

.chip:hover span {
  border-color: #c2b39d;
  transform: translateY(-1px);
}

.chip input:checked + span {
  background: var(--coffee);
  border-color: var(--coffee);
  color: var(--cream);
}

.chip input:checked + span::before {
  background: var(--cream);
  border-color: var(--cream);
  box-shadow: inset 0 0 0 3px var(--coffee);
}

.chip input[type="checkbox"]:checked + span::before {
  background:
    var(--coffee)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5efe6' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E")
    center / 10px no-repeat;
  box-shadow: none;
}

.chip input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(77, 47, 18, 0.16);
}

.reveal {
  animation: step-in 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.reveal[hidden] {
  display: none;
}

.reveal-inline {
  margin-top: 4px;
  max-width: 360px;
}

.send-note {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 6px 0 0;
  padding-top: 18px;
}

/* Ações */

.panel-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 26px;
  padding: 22px clamp(22px, 4vw, 48px) 28px;
}

.panel-actions .button {
  gap: 10px;
  min-width: 150px;
}

.panel-actions .button svg {
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-actions .button:hover svg {
  transform: translateX(3px);
}

.panel-actions[hidden],
.panel-actions .button[hidden],
.form-steps[hidden],
.panel-progress[hidden] {
  display: none;
}

.panel-actions .button:disabled {
  cursor: progress;
  opacity: 0.6;
  transform: none;
}

/* Sucesso */

.panel-success {
  display: grid;
  gap: 18px;
  justify-items: start;
  padding: clamp(36px, 5vw, 64px) clamp(22px, 4vw, 48px) clamp(40px, 5vw, 64px);
}

.panel-success[hidden] {
  display: none;
}

.panel-success.is-entering {
  animation: step-in 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.success-mark {
  align-items: center;
  background: var(--coffee);
  border-radius: 50%;
  display: grid;
  height: 88px;
  place-items: center;
  width: 88px;
}

.success-mark img {
  width: 54px;
}

.panel-success h2 {
  color: var(--coffee);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 8px 0 0;
  max-width: 22ch;
  text-wrap: balance;
}

.panel-success p {
  color: var(--coffee-soft);
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0;
  max-width: 54ch;
}

.panel-failure h2 {
  color: #9b3d2e;
}

.failure-reason {
  background: var(--cream);
  border-radius: 8px;
  color: var(--coffee) !important;
  font-size: 0.98rem !important;
  padding: 14px 18px;
}

.failure-reason[hidden] {
  display: none;
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

/* Cabeçalho: link ativo */

.nav a[aria-current="page"] {
  opacity: 1;
  text-decoration: underline;
  text-decoration-color: var(--coffee);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ---------- Responsivo ---------- */

@media (max-width: 1120px) {
  .form-layout {
    grid-template-columns: minmax(220px, 0.34fr) minmax(0, 0.66fr);
  }

  .form-aside {
    top: 130px;
  }
}

@media (max-width: 880px) {
  .form-hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-carousel {
    margin: 0 auto;
    max-width: 440px;
    width: 100%;
  }

  .form-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .form-aside {
    position: static;
  }

  .stepper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .stepper::-webkit-scrollbar {
    display: none;
  }

  .stepper-item {
    flex: 0 0 auto;
  }

  .stepper-item button {
    gap: 10px;
    grid-template-columns: 30px auto;
    padding: 6px 12px 6px 6px;
  }

  .stepper-mark {
    height: 30px;
    width: 30px;
  }

  .stepper-text small {
    display: none;
  }

  .stepper-text strong {
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .aside-note {
    border-top: 0;
    margin-top: 6px;
    padding-top: 0;
  }
}

@media (max-width: 620px) {
  .field-row,
  .field-row-cep,
  .chips-column {
    grid-template-columns: 1fr;
  }

  .field-narrow {
    max-width: none;
  }

  .panel-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .panel-actions .button {
    width: 100%;
  }

  .panel-success {
    justify-items: stretch;
  }

  .success-actions .button {
    width: 100%;
  }

  .form-hero h1 {
    font-size: 2.6rem;
  }
}

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

  .panel-progress-bar,
  .chip span,
  .stepper-mark,
  .carousel-dot::before,
  .panel-actions .button svg {
    transition: none;
  }

  .carousel-track {
    scroll-behavior: auto;
  }
}
