/* ════════════════════════════════════════════════════════════════════════════════
   FROGGY PIXEL – AI DESIGN GENERATOR
   Design System: Aligned with Landing + Create-Company Premium
   v5.5 — Validation alerts + Scroll preview + Card ordering
   ════════════════════════════════════════════════════════════════════════════════ */


/* ════════════════════════════════════════════════════════════════════════════════
   🎨 SECTION 1 · DESIGN TOKENS
   ════════════════════════════════════════════════════════════════════════════════ */

:root {
  /* PRIMARY PALETTE */
  --dg-primary-700: #6d28d9;
  --dg-primary-600: #7c3aed;
  --dg-primary-500: #8b5cf6;
  --dg-primary-400: #a78bfa;
  --dg-primary-300: #c4b5fd;
  --dg-primary-200: #ddd6fe;
  --dg-primary-100: #ede9fe;
  --dg-primary-50:  #f5f3ff;

  --dg-secondary-600: #3b82f6;
  --dg-secondary-500: #60a5fa;

  --dg-accent-600: #10b981;
  --dg-accent-500: #34d399;

  /* FACEBOOK BLUE (contextual accent) */
  --dg-fb-600: #1877f2;
  --dg-fb-500: #4599f7;
  --dg-fb-100: #e8f0fe;

  /* NEUTRALS */
  --dg-neutral-950: #0f172a;
  --dg-neutral-900: #1a1f3a;
  --dg-neutral-800: #1e293b;
  --dg-neutral-700: #334155;
  --dg-neutral-600: #475569;
  --dg-neutral-500: #64748b;
  --dg-neutral-400: #94a3b8;
  --dg-neutral-300: #cbd5e1;
  --dg-neutral-200: #e2e8f0;
  --dg-neutral-100: #f1f5f9;
  --dg-neutral-50:  #f8fafc;
  --dg-white: #ffffff;

  /* SEMANTIC */
  --dg-success: #10b981;
  --dg-warning: #f59e0b;
  --dg-error:   #ef4444;

  /* TYPOGRAPHY */
  --dg-font-display: 'Space Grotesk', system-ui, sans-serif;
  --dg-font-body:    'Inter', system-ui, sans-serif;
  --dg-font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* RADIUS */
  --dg-radius-sm:   8px;
  --dg-radius-md:   12px;
  --dg-radius-lg:   16px;
  --dg-radius-xl:   20px;
  --dg-radius-2xl:  24px;
  --dg-radius-full: 9999px;

  /* SHADOWS */
  --dg-shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
  --dg-shadow-sm:  0 2px 6px rgba(0,0,0,0.06);
  --dg-shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --dg-shadow-lg:  0 8px 24px rgba(0,0,0,0.1);
  --dg-shadow-xl:  0 16px 48px rgba(0,0,0,0.12);
  --dg-shadow-glow: 0 0 40px rgba(124, 58, 237, 0.12);

  /* TRANSITIONS */
  --dg-ease-out:    300ms ease-out;
  --dg-ease-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ════════════════════════════════════════════════════════════════════════════════
   ✨ SECTION 2 · KEYFRAME ANIMATIONS
   ════════════════════════════════════════════════════════════════════════════════ */

@keyframes dg-fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes dg-slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes dg-pulse-glow {
  0%, 100% { box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12); }
  50%      { box-shadow: 0 8px 28px rgba(124, 58, 237, 0.22); }
}

@keyframes dg-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

@keyframes dg-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes dg-blob-float {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33%      { transform: translate(12px, -20px) scale(1.04) rotate(120deg); }
  66%      { transform: translate(-8px, 10px) scale(0.97) rotate(240deg); }
}

@keyframes dg-float-icon {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

@keyframes dg-checkmark {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes dg-card-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* v5.3 — Company gate modal animation */
@keyframes dg-cg-slideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dg-cg-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* v5.5 — Validation alert pulse */
@keyframes dg-validation-pulse {
  0%   { border-color: rgba(245, 158, 11, 0.18); }
  50%  { border-color: rgba(245, 158, 11, 0.35); }
  100% { border-color: rgba(245, 158, 11, 0.18); }
}


/* ════════════════════════════════════════════════════════════════════════════════
   🌐 SECTION 3 · PAGE SHELL
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-page .content {
  padding: 0.75rem 1rem 2rem;
}


/* ════════════════════════════════════════════════════════════════════════════════
   📐 SECTION 4 · LAYOUT – TWO-COLUMN
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-layout-row {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.25rem;
  align-items: start;
  animation: dg-fadeInUp 0.7s ease-out;
}

@media (max-width: 1100px) {
  .dg-layout-row {
    grid-template-columns: 1fr;
  }
}


/* ════════════════════════════════════════════════════════════════════════════════
   🃏 SECTION 5 · CONTROL PANEL (left card)
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-control-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.88) 0%, rgba(255,255,255,0.78) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid rgba(124, 58, 237, 0.1);
  border-radius: var(--dg-radius-2xl);
  padding: 1.75rem;
  box-shadow: var(--dg-shadow-lg), var(--dg-shadow-glow);
  position: relative;
  overflow: hidden;
  animation: dg-scaleIn 0.5s ease-out 0.1s both;
  position: sticky;
  top: 70px;
}

.dg-control-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--dg-primary-600), var(--dg-secondary-600), var(--dg-accent-600));
  border-radius: var(--dg-radius-2xl) var(--dg-radius-2xl) 0 0;
  z-index: 1;
}

.dg-control-title {
  font-family: var(--dg-font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--dg-neutral-800);
  margin: 0 0 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dg-control-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--dg-primary-600), var(--dg-secondary-600));
  border-radius: var(--dg-radius-sm);
  color: white;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

/* v5.5 — Reduced spacing: badge margin-bottom 1.5rem → 0.75rem */
.dg-format-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: var(--dg-fb-100);
  border: 1.5px solid rgba(24, 119, 242, 0.2);
  border-radius: var(--dg-radius-full);
  font-family: var(--dg-font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dg-fb-600);
  margin-bottom: 0.5rem;
}

.dg-format-badge i {
  font-size: 1rem;
}

.dg-format-badge-size {
  font-family: var(--dg-font-mono);
  font-weight: 700;
  font-size: 0.68rem;
  opacity: 0.8;
}


/* ════════════════════════════════════════════════════════════════════════════════
   📝 SECTION 6 · SECTION TITLES
   ════════════════════════════════════════════════════════════════════════════════ */

/* v5.5 — Reduced top margin: 1.5rem → 0.85rem for tighter spacing */
.dg-section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.85rem 0 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1.5px solid rgba(124, 58, 237, 0.08);
}

.dg-section-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(59, 130, 246, 0.07) 100%);
  border-radius: var(--dg-radius-sm);
  color: var(--dg-primary-600);
  font-size: 0.85rem;
  flex-shrink: 0;
  animation: dg-float-icon 3s ease-in-out infinite;
}

.dg-section-title:hover .dg-section-icon {
  transform: scale(1.08) rotate(-5deg);
  transition: transform var(--dg-ease-out);
}

.dg-section-title-text {
  font-family: var(--dg-font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dg-neutral-700);
  margin: 0;
  letter-spacing: -0.01em;
}


/* ════════════════════════════════════════════════════════════════════════════════
   🎯 SECTION 7 · OBJECTIVE CARDS — v5.4
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-objectives-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.dg-obj-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 0.5rem;
  min-height: 88px;
  background: var(--dg-white);
  border: 1.5px solid var(--dg-neutral-200);
  border-radius: var(--dg-radius-md);
  cursor: pointer;
  transition: all 250ms ease-out;
  position: relative;
  overflow: hidden;
  user-select: none;
  text-align: center;
}

.dg-obj-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--dg-primary-600), var(--dg-secondary-600));
  border-radius: var(--dg-radius-md) var(--dg-radius-md) 0 0;
  opacity: 0;
  transition: opacity 250ms ease, height 250ms ease;
}

.dg-obj-card:hover {
  border-color: var(--dg-primary-300);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.08);
}
.dg-obj-card:hover::before {
  opacity: 0.5;
}

.dg-obj-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
  transition: all 250ms ease;
}

.dg-obj-card:hover .dg-obj-card-icon {
  background: rgba(124, 58, 237, 0.1);
  transform: scale(1.08);
}

.dg-obj-card-text {
  font-family: var(--dg-font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dg-neutral-600);
  line-height: 1.25;
  transition: color 200ms ease;
}

.dg-obj-card:hover .dg-obj-card-text {
  color: var(--dg-neutral-800);
}

.dg-obj-card--selected {
  border-color: var(--dg-primary-500) !important;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.06) 0%, rgba(255, 255, 255, 1) 100%) !important;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.1) !important;
}

.dg-obj-card--selected::before {
  opacity: 1 !important;
  height: 4px;
}

.dg-obj-card--selected .dg-obj-card-icon {
  background: rgba(124, 58, 237, 0.12);
  transform: scale(1.06);
}

.dg-obj-card--selected .dg-obj-card-text {
  color: var(--dg-primary-700);
  font-weight: 700;
}

.dg-obj-card-img {
  display: none !important;
}


/* ════════════════════════════════════════════════════════════════════════════════
   ✏️  SECTION 8 · PROMPT TEXTAREA
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-prompt-wrap {
  margin-bottom: 0.75rem;
}

.dg-prompt-wrap .mantine-Textarea-input,
.dg-prompt-wrap textarea {
  font-family: var(--dg-font-body) !important;
  font-size: 0.86rem !important;
  font-weight: 500 !important;
  color: var(--dg-neutral-800) !important;
  background: var(--dg-white) !important;
  border: 1.5px solid var(--dg-neutral-200) !important;
  border-radius: var(--dg-radius-md) !important;
  padding: 0.85rem 1rem !important;
  line-height: 1.6 !important;
  transition: all 250ms ease-out !important;
  box-shadow: var(--dg-shadow-xs) !important;
}

.dg-prompt-wrap .mantine-Textarea-input::placeholder,
.dg-prompt-wrap textarea::placeholder {
  color: var(--dg-neutral-400) !important;
  font-weight: 400 !important;
}

.dg-prompt-wrap .mantine-Textarea-input:hover,
.dg-prompt-wrap textarea:hover {
  border-color: var(--dg-primary-300) !important;
  box-shadow: var(--dg-shadow-sm) !important;
}

.dg-prompt-wrap .mantine-Textarea-input:focus,
.dg-prompt-wrap textarea:focus {
  border-color: var(--dg-primary-500) !important;
  box-shadow:
    0 0 0 3px rgba(124, 58, 237, 0.1),
    var(--dg-shadow-sm) !important;
  outline: none !important;
}


/* ════════════════════════════════════════════════════════════════════════════════
   🔘 SECTION 9 · GENERATE BUTTON — PREMIUM CTA
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-generate-wrap {
  padding-top: 0.5rem;
}

.dg-btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  font-family: var(--dg-font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: white !important;
  background: linear-gradient(135deg, var(--dg-primary-600) 0%, var(--dg-secondary-600) 100%) !important;
  border: none !important;
  border-radius: var(--dg-radius-lg);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
  transition: all var(--dg-ease-spring);
}

.dg-btn-generate::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.5s ease;
}

.dg-btn-generate:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(124, 58, 237, 0.4);
}

.dg-btn-generate:hover::before {
  left: 100%;
}

.dg-btn-generate:active {
  transform: translateY(-1px);
}

.dg-btn-generate i {
  font-size: 1rem;
}


/* ════════════════════════════════════════════════════════════════════════════════
   ⚠️  SECTION 9.5 · VALIDATION ALERT — v5.5
   Subtle inline alert below generate button. Amber/warm tone, not aggressive.
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-validation-alert {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  margin-top: 0.65rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, rgba(245, 158, 11, 0.02) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.18);
  animation: dg-slideDown 0.3s ease-out both, dg-validation-pulse 2.5s ease-in-out 0.5s 2;
}

.dg-validation-alert i {
  color: var(--dg-warning);
  font-size: 0.78rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.dg-validation-alert span {
  font-family: var(--dg-font-body);
  font-size: 0.76rem;
  font-weight: 600;
  color: #92400e;
  line-height: 1.35;
}


/* ════════════════════════════════════════════════════════════════════════════════
   🖼️  SECTION 10 · PREVIEW PANEL (right card)
   v5.5 — Flex column layout with internal scroll area.
   The title stays pinned at the top; results scroll inside.
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-preview-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.72) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(124, 58, 237, 0.08);
  border-radius: var(--dg-radius-2xl);
  padding: 1.75rem;
  box-shadow: var(--dg-shadow-lg), var(--dg-shadow-glow);
  position: sticky;
  top: 70px;
  /* v5.5 — Fixed height, flex column for internal scroll */
  display: flex;
  flex-direction: column;
  height: calc(123vh - 84px);
  overflow: hidden;
  animation: dg-scaleIn 0.5s ease-out 0.2s both;
}

.dg-preview-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--dg-primary-600), var(--dg-secondary-600));
  border-radius: var(--dg-radius-2xl) var(--dg-radius-2xl) 0 0;
}

.dg-preview-title {
  font-family: var(--dg-font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--dg-neutral-800);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.dg-preview-title i {
  color: var(--dg-primary-500);
}


/* ── Scroll area: wraps placeholder + results ── */
.dg-preview-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;   /* space for scrollbar */
  scroll-behavior: smooth;
}

/* Custom scrollbar — subtle, premium */
.dg-preview-scroll-area::-webkit-scrollbar {
  width: 5px;
}

.dg-preview-scroll-area::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

.dg-preview-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.15);
  border-radius: 10px;
  transition: background 200ms ease;
}

.dg-preview-scroll-area::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 58, 237, 0.3);
}

/* Firefox scrollbar */
.dg-preview-scroll-area {
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.15) transparent;
}


/* ════════════════════════════════════════════════════════════════════════════════
   🫥 SECTION 11 · EMPTY / PLACEHOLDER STATE
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  min-height: 400px;
  animation: dg-fadeIn 0.6s ease-out;
}

.dg-empty-state-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(59, 130, 246, 0.07) 100%);
  border-radius: var(--dg-radius-xl);
  color: var(--dg-primary-400);
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  animation: dg-float-icon 3s ease-in-out infinite;
}

.dg-empty-state-title {
  font-family: var(--dg-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dg-neutral-600);
  margin: 0 0 0.4rem;
}

.dg-empty-state-sub {
  font-size: 0.82rem;
  color: var(--dg-neutral-400);
  margin: 0;
  max-width: 280px;
}


/* ════════════════════════════════════════════════════════════════════════════════
   📦 SECTION 12 · RESULTS CONTAINER
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-results {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  padding-bottom: 1rem;
}


/* ════════════════════════════════════════════════════════════════════════════════
   📇 SECTION 13 · RESULT CARD
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-result-card {
  background: var(--dg-white);
  border: 1.5px solid rgba(124, 58, 237, 0.08);
  border-radius: var(--dg-radius-xl);
  padding: 1.25rem;
  box-shadow: var(--dg-shadow-sm);
  transition: all var(--dg-ease-out);
  animation: dg-card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
  overflow: hidden;
}

.dg-result-card:hover {
  border-color: rgba(124, 58, 237, 0.18);
  box-shadow: var(--dg-shadow-md);
  transform: translateY(-2px);
}

.dg-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--dg-neutral-100);
}

.dg-result-title {
  font-family: var(--dg-font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dg-primary-600);
}

.dg-result-timestamp {
  font-family: var(--dg-font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--dg-neutral-400);
  background: var(--dg-neutral-50);
  padding: 0.25rem 0.6rem;
  border-radius: var(--dg-radius-full);
}

.dg-result-img-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: var(--dg-radius-lg);
  overflow: hidden;
  background: var(--dg-neutral-50);
}

.dg-result-img-wrap img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--dg-radius-md);
  animation: dg-fadeIn 0.5s ease-out;
}


/* ════════════════════════════════════════════════════════════════════════════════
   ⏳ SECTION 14 · LOADER CARD
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-loader-card {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.04) 0%, rgba(59, 130, 246, 0.03) 100%);
  border: 2px solid rgba(124, 58, 237, 0.18);
  border-radius: var(--dg-radius-xl);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  animation: dg-pulse-glow 3s ease-in-out infinite, dg-card-in 0.5s ease-out both;
}

.dg-loader-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.06), transparent);
  animation: dg-shimmer 2s ease-in-out infinite;
  pointer-events: none;
}

.dg-loader-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.dg-loader-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dg-primary-600), var(--dg-secondary-600));
  border-radius: 50%;
  color: white;
  font-size: 1.3rem;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
  animation: dg-float-icon 2s ease-in-out infinite;
}

.dg-loader-text {
  font-family: var(--dg-font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dg-primary-600);
  margin: 0;
  text-align: center;
}

.dg-loader-subtext {
  font-size: 0.78rem;
  color: var(--dg-neutral-500);
  margin: 0;
  text-align: center;
}

.dg-loader-progress {
  width: 160px;
  height: 4px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(124, 58, 237, 0.1);
}

.dg-loader-progress-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--dg-primary-600), var(--dg-secondary-600), var(--dg-accent-600), var(--dg-primary-600));
  background-size: 200% 100%;
  border-radius: 4px;
  animation: dg-gradient-shift 2s ease infinite;
}


/* ════════════════════════════════════════════════════════════════════════════════
   ❌ SECTION 15 · ERROR CARD
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-error-card {
  background: var(--dg-white);
  border: 1.5px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--dg-radius-xl);
  padding: 1.25rem;
  animation: dg-card-in 0.5s ease-out both;
}

.dg-error-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 0.75rem;
  text-align: center;
}

.dg-error-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 50%;
  color: var(--dg-error);
  font-size: 1.3rem;
}

.dg-error-text {
  font-family: var(--dg-font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dg-error);
  margin: 0;
}

.dg-error-detail {
  font-size: 0.78rem;
  color: var(--dg-neutral-500);
  margin: 0;
  max-width: 320px;
}


/* ════════════════════════════════════════════════════════════════════════════════
   ⚡ SECTION 16 · ACTION BUTTONS
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-actions {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dg-actions-row {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  flex-wrap: wrap;
}

.dg-act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  font-family: var(--dg-font-body);
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--dg-radius-md);
  cursor: pointer;
  transition: all 250ms ease-out;
  border: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.dg-act-btn--secondary {
  background: var(--dg-white);
  color: var(--dg-neutral-600);
  border: 1.5px solid var(--dg-neutral-200);
}

.dg-act-btn--secondary:hover {
  border-color: var(--dg-primary-300);
  color: var(--dg-primary-600);
  background: var(--dg-primary-50);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.08);
}

.dg-act-btn--primary {
  background: linear-gradient(135deg, var(--dg-primary-600) 0%, var(--dg-secondary-600) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}

.dg-act-btn--primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.4s ease;
}

.dg-act-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.dg-act-btn--primary:hover::before {
  left: 100%;
}

.dg-act-btn i {
  font-size: 0.78rem;
}


/* ════════════════════════════════════════════════════════════════════════════════
   🔔 SECTION 17 · TOAST
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-toast.toast {
  border: none !important;
  border-radius: var(--dg-radius-lg) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
  overflow: hidden !important;
  font-family: var(--dg-font-body) !important;
  backdrop-filter: blur(12px) !important;
}

.dg-toast .toast-header {
  font-family: var(--dg-font-display) !important;
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  border-bottom: none !important;
  padding: 0.75rem 1rem 0.25rem !important;
}

.dg-toast .toast-body {
  padding: 0.25rem 1rem 0.75rem !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
}


/* ════════════════════════════════════════════════════════════════════════════════
   🏢 SECTION 18 · COMPANY GATE MODAL — v5.3
   ════════════════════════════════════════════════════════════════════════════════ */

.dg-company-gate-modal .modal-dialog {
  max-width: 440px;
}
.dg-company-gate-modal-content {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.dg-company-gate-modal .modal-body {
  padding: 0 !important;
}

.dg-cg-inner {
  position: relative;
  background: linear-gradient(165deg, rgba(255,255,255,0.97) 0%, rgba(248,246,255,0.95) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid rgba(124, 58, 237, 0.12);
  border-radius: var(--dg-radius-2xl);
  padding: 2.5rem 2.5rem 2rem;
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.12),
    0 8px 24px rgba(124, 58, 237, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  text-align: center;
  overflow: hidden;
  animation: dg-cg-slideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dg-cg-top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--dg-primary-600),
    var(--dg-secondary-600),
    var(--dg-accent-600));
  border-radius: var(--dg-radius-2xl) var(--dg-radius-2xl) 0 0;
}

.dg-cg-icon-cluster {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dg-cg-icon-main {
  position: relative;
  z-index: 2;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--dg-primary-600) 0%, var(--dg-secondary-600) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.35);
  animation: dg-cg-float 3s ease-in-out infinite;
  flex-shrink: 0;
}

.dg-cg-title {
  font-family: var(--dg-font-display);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #1e3a8a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dg-cg-subtitle {
  font-size: 0.88rem;
  color: var(--dg-neutral-500);
  line-height: 1.6;
  margin: 0 auto 1.5rem;
  max-width: 340px;
}

.dg-cg-benefits {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
  text-align: left;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.dg-cg-benefit {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dg-cg-benefit-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 200ms ease;
}

.dg-cg-benefit:hover .dg-cg-benefit-icon {
  background: rgba(124, 58, 237, 0.12);
  transform: scale(1.08);
}

.dg-cg-benefit-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dg-neutral-700);
}

.dg-cg-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
}

.dg-cg-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: var(--dg-font-display);
  background: linear-gradient(135deg, var(--dg-primary-600) 0%, var(--dg-secondary-600) 100%);
  color: white !important;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
  transition: all 300ms ease-out;
  position: relative;
  overflow: hidden;
}

.dg-cg-btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 200%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
  transition: left 600ms ease;
}

.dg-cg-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(124, 58, 237, 0.4);
  color: white !important;
  text-decoration: none !important;
}

.dg-cg-btn-primary:hover::before {
  left: 100%;
}

.dg-cg-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.5rem;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dg-neutral-400);
  background: transparent;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 250ms ease;
}

.dg-cg-btn-secondary:hover {
  color: var(--dg-neutral-600);
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.12);
}

.dg-cg-footer-note {
  font-size: 0.68rem;
  color: var(--dg-neutral-400);
  margin: 1rem 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}


/* ════════════════════════════════════════════════════════════════════════════════
   📱 SECTION 19 · RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
  .dg-control-card {
    position: static;
  }

  /* On single-column layout, preview card is not sticky, uses auto height */
  .dg-preview-card {
    position: static;
    height: auto;
    max-height: 80vh;
  }
}

@media (max-width: 768px) {
  .dg-objectives-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .dg-actions-row {
    flex-direction: column;
  }

  .dg-act-btn {
    width: 100%;
  }

  .dg-control-card,
  .dg-preview-card {
    padding: 1.25rem;
    border-radius: var(--dg-radius-xl);
  }

  .dg-preview-card {
    min-height: 400px;
    height: auto;
    max-height: 70vh;
  }

  /* Company gate modal responsive */
  .dg-cg-inner {
    padding: 2rem 1.5rem 1.5rem;
    border-radius: var(--dg-radius-xl);
  }
  .dg-cg-title { font-size: 1.15rem; }
  .dg-cg-subtitle { font-size: 0.82rem; }
  .dg-cg-btn-primary { padding: 0.75rem 1.5rem; font-size: 0.85rem; }
}

@media (max-width: 576px) {
  .dg-objectives-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dg-format-badge {
    font-size: 0.65rem;
  }

  .dg-obj-card {
    padding: 0.65rem 0.7rem;
  }

  .dg-cg-inner { padding: 1.75rem 1.25rem 1.25rem; }
  .dg-cg-benefits { max-width: 100%; }
}


/* ════════════════════════════════════════════════════════════════════════════════
   ♿ SECTION 20 · A11Y & MOTION PREFS
   ════════════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.dg-obj-card:focus-visible,
.dg-btn-generate:focus-visible,
.dg-act-btn:focus-visible {
  outline: 2px solid var(--dg-primary-500);
  outline-offset: 2px;
}


.dg-rate-limit-modal-content {
  background: #ffffff !important;
  border: 1.5px solid rgba(124, 58, 237, 0.12) !important;
  border-radius: var(--dg-radius-2xl) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12) !important;
}

.dg-rate-limit-modal .modal-body {
  padding: 0 !important;
}

/* ── Objetivo deshabilitado ─────────────────────────── */
.dg-obj-card--disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    pointer-events: auto;     /* necesario para que el title/tooltip se muestre */
    filter: grayscale(0.6);
    position: relative;
}
.dg-obj-card--disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: rgba(148,163,184,0.3) !important;
}





/* ── Style Pills ────────────────────────────────────── */
.dg-style-pills-row {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    margin-bottom: 1.25rem;
}
.dg-style-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1.5px solid rgba(124, 58, 237, 0.25);
    background: rgba(124, 58, 237, 0.06);
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.dg-style-pill i {
    color: #94a3b8;
    transition: color 0.2s ease;
}
.dg-style-pill:hover {
    border-color: rgba(124, 58, 237, 0.5);
    background: rgba(124, 58, 237, 0.1);
    color: #1e293b;
}
.dg-style-pill:hover i {
    color: #7c3aed;
}
.dg-style-pill--selected {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(59, 130, 246, 0.12));
    border-color: rgba(124, 58, 237, 0.5);
    color: #7c3aed;
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.1);
}
.dg-style-pill--selected i {
    color: #7c3aed;
}




/* ═══════════════════════════════════════════════════════════════
   DOWNLOAD DROPDOWN — Selector de formato
   ═══════════════════════════════════════════════════════════════ */

/* Wrapper del dropdown */
.dg-dl-wrapper {
    position: relative;
    display: inline-block;
}

/* Trigger: el botón principal de Descargar */
.dg-dl-trigger {
    cursor: pointer;
    user-select: none;
}

/* Chevron rota al abrir */
.dg-dl-wrapper:focus-within .dg-dl-trigger .fa-chevron-down {
    transform: rotate(180deg);
}

/* El menú dropdown — oculto por defecto */
.dg-dl-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 6px;
    box-shadow:
        0 -8px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.97);
    transition:
        opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.2s;
    z-index: 100;
}

/* Flecha/pico del dropdown */
.dg-dl-dropdown::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
}

/* Mostrar dropdown al hacer focus dentro del wrapper */
.dg-dl-wrapper:focus-within .dg-dl-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Cada opción de formato */
.dg-dl-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    text-align: left;
}

.dg-dl-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dg-dl-option:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.15);
}

/* Ícono circular de cada formato */
.dg-dl-opt-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Texto de cada opción */
.dg-dl-opt-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dg-dl-opt-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.02em;
}

.dg-dl-opt-desc {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}

/* ── Responsive: en móvil, dropdown ocupa más ancho ── */
@media (max-width: 768px) {
    .dg-dl-dropdown {
        min-width: 220px;
        right: -10px;
    }
}