﻿/* ===== MODELO FÁCIL — Design System ===== */

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Cores FacilZap — identidade irmã */
  --verde-primario: #00bfa5;
  --verde-escuro:   #007a6e;
  --verde-claro:    #1de9b6;
  --verde-menta:    #b2dfdb;

  /* Fundos dark com tonalidade verde */
  --bg-principal:   #0a1a18;
  --bg-card:        #0f2421;
  --bg-elevado:     #163330;
  --bg-hover:       #1a3d39;

  /* Textos */
  --texto-principal:  #ffffff;
  --texto-secundario: #a8c5c1;
  --texto-muted:      #5a8a84;

  /* Acentos */
  --acento-dourado: #FFD700;
  --acento-coral:   #FF6B6B;

  /* Bordas */
  --borda:       rgba(0, 191, 165, 0.15);
  --borda-hover: rgba(0, 191, 165, 0.45);

  /* Gradientes */
  --gradiente-hero: linear-gradient(135deg, #007a6e 0%, #0a1a18 50%, #00bfa5 100%);
  --gradiente-card: linear-gradient(145deg, #0f2421 0%, #163330 100%);
  --gradiente-btn:  linear-gradient(135deg, #00bfa5 0%, #007a6e 100%);
  --gradiente-btn-hover: linear-gradient(135deg, #1de9b6 0%, #00a893 100%);

  /* Utilitários */
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-verde: 0 4px 24px rgba(0, 191, 165, 0.08);
  --glow-verde: 0 0 24px rgba(0, 191, 165, 0.25);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  background: var(--bg-principal);
  color: var(--texto-principal);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* ===== BACKGROUND ANIMADO COM PARTÍCULAS VERDES ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(0, 191, 165, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0, 122, 110, 0.12) 0%, transparent 50%),
    var(--bg-principal);
  z-index: -1;
  pointer-events: none;
}

/* ===== LAYOUT ===== */
.app-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 80px;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== HEADER STICKY COM GLASSMORPHISM ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 26, 24, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--borda);
  margin: 0 -16px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  padding: 14px 24px;
  animation: slideDown 0.4s ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.header-brand {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--verde-claro), var(--verde-primario));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}

.header-brand::before {
  content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'><path d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/><circle cx='12' cy='13' r='4'/></svg>");
  font-size: 1.3rem;
  filter: drop-shadow(0 2px 4px rgba(0, 191, 165, 0.3));
  -webkit-text-fill-color: initial;
}

.header-spacer { flex: 1; }

/* ===== PROFILE MENU ===== */
.profile-menu {
  position: relative;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevado);
  border: 1px solid var(--borda);
  color: var(--texto-principal);
  padding: 10px 16px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  font-family: inherit;
}

.profile-btn:hover {
  background: var(--bg-hover);
  border-color: var(--borda-hover);
  box-shadow: var(--shadow-verde);
}

.profile-arrow {
  font-size: 0.7rem;
  opacity: 0.6;
  transition: transform var(--transition);
}

.profile-btn:hover .profile-arrow {
  transform: translateY(2px);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 260px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 200;
  animation: dropdownSlide 0.3s ease;
}

@keyframes dropdownSlide {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-info {
  padding: 8px 12px;
  margin-bottom: 4px;
}

.profile-plan {
  font-weight: 700;
  font-size: 1rem;
  color: var(--verde-claro);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.profile-credits {
  font-size: 0.9rem;
  color: var(--texto-secundario);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-credits::before {
  content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300bfa5' stroke-width='2'><polygon points='6 3 18 3 22 9 12 22 2 9'/><line x1='2' y1='9' x2='22' y2='9'/><line x1='6' y1='3' x2='12' y2='22'/><line x1='18' y1='3' x2='12' y2='22'/></svg>");
  font-size: 0.85rem;
}

.profile-period {
  font-size: 0.75rem;
  color: var(--texto-muted);
  margin-top: 6px;
}

.profile-dropdown hr {
  border: none;
  border-top: 1px solid var(--borda);
  margin: 12px 0;
}

.profile-action {
  display: block;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--texto-secundario);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  font-family: inherit;
}

.profile-action:hover {
  background: var(--bg-elevado);
  color: var(--texto-principal);
  transform: translateX(4px);
}

/* ===== MENU DE ABAS COM INDICADOR DESLIZANTE ===== */
.main-menu {
  display: flex;
  gap: 0;
  padding: 24px 0 0;
  border-bottom: 2px solid var(--borda);
  position: relative;
  margin-bottom: 8px;
}

.menu-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  background: transparent;
  border: none;
  color: var(--texto-muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border-radius: 0;
  position: relative;
  font-family: inherit;
}

.menu-tab:hover {
  color: var(--texto-secundario);
  background: rgba(0, 191, 165, 0.03);
}

.menu-tab.active {
  color: var(--verde-claro);
  font-weight: 700;
}

.menu-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--verde-claro), var(--verde-primario));
  border-radius: 2px 2px 0 0;
  box-shadow: 0 -2px 8px rgba(0, 191, 165, 0.4);
  animation: slideIndicator 0.3s ease;
}

@keyframes slideIndicator {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.menu-tab-icon {
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ===== MENU CONTENT ===== */
.menu-content {
  display: none;
  animation: fadeSlideUp 0.4s ease;
}

.menu-content.active {
  display: block;
}

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

/* ===== STEPPER (BARRA DE PROGRESSO) ===== */
.steps-progress {
  display: flex;
  align-items: center;
  padding: 24px 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.steps-progress::-webkit-scrollbar {
  display: none;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}

.step-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--borda);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--texto-muted);
  transition: all var(--transition);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.step-item.active .step-dot {
  background: var(--gradiente-btn);
  border-color: var(--verde-claro);
  color: #fff;
  box-shadow: var(--glow-verde);
  transform: scale(1.1);
  animation: pulse-verde 2s ease infinite;
}

@keyframes pulse-verde {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 191, 165, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(0, 191, 165, 0);
  }
}

.step-item.completed .step-dot {
  background: rgba(0, 191, 165, 0.15);
  border-color: var(--verde-primario);
  color: var(--verde-claro);
}

.step-item.completed .step-dot::after {
  content: '✓';
  font-size: 1rem;
  animation: checkMark 0.4s ease;
}

@keyframes checkMark {
  0% { transform: scale(0) rotate(-45deg); }
  50% { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.step-item.completed .step-dot span {
  display: none;
}

.step-label {
  font-size: 0.72rem;
  color: var(--texto-muted);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.step-item.active .step-label {
  color: var(--verde-claro);
  font-weight: 700;
}

.step-item.completed .step-label {
  color: var(--texto-secundario);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--borda);
  min-width: 24px;
  margin-bottom: 24px;
  transition: background var(--transition);
  position: relative;
  overflow: hidden;
}

.step-line.active {
  background: var(--verde-primario);
}

.step-line.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ===== SECTIONS ===== */
.step-section {
  display: none;
  padding-top: 16px;
}

.step-section.active {
  display: block;
  animation: fadeSlideUp 0.4s ease;
}

/* ===== CARDS COM HOVER ANIMADO ===== */
.card {
  background: var(--gradiente-card);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  transition: all var(--transition);
  box-shadow: var(--shadow-verde);
}

.card:hover {
  border-color: var(--borda-hover);
  box-shadow: 0 8px 32px rgba(0, 191, 165, 0.12);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(0, 191, 165, 0.15);
  border: 1px solid rgba(0, 191, 165, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  transition: all var(--transition);
}

.card:hover .card-icon {
  transform: scale(1.05) rotate(5deg);
}

.success-icon {
  background: rgba(29, 233, 182, 0.15);
  border-color: rgba(29, 233, 182, 0.3);
  animation: successPop 0.5s ease;
}

@keyframes successPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.card-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--texto-secundario);
  line-height: 1.5;
}

/* ===== UPLOAD ZONE ===== */
.upload-zone {
  position: relative;
  border: 2px dashed var(--borda);
  border-radius: var(--radius-sm);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  overflow: hidden;
  background: var(--bg-elevado);
  margin-bottom: 20px;
}

.upload-zone:hover {
  border-color: var(--verde-primario);
  background: rgba(0, 191, 165, 0.05);
  box-shadow: inset 0 0 20px rgba(0, 191, 165, 0.1);
}

.upload-zone.has-image {
  padding: 0;
  border-style: solid;
  border-color: var(--verde-primario);
  box-shadow: var(--glow-verde);
}

.upload-zone.dragover {
  border-color: var(--verde-claro);
  background: rgba(0, 191, 165, 0.15);
  transform: scale(1.02);
}

.upload-zone-sm {
  padding: 24px;
  margin-top: 12px;
}

.upload-zone-sm.has-image {
  padding: 0;
}

.upload-placeholder {
  pointer-events: none;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(0, 191, 165, 0.2));
}

.upload-text {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--texto-principal);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.upload-subtext {
  font-size: 0.85rem;
  color: var(--texto-muted);
}

.upload-preview {
  display: none;
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.has-image .upload-placeholder {
  display: none;
}

.has-image .upload-preview {
  display: block;
}

.upload-change-btn {
  display: none;
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border: 1px solid var(--verde-primario);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all var(--transition);
  font-family: inherit;
}

.has-image .upload-change-btn {
  display: block;
}

.upload-change-btn:hover {
  background: var(--verde-primario);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 191, 165, 0.4);
}

/* ===== GALLERY GRID (MODELOS) ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

@media (min-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gallery-card {
  border-radius: var(--radius-sm);
  border: 2px solid var(--borda);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-elevado);
  position: relative;
}

.gallery-card:hover {
  border-color: var(--verde-primario);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 191, 165, 0.2);
}

.gallery-card.selected {
  border-color: var(--verde-claro);
  box-shadow: 0 0 0 4px rgba(0, 191, 165, 0.2), var(--glow-verde);
  background: rgba(0, 191, 165, 0.05);
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}

.gallery-card:hover img {
  transform: scale(1.05);
}

.gallery-card .card-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: var(--verde-primario);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: checkPop 0.3s ease;
}

@keyframes checkPop {
  0% { transform: scale(0) rotate(-180deg); }
  50% { transform: scale(1.3) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

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

.gallery-card-label {
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--texto-secundario);
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  transition: all var(--transition);
}

.gallery-card.selected .gallery-card-label {
  background: var(--verde-primario);
  color: #fff;
}

/* ===== SELECTION GRID (CENÁRIO, POSE, ESTILO) ===== */
.selection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (min-width: 480px) {
  .selection-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.sel-card {
  border: 2px solid var(--borda);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-elevado);
  position: relative;
}

.sel-card:hover {
  border-color: var(--verde-primario);
  background: rgba(0, 191, 165, 0.08);
  transform: translateY(-2px);
}

.sel-card.selected {
  border-color: var(--verde-claro);
  background: rgba(0, 191, 165, 0.15);
  box-shadow: var(--glow-verde);
}

.sel-card.selected::before {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: var(--verde-primario);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #fff;
  font-weight: 700;
  animation: checkPop 0.3s ease;
}

.sel-card-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
  transition: transform var(--transition);
}

.sel-card:hover .sel-card-icon {
  transform: scale(1.15);
}

.sel-card-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--texto-principal);
  margin-bottom: 2px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.sel-card-sub {
  font-size: 0.72rem;
  color: var(--texto-muted);
  margin-top: 4px;
}

/* ===== OPTIONAL SECTION ===== */
.optional-section {
  margin-bottom: 24px;
}

.optional-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--texto-secundario);
  margin-bottom: 12px;
  font-weight: 600;
}

/* ===== OPTIONS GRID ===== */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-group.full {
  grid-column: 1 / -1;
}

.option-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--texto-secundario);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.option-select,
.prompt-input {
  width: 100%;
  background: var(--bg-elevado);
  border: 1px solid var(--borda);
  border-radius: var(--radius-sm);
  color: var(--texto-principal);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 12px 14px;
  transition: all var(--transition);
  appearance: none;
}

.option-select:focus,
.prompt-input:focus {
  outline: none;
  border-color: var(--verde-primario);
  box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.1);
  background: var(--bg-card);
}

.option-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2300bfa5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.prompt-input {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--texto-muted);
  margin-top: 6px;
}

/* ===== COST BOX ===== */
.cost-box {
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.9rem;
  color: var(--acento-dourado);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.cost-box::before {
  content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300bfa5' stroke-width='2'><polygon points='6 3 18 3 22 9 12 22 2 9'/><line x1='2' y1='9' x2='22' y2='9'/><line x1='6' y1='3' x2='12' y2='22'/><line x1='18' y1='3' x2='12' y2='22'/></svg>");
  font-size: 1.2rem;
}

.cost-usd {
  color: var(--texto-muted);
  font-size: 0.8rem;
  font-weight: 400;
}

/* ===== BOTÕES COM GRADIENTE E SHIMMER ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 50px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--gradiente-btn);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 191, 165, 0.3);
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: rgba(255, 255, 255, 0.2);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.btn-primary:hover::after {
  left: 125%;
}

.btn-primary:hover {
  background: var(--gradiente-btn-hover);
  box-shadow: 0 8px 24px rgba(0, 191, 165, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-elevado);
  border: 1px solid var(--borda);
  color: var(--texto-secundario);
}

.btn-secondary:hover {
  border-color: var(--verde-primario);
  color: var(--texto-principal);
  background: var(--bg-hover);
}

.btn-success {
  background: linear-gradient(135deg, var(--verde-claro), var(--verde-primario));
  color: #fff;
  box-shadow: 0 4px 16px rgba(29, 233, 182, 0.3);
}

.btn-success:hover {
  box-shadow: 0 8px 24px rgba(29, 233, 182, 0.5);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--verde-primario);
  color: var(--verde-claro);
}

.btn-outline:hover {
  background: rgba(0, 191, 165, 0.15);
  border-color: var(--verde-claro);
}

.btn-generate {
  background: linear-gradient(135deg, var(--verde-claro), var(--verde-primario));
  color: #fff;
  font-size: 1.05rem;
  padding: 16px 32px;
  box-shadow: 0 6px 28px rgba(0, 191, 165, 0.4);
}

.btn-generate:hover {
  box-shadow: 0 8px 40px rgba(0, 191, 165, 0.6);
  transform: translateY(-3px) scale(1.02);
}

.btn-full {
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-group.center {
  justify-content: center;
}

/* ===== LOADING STATE ===== */
.loading-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 28px;
  gap: 20px;
}

.spinner-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid var(--bg-elevado);
  border-top-color: var(--verde-primario);
  border-right-color: var(--verde-claro);
  animation: spin 1s linear infinite;
}

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

.loading-title {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  animation: pulse-text 2s ease infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.loading-sub {
  font-size: 0.9rem;
  color: var(--texto-secundario);
  text-align: center;
  max-width: 300px;
}

.progress-track {
  width: 100%;
  max-width: 320px;
  height: 6px;
  background: var(--bg-elevado);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--verde-primario), var(--verde-claro));
  border-radius: 3px;
  animation: progress-indeterminate 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(0, 191, 165, 0.5);
}

@keyframes progress-indeterminate {
  0% {
    width: 0%;
    margin-left: 0;
  }
  50% {
    width: 60%;
    margin-left: 20%;
  }
  100% {
    width: 0%;
    margin-left: 100%;
  }
}

.result-area {}

/* ===== RESULT IMAGE ===== */
.result-img-wrap {
  position: relative;
  margin: 0 auto 24px;
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 450px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
  border: 2px solid var(--verde-primario);
}

.result-image {
  width: 100%;
  display: block;
}

.result-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 191, 165, 0.9);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 30px;
  backdrop-filter: blur(10px);
  font-family: 'Plus Jakarta Sans', sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ===== RESULT VIDEO ===== */
.result-video-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
  background: #000;
  border: 2px solid var(--verde-primario);
}

.result-video {
  width: 100%;
  display: block;
  max-height: 550px;
}

/* ===== VARIATIONS ===== */
.variations-section {
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
  background: rgba(0, 191, 165, 0.04);
}

.variations-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.variations-desc {
  font-size: 0.85rem;
  color: var(--texto-secundario);
  margin-bottom: 16px;
}

.variations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.variation-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  border: 2px solid var(--borda);
  transition: all var(--transition);
}

.variation-item:hover {
  border-color: var(--verde-primario);
  transform: scale(1.05);
}

.variation-item img {
  width: 100%;
  display: block;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.variation-dl {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--verde-primario);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.variation-dl:hover {
  background: var(--verde-primario);
  transform: translateY(-2px);
}

/* ===== TO VIDEO SECTION ===== */
.to-video-section {
  border: 1px solid rgba(29, 233, 182, 0.25);
  border-radius: var(--radius);
  padding: 24px;
  background: rgba(29, 233, 182, 0.05);
}

.to-video-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.to-video-desc {
  font-size: 0.85rem;
  color: var(--texto-secundario);
  margin-bottom: 16px;
}

/* ===== SESSION GALLERY ===== */
.session-gallery {
  min-height: 140px;
  margin-bottom: 24px;
}

.empty-gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 24px;
  text-align: center;
  color: var(--texto-muted);
  font-size: 0.95rem;
}

.session-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.session-img-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--borda);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.session-img-item:hover {
  border-color: var(--verde-primario);
  transform: scale(1.05);
}

.session-img-item.selected {
  border-color: var(--verde-claro);
  box-shadow: var(--glow-verde);
}

.session-img-item img {
  width: 100%;
  display: block;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.session-img-item .card-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  background: var(--verde-primario);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.session-img-item.selected .card-check {
  display: flex;
}

/* ===== VIDEO TYPE SECTION ===== */
.video-type-section {
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  background: var(--bg-elevado);
}

.video-type-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.video-type-title {
  font-size: 1rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.video-type-desc {
  font-size: 0.85rem;
  color: var(--texto-secundario);
  margin-bottom: 16px;
}

.video-type-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 30px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.video-type-badge.kling {
  background: rgba(0, 191, 165, 0.2);
  border: 1px solid rgba(0, 191, 165, 0.4);
  color: var(--verde-claro);
}

.video-type-badge.veo {
  background: rgba(29, 233, 182, 0.2);
  border: 1px solid rgba(29, 233, 182, 0.4);
  color: var(--verde-claro);
}

.type-divider {
  text-align: center;
  position: relative;
  margin: 8px 0 16px;
  color: var(--texto-muted);
  font-size: 0.85rem;
}

.type-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--borda);
}

.type-divider span {
  position: relative;
  background: var(--bg-card);
  padding: 0 14px;
}

.talking-form {
  margin-bottom: 16px;
}

/* ===== MODAL SEM CRÉDITOS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-card {
  background: var(--gradiente-card);
  padding: 36px;
  border-radius: var(--radius);
  max-width: 460px;
  width: 90%;
  border: 1px solid var(--borda-hover);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-card h2 {
  margin: 0 0 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
}

.modal-card p {
  color: var(--texto-secundario);
  margin-bottom: 28px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 14px 24px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 700;
  pointer-events: auto;
  animation: toast-in 0.3s ease;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.success {
  background: var(--verde-primario);
  color: #fff;
}

.toast.error {
  background: var(--acento-coral);
  color: #fff;
}

.toast.info {
  background: rgba(15, 36, 33, 0.95);
  color: var(--texto-principal);
  border: 1px solid var(--borda-hover);
  backdrop-filter: blur(20px);
}

.toast-exit {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ===== FOOTER ===== */
.app-footer {
  text-align: center;
  padding: 28px 0;
  color: var(--texto-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--borda);
  margin-top: 40px;
}

.app-footer a {
  color: var(--texto-secundario);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}

.app-footer a:hover {
  color: var(--verde-claro);
}

/* ===== SCROLLBAR CUSTOMIZADA ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-card);
}

::-webkit-scrollbar-thumb {
  background: var(--verde-primario);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--verde-claro);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .card {
    padding: 20px;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .variations-grid,
  .session-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn-group {
    flex-direction: column;
  }

  .btn-group .btn {
    width: 100%;
  }

  .app-header {
    padding: 12px 16px;
  }

  .header-brand {
    font-size: 1rem;
  }

  .profile-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .menu-tab {
    padding: 12px 14px;
    font-size: 0.85rem;
  }

  .step-dot {
    width: 36px;
    height: 36px;
  }
}

/* ===== CREDITS BADGE NO HEADER (OPCIONAL) ===== */
.credits-badge {
  background: rgba(0, 191, 165, 0.15);
  border: 1px solid rgba(0, 191, 165, 0.3);
  border-radius: 30px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--verde-claro);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.credits-badge::before {
  content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300bfa5' stroke-width='2'><polygon points='6 3 18 3 22 9 12 22 2 9'/><line x1='2' y1='9' x2='22' y2='9'/><line x1='6' y1='3' x2='12' y2='22'/><line x1='18' y1='3' x2='12' y2='22'/></svg>");
  font-size: 0.9rem;
}

/* ============================================================
   LAYOUT SIDEBAR — Modelo Fácil (Fase Design 2)
   ============================================================ */

.app-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* === SIDEBAR ESQUERDA === */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-card, #0f2421);
  border-right: 1px solid var(--borda, rgba(0,191,165,0.15));
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px;
  border-bottom: 1px solid var(--borda, rgba(0,191,165,0.1));
  margin-bottom: 12px;
}
.sidebar-logo-icon { font-size: 20px; }
.sidebar-logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--verde-primario, #00bfa5);
  letter-spacing: -0.3px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--texto-secundario, #a8c5c1);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-family: 'Space Grotesk', sans-serif;
  transition: all 0.2s ease;
  width: 100%;
  position: relative;
  z-index: 10;
}
.sidebar-item:hover {
  background: var(--bg-hover, #1a3d39);
  color: var(--texto-principal, #fff);
}
.sidebar-item.active {
  background: rgba(0, 191, 165, 0.15);
  color: var(--verde-claro, #1de9b6);
  font-weight: 600;
}
.sidebar-item-icon { font-size: 16px; flex-shrink: 0; }
.sidebar-item-label { flex: 1; }

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--borda, rgba(0,191,165,0.1));
  padding-top: 12px;
  margin-top: 12px;
}

.sidebar-credits {
  padding: 10px 12px;
  background: rgba(0, 191, 165, 0.08);
  border-radius: 10px;
  margin-bottom: 6px;
}
.credits-plan {
  font-size: 12px;
  font-weight: 600;
  color: var(--verde-primario, #00bfa5);
}
.credits-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--texto-principal, #fff);
  margin-top: 2px;
}
.credits-period {
  font-size: 11px;
  color: var(--texto-muted, #5a8a84);
  margin-top: 2px;
}

/* === MAIN CONTENT === */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-width: 0;
  background: var(--bg-principal, #0a1a18);
}

/* Views (Gerar / Fotos / Vídeos) */
.view-panel { display: none; }
.view-panel.active { display: block; }

/* Tabs de menu (Foto/Vídeo) dentro do Gerar */
.content-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

/* === PAINEL DIREITO === */
.right-panel {
  width: 192px;
  flex-shrink: 0;
  background: var(--bg-card, #0f2421);
  border-left: 1px solid var(--borda, rgba(0,191,165,0.15));
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}
.right-panel-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--texto-secundario, #a8c5c1);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.recent-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.recent-thumb {
  aspect-ratio: 4/5;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-elevado, #163330);
  cursor: pointer;
  transition: transform 0.2s ease;
  border: 1px solid var(--borda, rgba(0,191,165,0.1));
  position: relative;
}
.recent-thumb img,
.recent-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recent-thumb:hover { transform: scale(1.02); }
.recent-thumb-video::after {
  content: '▶';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  background: rgba(0,0,0,0.3);
}
.recent-empty {
  font-size: 12px;
  color: var(--texto-muted, #5a8a84);
  text-align: center;
  padding: 20px 0;
}
.right-panel-link {
  font-size: 12px;
  color: var(--verde-primario, #00bfa5);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font-family: 'Space Grotesk', sans-serif;
  transition: color 0.2s ease;
}
.right-panel-link:hover { color: var(--verde-claro, #1de9b6); }

/* Oculta painel direito quando não está na view Gerar */
.right-panel.hidden { display: none; }

/* === GALERIA (Fotos / Vídeos) === */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.gallery-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--texto-principal, #fff);
}
.gallery-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--borda, rgba(0,191,165,0.15));
  background: transparent;
  color: var(--texto-secundario, #a8c5c1);
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-btn:hover { 
  border-color: var(--verde-primario, #00bfa5); 
  color: var(--verde-primario, #00bfa5); 
}
.filter-btn.active { 
  background: rgba(0,191,165,0.15); 
  border-color: var(--verde-primario, #00bfa5); 
  color: var(--verde-claro, #1de9b6); 
  font-weight: 600; 
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.gallery-item {
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elevado, #163330);
  border: 1px solid var(--borda, rgba(0,191,165,0.1));
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}
.gallery-item:hover {
  border-color: var(--borda-hover, rgba(0,191,165,0.45));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,191,165,0.12);
}
.gallery-item img,
.gallery-item video {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  display: block;
}
.gallery-item-info {
  padding: 10px 12px;
  border-top: 1px solid var(--borda, rgba(0,191,165,0.08));
}
.gallery-item-date {
  font-size: 11px;
  color: var(--texto-muted, #5a8a84);
}
.gallery-item-type {
  font-size: 10px;
  font-weight: 600;
  color: var(--verde-primario, #00bfa5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.gallery-item-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  gap: 4px;
}
.gallery-item:hover .gallery-item-actions { display: flex; }
.gallery-item.show-actions .gallery-item-actions { display: flex; }
@media (hover: none) {
  .gallery-item-actions { display: flex; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  .gallery-item.show-actions .gallery-item-actions { opacity: 1; pointer-events: auto; }
}
.gallery-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  border: none;
  color: white;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.gallery-action-btn:hover {
  background: var(--verde-primario, #00bfa5);
  transform: scale(1.1);
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--texto-muted, #5a8a84);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.gallery-empty-icon { font-size: 48px; opacity: 0.5; }
.gallery-empty p { font-size: 14px; }

/* Esconde header antigo (mantido para compatibilidade com JS) */
.app-header { display: none !important; }

/* Ajusta app-container que estava no layout antigo */
.app-container {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Responsivo — mobile sem sidebar */
@media (max-width: 768px) {
  .app-wrapper {
    flex-direction: column;
  }
  .sidebar {
    display: none;
  }
  .right-panel {
    display: none;
  }
  .main-content {
    padding: 16px;
  }
  .gallery-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* ===== FASE DESIGN 3 — Gallery Stats, Loading & Modal ===== */

/* Gallery Stats */
.gallery-stats {
  display: flex;
  gap: 24px;
  align-items: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--verde-claro);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--texto-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Gallery Loading */
.gallery-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--bg-elevado);
  border-top-color: var(--verde-primario);
  border-right-color: var(--verde-claro);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.gallery-loading p {
  color: var(--texto-secundario);
  font-size: 0.9rem;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
}

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

.modal-large {
  max-width: 800px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--borda);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--texto-principal);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--texto-muted);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--texto-principal);
}

.modal-body {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-preview {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-principal);
  margin-bottom: 24px;
}

.modal-preview img,
.modal-preview video {
  width: 100%;
  height: auto;
  display: block;
}

.modal-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-elevado);
  border-radius: var(--radius-sm);
}

.info-label {
  font-size: 0.85rem;
  color: var(--texto-muted);
  font-weight: 600;
}

.info-row > span:last-child {
  color: var(--texto-principal);
  font-weight: 500;
}

.modal-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--borda);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Danger Button */
.btn-danger {
  background: var(--acento-coral);
  color: #fff;
  padding: 12px 20px;
  border-radius: 50px;
  border: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-danger:hover {
  background: #ff5252;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
  transform: translateY(-2px);
}

/* Gallery Item Badges */
.gallery-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
}

.gallery-badge.processing {
  background: rgba(255, 215, 0, 0.9);
  color: #0a1a18;
}

.gallery-badge.completed {
  background: rgba(29, 233, 182, 0.9);
  color: #0a1a18;
}

.gallery-badge.failed {
  background: rgba(255, 107, 107, 0.9);
  color: #fff;
}

/* ===== SETTINGS PAGE ===== */
.settings-header {
  margin-bottom: 32px;
}

.settings-title {
  font-size: 2rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--texto-principal);
}

.settings-content {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.settings-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--texto-principal);
  margin-bottom: 16px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--borda);
}

.settings-row:last-of-type {
  border-bottom: none;
}

.settings-label {
  font-size: 0.9rem;
  color: var(--texto-muted);
  font-weight: 600;
}

.settings-value {
  font-size: 0.95rem;
  color: var(--texto-principal);
  font-weight: 500;
}

.settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--borda);
}

/* ===== ÍCONES SVG ===== */
.icon, .sidebar-item-icon, .menu-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.sidebar-item-icon svg { width: 18px; height: 18px; }
.menu-tab-icon svg { width: 20px; height: 20px; }
.gallery-empty-icon svg { width: 48px; height: 48px; opacity: 0.4; }
.upload-icon svg { width: 32px; height: 32px; opacity: 0.6; }
.benefit-icon svg { width: 20px; height: 20px; }
.card-icon svg { width: 18px; height: 18px; }
.btn-primary svg, .btn-secondary svg, .btn-danger svg { width: 15px; height: 15px; margin-right: 4px; }
.upload-change-btn svg { width: 14px; height: 14px; margin-right: 4px; }

/* Remove cursor de texto em SVGs dentro de botões */
button svg { pointer-events: none; }

/* Logo sidebar styling */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--borda);
}

.sidebar-logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--texto-principal);
  letter-spacing: -0.02em;
}

/* ===== PRESET MODELS GRID ===== */
.preset-models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px;
}

.preset-model-card {
  background: #0f2421;
  border: 2px solid rgba(0,191,165,0.15);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-model-card:hover {
  border-color: #00bfa5;
  transform: translateY(-2px);
}

.preset-model-card.selected {
  border-color: #00bfa5;
  box-shadow: 0 0 0 2px rgba(0,191,165,0.3);
}

.preset-model-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top;
  display: block;
}

.preset-model-info {
  padding: 6px 8px;
}

.preset-model-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.preset-model-tags {
  display: block;
  font-size: 10px;
  color: #6b9e98;
  margin-top: 2px;
}
