/* ========================================================
   Simulador Facial - Estética Avançada
   Design System Mobile-First (Clínica de Estética & Spa)
   ======================================================== */

:root {
  /* Paleta Nobre & Acolhedora */
  --bg-main: #FAF8F5;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F4EFEB;
  --bg-card: #FFFFFF;

  --primary: #9E7B5A;
  --primary-hover: #886747;
  --primary-light: #F7EFE7;
  --accent-gold: #C5A880;
  --accent-gold-soft: rgba(197, 168, 128, 0.2);

  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-light: #94A3B8;

  --border-color: #E8E2D9;
  --border-focus: #C5A880;

  --success: #15803D;
  --success-bg: #F0FDF4;
  --warning-bg: #FFFBEB;
  --warning-border: #FDE68A;
  --warning-text: #92400E;
  --danger: #B91C1C;
  --danger-bg: #FEF2F2;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --shadow-sm: 0 2px 6px rgba(30, 41, 59, 0.04);
  --shadow-md: 0 6px 16px rgba(30, 41, 59, 0.08);
  --shadow-lg: 0 12px 32px rgba(158, 123, 90, 0.12);

  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset e Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Container Mobile First */
.app-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.04);
  position: relative;
}

/* Header */
.app-header {
  padding: 16px 20px 14px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FAF8F5 100%);
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 40;
}

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

.app-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.app-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Área de Conteúdo */
.app-content {
  flex: 1;
  padding: 18px 20px 32px;
}

/* Alternância de Visualizações (Views) */
.view-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Avisos Regulatórios e Legais */
.legal-banner {
  background-color: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 22px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.legal-banner-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--warning-text);
  margin-top: 1px;
}

.legal-banner-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--warning-text);
  font-weight: 500;
}

.result-legal-alert {
  background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
  color: #F8FAFC;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.result-legal-alert svg {
  color: #FBBF24;
  flex-shrink: 0;
}

/* Títulos de Seção e Passos */
.step-header {
  margin-bottom: 12px;
  margin-top: 22px;
}

.step-number {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.step-title {
  font-size: 16px;
  font-weight: 600;
}

.step-description {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Grade de Procedimentos */
.procedures-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.procedure-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: all var(--transition-fast);
  position: relative;
  text-align: left;
}

.procedure-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

.procedure-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-sm);
}

.procedure-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  transition: var(--transition-fast);
}

.procedure-card.selected .procedure-icon {
  background: var(--primary);
  color: #FFFFFF;
}

.procedure-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
}

.procedure-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.procedure-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
}

.procedure-card.selected .procedure-check {
  display: flex;
}

/* Seletor de Intensidade */
.intensity-group {
  display: flex;
  gap: 8px;
  background: var(--bg-subtle);
  padding: 5px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.intensity-btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.intensity-btn.selected {
  background: #FFFFFF;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.intensity-note {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 6px;
}

/* Upload e Captura de Foto */
.upload-card {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  background: var(--bg-subtle);
  text-align: center;
  transition: var(--transition-normal);
}

.upload-card:hover {
  border-color: var(--accent-gold);
}

.upload-icon-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  box-shadow: var(--shadow-sm);
}

.upload-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.upload-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.upload-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-capture {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.btn-capture-camera {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.btn-capture-camera:hover {
  background: var(--primary-hover);
}

.btn-capture-gallery {
  background: #FFFFFF;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-capture-gallery:hover {
  background: #F8FAFC;
  border-color: var(--accent-gold);
}

/* Dicas de Foto */
.photo-tips {
  margin-top: 14px;
  padding: 10px 14px;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 11.5px;
  color: var(--text-secondary);
  text-align: left;
}

.photo-tips-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.photo-tips ul {
  padding-left: 18px;
  line-height: 1.6;
}

/* Área de Preview da Foto */
.preview-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.preview-image-wrapper {
  position: relative;
  width: 100%;
  max-height: 380px;
  overflow: hidden;
  background: #0F172A;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-image-wrapper img {
  width: 100%;
  height: auto;
  max-height: 380px;
  object-fit: cover;
  display: block;
}

.preview-actions {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
}

.preview-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--success);
  font-weight: 600;
}

.btn-text-action {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
}

/* Consentimento */
.consent-wrapper {
  margin-top: 22px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid var(--border-color);
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.consent-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

.consent-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Resumo da Escolha */
.selection-summary {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 12.5px;
}

.summary-item {
  color: var(--primary);
  font-weight: 600;
}

/* Botão Principal de Envio */
.submit-action {
  margin-top: 20px;
}

.btn-primary-action {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, #886747 100%);
  color: #FFFFFF;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary-action:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary-action:disabled {
  background: #CBD5E1;
  color: #94A3B8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Tela de Loading / Processamento */
.loading-card {
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.luxury-spinner {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--accent-gold-soft);
  border-top-color: var(--primary);
  animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
  margin-bottom: 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-title {
  font-size: 18px;
  margin-bottom: 6px;
}

.loading-step-text {
  font-size: 13.5px;
  color: var(--text-muted);
  min-height: 22px;
  margin-bottom: 22px;
}

.progress-container {
  width: 100%;
  max-width: 320px;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 32px;
}

.progress-bar-fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--accent-gold) 0%, var(--primary) 100%);
  border-radius: var(--radius-pill);
  transition: width 0.5s ease;
}

.btn-cancel-action {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 8px 24px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-cancel-action:hover {
  background: var(--bg-subtle);
  color: var(--danger);
  border-color: var(--danger);
}

/* Tela de Resultado: Slider Antes / Depois */
.result-meta-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.meta-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.meta-badge.procedure-badge {
  background: var(--primary-light);
  color: var(--primary);
}

.ba-slider-container {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000000;
  box-shadow: var(--shadow-lg);
  margin-bottom: 18px;
  user-select: none;
}

.ba-slider-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 520px;
  overflow: hidden;
  touch-action: pan-y;
  cursor: ew-resize;
}

.ba-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ba-after-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  clip-path: polygon(50% 0%, 100% 0%, 100% 100%, 50% 100%);
  transition: none;
}

.ba-badge {
  position: absolute;
  top: 14px;
  padding: 5px 12px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  z-index: 10;
}

.ba-badge-before {
  left: 14px;
}

.ba-badge-after {
  right: 14px;
  background: rgba(158, 123, 90, 0.85);
}

/* Alça e Linha Divisória */
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 44px;
  margin-left: -22px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  cursor: ew-resize;
  outline: none;
}

.ba-handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #FFFFFF;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.ba-handle-button {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFFFFF 0%, #F5EBE6 100%);
  border: 2px solid var(--accent-gold);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}

.ba-handle:focus .ba-handle-button,
.ba-handle:hover .ba-handle-button {
  transform: scale(1.08);
}

/* Controles Rápidos Abaixo do Slider */
.ba-quick-controls {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
}

.ba-quick-btn {
  flex: 1;
  padding: 8px 4px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.ba-quick-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Ações de Compartilhamento e Download */
.result-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.btn-action-share {
  background: #25D366;
  color: #FFFFFF;
  font-weight: 600;
  height: 48px;
  border-radius: var(--radius-md);
  border: none;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
  transition: var(--transition-fast);
}

.btn-action-share:hover {
  background: #20BD5A;
}

.btn-action-download {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
  font-weight: 600;
  height: 48px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-action-download:hover {
  background: var(--bg-subtle);
  border-color: var(--accent-gold);
}

.btn-action-reset {
  background: transparent;
  color: var(--text-muted);
  border: none;
  height: 44px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  transition: var(--transition-fast);
}

.btn-action-reset:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* Modais e Bottom Sheets */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 400px;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: modalPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.modal-icon-circle.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.modal-icon-circle.whatsapp {
  background: #E8F9EE;
  color: #25D366;
}

.modal-title {
  font-size: 17px;
  margin-bottom: 8px;
}

.modal-body-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.modal-btn-confirm {
  width: 100%;
  height: 46px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.modal-btn-confirm.primary {
  background: var(--primary);
  color: #FFFFFF;
}

.modal-btn-confirm.whatsapp {
  background: #25D366;
  color: #FFFFFF;
  margin-bottom: 8px;
}

.modal-btn-secondary {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
}

/* Indicador de arraste ativo no body */
body.ba-dragging-active {
  user-select: none;
  cursor: ew-resize;
}
