/* ==========================================================================
   form.css — cartão de inscrição, campos, erros, confirmação
   ========================================================================== */
.form-card {
  position: relative;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow-l);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.form-card:focus {
  outline: none;
}

.form-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(28px, 4vw, 44px);
  right: clamp(28px, 4vw, 44px);
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: var(--lime);
}

.form-title {
  font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.4rem);
}

.form-lede {
  margin-top: 12px;
  color: var(--ink-2);
}

.demo-banner {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1.5px dashed var(--olive-soft);
  border-radius: var(--radius-m);
  background: var(--lime-wash);
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--green-800);
}

.demo-banner strong {
  display: block;
}

#registration {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

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

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field label {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--ink);
}

.field input,
.field select {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: #fff;
  color: var(--ink);
  font: 400 1rem/1.2 var(--f-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field select {
  appearance: none;
  padding-right: 44px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%23183e32' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 14px center / 20px no-repeat,
    #fff;
}

.field input:hover,
.field select:hover {
  border-color: var(--ink-3);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--green-800);
  box-shadow: 0 0 0 4px rgba(216, 237, 147, 0.9);
}

.field.has-error input,
.field.has-error select {
  border-color: var(--danger);
  background-color: var(--danger-soft);
}

.field.has-error input:focus,
.field.has-error select:focus {
  box-shadow: 0 0 0 4px rgba(163, 41, 28, 0.18);
}

.field-error {
  min-height: 0;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--danger);
}

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

.captcha {
  min-height: 65px;
}

.form-error {
  padding: 12px 16px;
  border-radius: var(--radius-s);
  background: var(--danger-soft);
  font-size: var(--fs-small);
  color: var(--danger);
}

[data-submit] {
  justify-content: space-between;
  margin-top: 6px;
}

[data-submit][aria-busy="true"] {
  cursor: progress;
  opacity: 0.75;
  transform: none;
}

[data-submit][aria-busy="true"] .btn-arrow svg {
  animation: nudge 0.9s ease-in-out infinite;
}

@keyframes nudge {
  50% { transform: translateX(4px); }
}

.privacy-note {
  font-size: var(--fs-micro);
  line-height: 1.55;
  color: var(--ink-3);
}

.privacy-note a {
  color: var(--olive);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* ---------- Confirmação / demonstração ---------- */
.form-success,
.form-demo-result {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 8px 0;
}

.form-success:focus,
.form-demo-result:focus {
  outline: none;
}

.form-success h2,
.form-demo-result h2 {
  font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.3rem);
}

.form-success p,
.form-demo-result p {
  color: var(--ink-2);
}

.success-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--lime);
}

.success-mark svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: var(--green-800);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 26;
  animation: draw 0.7s var(--ease-out) 0.15s both;
}

@keyframes draw {
  from { stroke-dashoffset: 26; }
  to { stroke-dashoffset: 0; }
}

.success-hint {
  font-size: var(--fs-small);
}

@media (max-width: 520px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .success-mark svg,
  [data-submit][aria-busy="true"] .btn-arrow svg {
    animation: none;
  }
}
