/* ============================================
   CARD VIEW — Full Page
   ============================================ */
.card-fullpage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-lg);
  background: var(--theme-bg, #0f0a2e);
}

.card-fullpage .card-container {
  animation: fadeInUp 0.6s ease forwards;
}

.card-share-bar {
  margin-top: var(--space-lg);
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.card-share-bar .btn {
  font-size: 0.85rem;
}

.card-qr {
  background: white;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  margin-top: var(--space-md);
  animation: fadeInUp 0.6s ease 0.4s both;
}

.card-qr img {
  width: 140px;
  height: 140px;
}

/* ============================================
   Toast Notification (Top-anchored for mobile visibility)
   ============================================ */
.toast {
  position: fixed;
  top: 24px;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  background: var(--bg-surface, #1e1e2d);
  border: 1.5px solid var(--border-glow, #8b5cf6);
  border-radius: var(--radius-md, 12px);
  padding: 12px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
  z-index: 999999;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55), var(--shadow-glow);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  max-width: 90vw;
  text-align: center;
  pointer-events: none;
  opacity: 0;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   In-Card Auth Alerts
   ============================================ */
.auth-alert {
  display: none;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
}

.auth-alert.error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(239, 68, 68, 0.18);
  border: 1.5px solid #ef4444;
  color: #fecaca;
  animation: authAlertShake 0.4s ease;
}

.auth-alert.success {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(16, 185, 129, 0.18);
  border: 1.5px solid #10b981;
  color: #a7f3d0;
}

.auth-alert.info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(139, 92, 246, 0.18);
  border: 1.5px solid #8b5cf6;
  color: #ddd6fe;
}

@keyframes authAlertShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ============================================
   Floating WhatsApp Button
   ============================================ */
.fab-whatsapp {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25d366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 50;
  transition: all var(--transition-normal);
  animation: fabPulse 3s ease-in-out infinite;
  text-decoration: none;
  cursor: pointer;
}

.fab-whatsapp:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

@keyframes fabPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 4px 40px rgba(37, 211, 102, 0.6), 0 0 0 10px rgba(37, 211, 102, 0.1); }
}

/* ============================================
   Form Success State
   ============================================ */
.form-success {
  text-align: center;
  padding: var(--space-xl);
  animation: fadeInUp 0.4s ease;
}

.form-success .check-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto var(--space-md);
}

.form-success h4 {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.form-success p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-in {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.animate-in:nth-child(1) { animation-delay: 0.1s; }
.animate-in:nth-child(2) { animation-delay: 0.2s; }
.animate-in:nth-child(3) { animation-delay: 0.3s; }
.animate-in:nth-child(4) { animation-delay: 0.4s; }
.animate-in:nth-child(5) { animation-delay: 0.5s; }
.animate-in:nth-child(6) { animation-delay: 0.6s; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .builder-layout {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 8vw, 3.5rem);
  }

  .hero-mockup-card {
    max-width: 300px;
  }

  .showcase-grid {
    gap: 24px;
  }

  .showcase-video-col,
  .showcase-phone-col {
    max-width: 100%;
  }

  .video-shell-header {
    min-height: 38px;
    padding: 0 10px 8px;
  }

  .video-shell-title {
    font-size: 0.75rem;
  }

  .landing-carousel { border-radius: 18px; }
  .landing-carousel-arrow { width: 38px; height: 38px; font-size: 1.65rem; }
  .landing-carousel-prev { left: 8px; }
  .landing-carousel-next { right: 8px; }
  .landing-carousel-copy { padding: 54px 52px 34px; }
  .landing-carousel-copy p { display: none; }
  .landing-carousel-dots { bottom: 10px; }

  .theme-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-share-bar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .navbar-cta .btn span.hide-mobile {
    display: none;
  }

  .generate-section {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .card-contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-body {
    padding: var(--space-md) var(--space-md) var(--space-lg);
  }
}

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer a {
  color: var(--purple);
  font-weight: 600;
}

.cardlink-support-whatsapp {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 34px rgba(37, 211, 102, 0.34);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.cardlink-support-whatsapp:hover {
  transform: translateY(-2px);
  background: #20bd5a;
  color: #fff;
  box-shadow: 0 16px 40px rgba(37, 211, 102, 0.42);
}

.cardlink-support-whatsapp:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.3);
  outline-offset: 3px;
}

.cardlink-support-whatsapp-icon {
  font-size: 1.2rem;
  line-height: 1;
}

@media (max-width: 480px) {
  .cardlink-support-whatsapp {
    right: 14px;
    bottom: 14px;
    min-height: 48px;
    padding: 10px 14px;
    font-size: 0.78rem;
  }
}

/* ============================================
   AUTH VIEW
   ============================================ */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(88px + var(--space-xl)) var(--space-xl) var(--space-2xl);
  scroll-margin-top: 88px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  backdrop-filter: blur(20px);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: var(--space-xs);
}

.auth-subtitle {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.auth-toggle {
  text-align: center;
  margin-top: var(--space-lg);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-toggle a {
  color: var(--purple);
  font-weight: 600;
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}

.dash-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
  position: relative;
}

.dash-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.dash-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.dash-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: white;
  flex-shrink: 0;
}

.dash-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.dash-card-slug {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dash-card-stats {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.dash-card-stats span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.dash-card-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ============================================
   CONTACTS VIEW
   ============================================ */
.contacts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-item {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: var(--transition-normal);
}

.contact-item:hover {
  border-color: var(--border-glow);
}

.contact-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.contact-item-name {
  font-weight: 700;
  font-family: var(--font-display);
}

.contact-item-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.contact-item-details {
  display: flex;
  gap: var(--space-lg);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.contact-item-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}

/* ============================================
   PHOTO UPLOAD
   ============================================ */
.photo-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  background: var(--bg-surface);
  min-height: 120px;
}

.photo-upload-area:hover {
  border-color: var(--purple);
  background: var(--bg-surface-hover);
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--transition-normal);
}

.stat-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  color: var(--purple, #7c3aed);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ============================================
   DASH CARD FULL (single card)
   ============================================ */
.dash-card-full {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.dash-card-full:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.dash-card-full-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  flex-wrap: wrap;
}

.dash-card-actions-bar {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dash-card-full-header {
    flex-direction: column;
    text-align: center;
  }

  .dash-card-full-header > div:last-child {
    justify-content: center;
  }
}

/* ============================================
   PWA INSTALL BANNER
   ============================================ */
.install-banner {
  position: fixed;
  bottom: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 400px;
  background: linear-gradient(135deg, rgba(30, 20, 50, 0.97), rgba(20, 15, 35, 0.97));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  transition: bottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.15);
}

.install-banner.show {
  bottom: 24px;
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.install-banner-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.15);
  border-radius: 14px;
  flex-shrink: 0;
}

.install-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.install-banner-text strong {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.install-banner-text span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.install-banner-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.install-btn-install {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.3s ease;
}

.install-btn-install:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.install-btn-dismiss {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.install-btn-dismiss:hover {
  border-color: var(--text-muted);
  color: var(--text-secondary);
}


@media (max-width: 600px) {
  .auth-container {
    padding: 92px 14px 32px;
  }

  .auth-card {
    padding: 22px 18px;
  }
}


/* Auth UX — ações críticas sempre legíveis */
.auth-card .auth-action-button,
.auth-card .btn-primary {
  background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 800;
  text-shadow: none !important;
  opacity: 1;
}

.auth-card .btn-secondary {
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
}

.auth-card button:disabled {
  cursor: not-allowed;
  transform: none !important;
}

.auth-card .auth-action-button:disabled,
.auth-card .btn-primary:disabled {
  background: #6d28d9 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 0.72 !important;
}

.auth-code-status {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
  padding: 13px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.auth-code-status-success {
  background: rgba(16,185,129,0.10);
  border: 1px solid rgba(16,185,129,0.42);
  color: var(--text-primary);
}

.auth-code-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.auth-link-button {
  padding: 0;
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: underline;
  background: transparent;
}

.auth-link-button:disabled {
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  text-decoration: none;
}

@media (max-width: 480px) {
  .auth-code-actions {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}
