/* ═══════════════════════════════════════
   TESTAMENTO — Modal do formulário
   Adicionar ao final de css/sections.css
   ═══════════════════════════════════════ */

/* ── Overlay ── */
.tf-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.tf-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Caixa do modal ── */
.tf-box {
  background: #0e0e14;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 40px 100px rgba(0,0,0,0.55);
}

.tf-overlay.open .tf-box {
  transform: translateY(0) scale(1);
}

.tf-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--purple), var(--cyan));
  z-index: 1;
}

/* ── Cabeçalho fixo ── */
.tf-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tf-tag {
  font-size: .6rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 8px;
}

.tf-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  font-weight: 300;
  line-height: 1.2;
  color: var(--fg);
}

.tf-title em { font-style: italic; color: var(--cyan); }

.tf-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .22s;
  margin-top: 2px;
}

.tf-close:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ── Progress ── */
.tf-prog-wrap {
  padding: 16px 32px 0;
  flex-shrink: 0;
}

.tf-prog-info {
  display: flex;
  justify-content: space-between;
  font-size: .6rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 8px;
}

.tf-prog-info span:last-child { color: var(--cyan); }

.tf-prog-bar {
  height: 2px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 16px;
}

.tf-prog-fill {
  height: 100%;
  width: 4%;
  background: linear-gradient(to right, var(--purple), var(--cyan));
  border-radius: 100px;
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

/* ── Corpo rolável ── */
.tf-body {
  overflow-y: auto;
  padding: 8px 32px 32px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border-mid) transparent;
}

.tf-body::-webkit-scrollbar { width: 4px; }
.tf-body::-webkit-scrollbar-track { background: transparent; }
.tf-body::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 2px; }

/* ── Steps ── */
.tf-step { display: none; animation: tf-up .32s ease forwards; }
.tf-step.active { display: block; }

@keyframes tf-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Card ── */
.tf-card {
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px 28px 24px;
  margin-top: 16px;
}

.tf-snum {
  font-size: .58rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
}

.tf-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 400;
  line-height: 1.38;
  color: var(--fg);
  margin-bottom: 6px;
}

.tf-hint {
  font-size: .76rem;
  line-height: 1.68;
  color: var(--fg-faint);
  margin: 10px 0 20px;
  padding: 10px 14px;
  border-left: 2px solid rgba(0,229,255,.2);
  background: rgba(0,229,255,.022);
  border-radius: 0 4px 4px 0;
}

/* ── Opções de seleção ── */
.tf-opts {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 18px;
}

.tf-opt {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--border-mid);
  border-radius: 4px;
  cursor: pointer;
  transition: all .2s;
  background: transparent;
  text-align: left;
  color: var(--fg);
  font-family: 'Outfit', sans-serif;
  font-size: .83rem;
  line-height: 1.5;
  font-weight: 300;
  width: 100%;
}

.tf-opt:hover { border-color: rgba(0,229,255,.4); background: rgba(0,229,255,.04); }
.tf-opt.sel   { border-color: var(--cyan); background: rgba(0,229,255,.07); }

.tf-radio {
  flex-shrink: 0;
  width: 16px; height: 16px;
  border: 1px solid var(--border-mid);
  border-radius: 50%;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .18s;
}

.tf-opt.sel .tf-radio { border-color: var(--cyan); background: var(--cyan); }
.tf-opt.sel .tf-radio::after { content:''; width:6px; height:6px; border-radius:50%; background:#000; }

.tf-otxt strong { display:block; font-weight:500; margin-bottom:1px; }
.tf-osub { font-size:.7rem; color:var(--fg-faint); margin-top:2px; }

/* ── Erros inline ── */
.tf-err { display:none; font-size:.71rem; color:#ff6b6b; margin-top:9px; }
.tf-err.show { display:block; }
.tf-err-block { margin-top: 14px; text-align: center; }

/* ── Navegação ── */
.tf-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 10px;
}

.tf-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--fg-muted);
  font-family: 'Outfit', sans-serif;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 9px 18px;
  border-radius: 2px;
  cursor: pointer;
  transition: all .2s;
}

.tf-back:hover:not(:disabled) { color: var(--fg); }
.tf-back:disabled { opacity: .2; cursor: default; }

.tf-next {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  background: var(--cyan);
  border: none;
  color: #000;
  font-family: 'Outfit', sans-serif;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 9px 22px;
  border-radius: 2px;
  cursor: pointer;
  transition: all .2s;
}

.tf-next:hover:not(:disabled) { background: var(--fg); transform: translateY(-1px); }
.tf-next:disabled { opacity: .5; cursor: default; transform: none; }

/* ══════════════════════════════════════
   ETAPA DE DADOS PESSOAIS
══════════════════════════════════════ */

.tf-dados-sub {
  font-size: .78rem;
  line-height: 1.6;
  color: var(--fg-faint);
  margin: 8px 0 24px;
}

.tf-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.tf-field.tf-field-full {
  grid-column: 1 / -1;
}

.tf-field { display: flex; flex-direction: column; gap: 5px; }

.tf-field label {
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-family: 'Outfit', sans-serif;
}

.tf-field label span { color: var(--cyan); }

.tf-field input,
.tf-field select {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-mid);
  border-radius: 3px;
  color: var(--fg);
  font-family: 'Outfit', sans-serif;
  font-size: .84rem;
  font-weight: 300;
  padding: 10px 12px;
  transition: border-color .2s, background .2s;
  outline: none;
  width: 100%;
}

.tf-field input::placeholder { color: var(--fg-faint); }

.tf-field input:focus,
.tf-field select:focus {
  border-color: var(--cyan);
  background: rgba(0,229,255,.04);
}

.tf-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%2300E5FF' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.tf-field select option {
  background: #1a1a2e;
  color: var(--fg);
}

/* Campo com erro */
.tf-field input.tf-field-err,
.tf-field select.tf-field-err {
  border-color: #ff6b6b;
  background: rgba(255,107,107,.05);
}

/* ── Botão de download no resultado ── */
.tf-downloads {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px auto 24px;
  width: 100%;
  max-width: 340px;
}

.tf-btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--cyan);
  color: #000;
  font-family: 'Outfit', sans-serif;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 2px;
  transition: all .25s;
  border: none;
  cursor: pointer;
}

.tf-btn-download:hover {
  background: var(--fg);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,229,255,.2);
}

.tf-btn-download svg { flex-shrink: 0; }

/* ── Resultado / Sucesso ── */
.tf-res-card {
  background: linear-gradient(135deg, rgba(91,79,192,.1) 0%, rgba(0,229,255,.04) 100%);
  border: 1px solid rgba(91,79,192,.3);
  border-radius: 6px;
  padding: 36px 32px;
  text-align: center;
  margin-top: 16px;
  position: relative;
  overflow: hidden;
  animation: tf-up .4s ease forwards;
}

.tf-res-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--purple), var(--cyan));
}

.tf-res-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.tf-res-icon-ok {
  background: linear-gradient(135deg, #1a8a4a, #00E5FF);
}

.tf-res-tag {
  font-size: .58rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 10px;
}

.tf-res-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 300;
  line-height: 1.25;
  color: var(--fg);
  margin-bottom: 10px;
}

.tf-res-card h2 em { font-style: italic; color: var(--cyan); }

.tf-res-desc {
  font-size: .84rem;
  line-height: 1.82;
  color: var(--fg-muted);
  max-width: 460px;
  margin: 0 auto 20px;
}

.tf-res-note {
  font-size: .72rem;
  line-height: 1.72;
  color: var(--fg-faint);
  max-width: 440px;
  margin: 0 auto 24px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255,255,255,.02);
}

.tf-res-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.tf-btn-restart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--fg-muted);
  font-family: 'Outfit', sans-serif;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 9px 20px;
  border-radius: 2px;
  cursor: pointer;
  transition: all .2s;
}

.tf-btn-restart:hover { border-color: var(--cyan); color: var(--cyan); }

.tf-btn-close-res {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purple);
  border: none;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 9px 20px;
  border-radius: 2px;
  cursor: pointer;
  transition: all .2s;
}

.tf-btn-close-res:hover { background: var(--cyan); color: #000; }

/* Bloqueia scroll do body quando modal aberto */
body.tf-modal-open { overflow: hidden; }

/* ── Responsivo ── */
@media (max-width: 600px) {
  .tf-box { max-height: 95vh; border-radius: 6px 6px 0 0; align-self: flex-end; }
  .tf-overlay { align-items: flex-end; padding: 0; }
  .tf-header { padding: 22px 20px 16px; }
  .tf-prog-wrap { padding: 12px 20px 0; }
  .tf-body { padding: 6px 20px 28px; }
  .tf-card { padding: 22px 18px 18px; }
  .tf-field-row { grid-template-columns: 1fr; }
  .tf-field.tf-field-full { grid-column: auto; }
}
