/* ==========================================================================
   Doutora Web — Onboarding Wizard Premium (Mobile-First)
   Otimizado para smartphones, alta autoridade e conversão com Upsell & Cross-Sell
   ========================================================================== */

:root {
  --bg-page: #F6F3EE;
  --bg-card: #FFFFFF;
  --bg-subtle: #F0EAE1;
  --text-main: #2A221B;
  --text-muted: #7E7266;
  --border-light: #E5DCD0;
  --border-focus: #B8935A;
  
  --theme-primary: #B8935A;
  --theme-secondary: #E3CEB0;
  --theme-surface: #F9F6F0;
  --theme-ink: #2A221B;

  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 50px;
  --shadow-card: 0 15px 45px -10px rgba(42, 34, 27, 0.08);
  --shadow-hover: 0 12px 28px -5px rgba(184, 147, 90, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-page);
  color: var(--text-main);
  font-family: var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 90px;
}

/* TOPBAR */
.wizard-header {
  background: #fff;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}
.wizard-header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
}
.brand-badge span {
  color: var(--theme-primary);
  font-style: italic;
}
.brand-pill {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  background: var(--bg-subtle);
  border-radius: 6px;
  color: var(--text-muted);
}
.step-indicator {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.step-indicator strong {
  color: var(--theme-primary);
}

.progress-track {
  width: 100%;
  height: 4px;
  background: var(--border-light);
  position: relative;
}
.progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 20%;
  background: linear-gradient(90deg, var(--theme-primary), #D4AF37);
  transition: width 0.4s ease;
}

/* CONTAINER */
.wizard-wrap {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 20px auto 40px;
  padding: 0 16px;
}
.wizard-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  padding: clamp(20px, 4vw, 44px);
  position: relative;
}

/* ETAPAS */
.wizard-step {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}
.wizard-step.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--theme-primary);
  background: var(--bg-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}

.step-title {
  font-family: var(--serif);
  font-size: clamp(22px, 3.8vw, 32px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 8px;
  color: var(--text-main);
}
.step-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* INPUTS */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}
.form-label small {
  font-weight: 400;
  color: var(--text-muted);
}
.form-label .req {
  color: #C53030;
  margin-left: 2px;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--sans);
  font-size: 16px;
  color: var(--text-main);
  background: #FCFBF9;
  transition: all 0.2s ease;
  outline: none;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--theme-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(184, 147, 90, 0.15);
}
.form-textarea {
  min-height: 95px;
  resize: vertical;
}

/* ZERO-FRICTION DOMAIN BOX */
.zero-friction-domain-box {
  background: #FAF7F2;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.domain-reassurance-note {
  font-size: 11px;
  color: #2E7D32;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

/* TEMPLATE SELECTION CARDS COM DEMO */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.template-card {
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  background: #FCFBF9;
  transition: all 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}
.template-card:hover {
  border-color: var(--theme-secondary);
}
.template-card.selected {
  border-color: var(--theme-primary);
  background: #FFFDF9;
  box-shadow: 0 8px 20px rgba(184, 147, 90, 0.18);
}
.template-card.selected::after {
  content: "✓ Escolhido";
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--theme-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}
.tpl-preview-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
}
.tpl-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}
.tpl-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  flex: 1;
}
.btn-tpl-demo {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.btn-tpl-demo:hover {
  background: var(--bg-subtle);
  border-color: var(--theme-primary);
  color: var(--theme-primary);
}

/* PALETAS */
.palettes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.palette-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-pill);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.palette-pill.selected {
  border-color: var(--theme-primary);
  background: var(--bg-subtle);
}
.color-dots { display: flex; gap: 4px; }
.color-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
}

/* BIO FORMAT CARDS COM DEMO */
.bio-format-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}
.bio-format-card {
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}
.bio-format-card.selected {
  border-color: var(--theme-primary);
  background: #FFFDF9;
}
.bio-format-card.selected::after {
  content: "✓";
  position: absolute;
  top: 8px; right: 8px;
  color: var(--theme-primary);
  font-weight: bold;
}
.bio-format-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.bio-format-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  flex: 1;
}

/* FOTOS UPLOAD & GUIA DE QUALIDADE */
.photo-quality-box {
  background: linear-gradient(135deg, #FFFDF8 0%, #F8F4EC 100%);
  border: 1px solid var(--theme-secondary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.photo-quality-box h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--theme-primary);
  margin-bottom: 2px;
}
.photo-quality-box p {
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.4;
}

.photo-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.upload-card {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 14px;
  text-align: center;
  background: #FCFBF9;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 210px;
}
.upload-card.has-photo {
  border-style: solid;
  border-color: var(--theme-primary);
  padding: 10px;
}
.upload-preview {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: none;
  margin-bottom: 6px;
}
.upload-card.has-photo .upload-preview { display: block; }
.upload-card.has-photo .upload-placeholder { display: none; }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.upload-hint { font-size: 11px; color: var(--text-muted); }
.file-input { display: none; }

/* CASOS CLÍNICOS & UPSELL BANNER */
.cases-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}
.cases-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.case-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  background: #FCFBF9;
  position: relative;
}
.case-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.case-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--theme-primary);
}
.case-preview-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  display: none;
}
.case-card.has-img .case-preview-thumb {
  display: block;
}

/* BANNER DE UPSELL NO FORMULÁRIO */
.upsell-banner-box {
  background: linear-gradient(135deg, #FFF8ED 0%, #FFF3DC 100%);
  border: 1.5px dashed var(--theme-primary);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.upsell-banner-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--theme-ink);
  margin-bottom: 2px;
}
.upsell-banner-info p {
  font-size: 12px;
  color: var(--text-muted);
}
.btn-upsell-trigger {
  background: linear-gradient(135deg, var(--theme-primary) 0%, #9E7943 100%);
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(184, 147, 90, 0.25);
}

/* PROCEDIMENTOS DINÂMICOS */
.procedures-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.proc-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.proc-row input { flex: 1; }
.btn-remove-proc {
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 48px;
  cursor: pointer;
  color: #B23B3B;
  font-weight: bold;
}
.btn-add-proc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px dashed var(--theme-primary);
  color: var(--theme-primary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* SUBDOMÍNIO & RESUMO */
.domain-input-box {
  display: flex;
  align-items: center;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
  margin-bottom: 6px;
}
.domain-prefix {
  padding: 12px 10px 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: #FAF7F2;
}
.domain-field {
  flex: 1;
  padding: 12px 8px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--theme-primary);
  outline: none;
}
.domain-suffix {
  padding: 12px 14px 12px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  background: #FAF7F2;
}
.domain-status {
  font-size: 12px;
  font-weight: 600;
  color: #2E7D32;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}

.live-summary {
  background: linear-gradient(135deg, #FAF7F2 0%, #FFFFFF 100%);
  border: 1.5px solid var(--theme-secondary);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.summary-photo {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  flex-shrink: 0;
}
.summary-info h3 {
  font-family: var(--serif);
  font-size: 18px;
  margin-bottom: 3px;
}
.summary-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.summary-badge-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.summary-badge {
  font-size: 11px;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--border-light);
  padding: 2px 8px;
  border-radius: 10px;
}

/* NAVEGAÇÃO / FOOTER */
.wizard-footer {
  margin-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
}
.btn-back {
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
}
.btn-next {
  background: linear-gradient(135deg, var(--theme-primary) 0%, #9E7943 100%);
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 30px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 16px rgba(184, 147, 90, 0.25);
  transition: all 0.2s ease;
}
.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.btn-publish {
  background: linear-gradient(135deg, #2E7D32 0%, #1B5E20 100%);
  box-shadow: 0 8px 24px rgba(46, 125, 50, 0.3);
}

/* MODAL DE DEMO E UPSELL */
.demo-modal, .upsell-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 13, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.demo-modal.active, .upsell-modal.active { display: flex; }
.demo-modal-box, .upsell-modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 28px;
}
.demo-close-btn, .upsell-close-btn {
  position: absolute;
  top: 14px; right: 14px;
  background: #eee;
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ITENS DO UPSELL INFINITEPAY */
.upsell-offer-card {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}
.upsell-offer-card:hover {
  border-color: var(--theme-primary);
  background: #FFFDF9;
}
.upsell-offer-card.active {
  border-color: var(--theme-primary);
  background: #FFFBF2;
}

/* SEÇÃO DE CROSS-SELL NA TELA FINAL DE SUCESSO */
.cross-sell-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1.5px dashed var(--border-light);
  text-align: left;
}
.cross-sell-title {
  font-family: var(--serif);
  font-size: 18px;
  margin-bottom: 4px;
  color: var(--text-main);
  text-align: center;
}
.cross-sell-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 16px;
}
.cross-sell-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.cross-sell-card {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  background: #FCFBF9;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}
.cross-sell-card:hover {
  border-color: var(--theme-primary);
  background: #FFFDF9;
  transform: translateY(-2px);
}
.cross-sell-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--theme-primary);
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-start;
  margin-bottom: 6px;
}
.cross-sell-card h5 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}
.cross-sell-card p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 10px;
  flex: 1;
}
.cross-sell-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}
.btn-cross-sell {
  background: #2A221B;
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
}
.btn-cross-sell:hover {
  background: var(--theme-primary);
}

/* MODAL DE DEPLOY */
.deploy-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(42, 34, 27, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.deploy-modal.active { display: flex; }
.deploy-box {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 25px 70px rgba(0,0,0,0.3);
}
.deploy-loader {
  width: 50px; height: 50px;
  border: 4px solid var(--bg-subtle);
  border-top-color: var(--theme-primary);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.deploy-checklist { list-style: none; text-align: left; margin: 20px 0; }
.deploy-step {
  font-size: 13px;
  margin-bottom: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.deploy-step.done { color: #2E7D32; font-weight: 600; }
.deploy-step.done::before { content: "✓"; font-weight: bold; }

/* SUCESSO */
.success-screen { display: none; text-align: center; }
.success-screen.active { display: block; }
.success-emoji { font-size: 56px; margin-bottom: 12px; }
.live-links-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
  text-align: left;
}
.live-link-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.live-link-item:last-child { border-bottom: none; }
.live-link-item a { color: var(--theme-primary); font-weight: 600; }

/* MOBILE */
@media (max-width: 680px) {
  body { padding-bottom: 84px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .photo-upload-grid { grid-template-columns: 1fr; }
  .bio-format-grid { grid-template-columns: 1fr; }
  .cases-grid { grid-template-columns: 1fr; }
  .cross-sell-grid { grid-template-columns: 1fr; }
  .proc-row { flex-direction: column; align-items: stretch; }
  .btn-remove-proc { height: 36px; width: 100%; }
  .upsell-banner-box { flex-direction: column; text-align: center; }
  .btn-upsell-trigger { width: 100%; }

  .wizard-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-light);
    padding: 14px 20px;
    margin: 0;
    z-index: 99;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  }
  .btn-next { flex: 1; justify-content: center; }
  .live-summary { flex-direction: column; text-align: center; }
  .summary-badge-list { justify-content: center; }
}
