:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #ec4899;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;

  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;

  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Animated gradient background */
.gradient-bg {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    rgba(99, 102, 241, 0.03) 0%,
    rgba(236, 72, 153, 0.03) 25%,
    rgba(16, 185, 129, 0.03) 50%,
    rgba(245, 158, 11, 0.03) 75%,
    rgba(99, 102, 241, 0.03) 100%
  );
  animation: gradient-shift 20s ease infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes gradient-shift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(5%, 5%) rotate(90deg); }
  50% { transform: translate(0, 10%) rotate(180deg); }
  75% { transform: translate(-5%, 5%) rotate(270deg); }
}

/* Header */
.top-bar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-pill {
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  position: relative;
}

.nav-pill:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.nav-pill.active {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Main content */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 999px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  animation: float 3s ease-in-out infinite;
}

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

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--text-primary);
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--warning));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradient-flow 5s ease infinite;
}

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

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 700px;
  line-height: 1.7;
  margin: 0;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
  width: 100%;
  max-width: 900px;
}

.stat-item {
  text-align: center;
  padding: 1.5rem;
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-item:hover {
  box-shadow: var(--shadow-lg);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  margin-top: 0.5rem;
  font-weight: 500;
}

/* How To Section */
.howto {
  background: white;
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  overflow-wrap: break-word;
  word-wrap: break-word;
  overflow: hidden;
}

.howto-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.howto-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.howto-time {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

.howto-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.step {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: 16px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  align-items: flex-start;
  overflow-wrap: break-word;
  word-wrap: break-word;
  overflow: hidden;
}

.step:hover {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.2);
}

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: 12px;
  font-weight: 900;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-header:hover .step-number {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.step-content {
  flex: 1;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  overflow: hidden;
}

.step-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  color: var(--text-primary);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.step-content p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.7;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.step-content ul {
  margin: 0.75rem 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.step-content ul li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 1.5rem;
  position: relative;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.step-content ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 900;
  font-size: 1.2rem;
}

.howto-tip {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
  padding: 1.25rem;
  border-radius: 12px;
  border-left: 4px solid var(--warning);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.howto-tip strong {
  color: var(--text-primary);
}

/* Collapsible Steps */
.step.collapsible {
  cursor: default;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  box-sizing: border-box;
}

.step.collapsible.active {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  cursor: pointer;
  user-select: none;
  width: 100%;
  box-sizing: border-box;
  transition: background 0.3s ease, transform 0.2s ease;
  border-radius: 16px;
}

.step-header:hover {
  background: rgba(99, 102, 241, 0.05);
}

.step-header:active {
  transform: scale(0.99);
}

.step.collapsible.active .step-header {
  border-radius: 16px 16px 0 0;
}

.step-header h3 {
  flex: 1;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: normal;
}

.toggle-icon {
  flex-shrink: 0;
  font-size: 1rem;
  color: var(--text-tertiary);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.2s ease;
  width: 24px;
  text-align: center;
}

.step.collapsible.active .toggle-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.step-header:hover .toggle-icon {
  color: var(--primary);
}

.step.collapsible .step-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  padding: 0 2rem;
  transform: translateY(-10px);
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease,
              visibility 0s linear 0.4s,
              padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step.collapsible.active .step-content {
  max-height: 3000px;
  opacity: 1;
  visibility: visible;
  padding: 0 2rem 2rem 2rem;
  transform: translateY(0);
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease 0.05s,
              visibility 0s linear 0s,
              padding 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Script Table */
.script-table {
  margin: 1.5rem 0;
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.script-table table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.9rem;
}

.script-table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.script-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.95rem;
}

.script-table th:first-child {
  border-top-left-radius: 12px;
}

.script-table th:last-child {
  border-top-right-radius: 12px;
}

.script-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  line-height: 1.6;
}

.script-table tbody tr:last-child td {
  border-bottom: none;
}

.script-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}

.script-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

.script-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.03);
}

.script-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Upload Section */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text-primary);
  margin: 0;
  background: linear-gradient(135deg, var(--text-primary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.combination-counter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: white;
  border-radius: 999px;
  box-shadow: var(--shadow);
  border: 2px solid rgba(99, 102, 241, 0.2);
}

.counter-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.counter-value {
  font-size: 1.75rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 3ch;
  text-align: center;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.03), rgba(236, 72, 153, 0.03));
  border-radius: 20px;
  border: 2px solid rgba(99, 102, 241, 0.15);
  box-shadow: 0 30px 60px rgba(99, 102, 241, 0.1);
  position: relative;
  overflow: hidden;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

.upload-form::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
  animation: rotate-gradient 20s linear infinite;
  pointer-events: none;
}

@keyframes rotate-gradient {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  position: relative;
  z-index: 1;
  max-width: 100%;
  transition: none;
}

.upload-grid.no-transition,
.upload-grid.no-transition *,
.upload-card.no-transition,
.upload-card.no-transition *,
.add-block-card.no-transition,
.add-block-card.no-transition * {
  transition: none !important;
  animation: none !important;
}

.upload-form .section-header,
.upload-form .upload-grid,
.upload-form .generate {
  transition: opacity 0.35s ease, transform 0.35s ease, filter 0.35s ease;
}

.upload-form.generating .section-header,
.upload-form.generating .upload-grid,
.upload-form.generating .generate {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(8px);
  pointer-events: none;
}

.generation-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.6), rgba(99, 102, 241, 0.35));
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 5;
}

.generation-overlay-inner {
  width: 100%;
  max-width: 520px;
}

.upload-form.generating .generation-overlay {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.generation-overlay[hidden] {
  display: none;
}

.upload-card {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 280px;
  width: 100%;
  min-width: 0;
}

.upload-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow-lg);
}

body.dragging-blocks .upload-card:not(.dragging):hover {
  border-color: var(--border-color);
  box-shadow: var(--shadow);
}

body.dragging-blocks .upload-card,
body.dragging-blocks .upload-drop,
body.dragging-blocks .add-block-card {
  transition: none !important;
}

/* Sortable.js drag states */
.sortable-ghost {
  opacity: 0.4;
  background: rgba(99, 102, 241, 0.08);
  border: 2px dashed var(--primary);
}

.sortable-chosen {
  cursor: grabbing !important;
}

.sortable-drag {
  opacity: 1 !important;
}

.sortable-fallback {
  opacity: 0.9;
  box-shadow: var(--shadow-xl);
  transform: scale(1.02) rotate(3deg);
  cursor: grabbing !important;
}

/* Legacy placeholder style - can be removed if not used */
.upload-card-placeholder {
  border: 2px dashed var(--primary);
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.08);
  transition: none !important;
  min-height: 280px;
  pointer-events: none;
  width: 100%;
  box-sizing: border-box;
}

.upload-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
  border-radius: 10px;
  flex-shrink: 0;
}

.upload-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.upload-drop {
  cursor: pointer;
  display: block;
}

.upload-drop input[type="file"] {
  display: none;
}

.drop-area {
  border: 2px dashed var(--border-color);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-height: 120px;
  justify-content: center;
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.drop-icon {
  font-size: 2rem;
  opacity: 0.6;
}

.drop-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.drop-text strong {
  font-weight: 600;
  color: var(--text-primary);
}

.drop-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  max-width: 200px;
  line-height: 1.3;
}

.upload-drop:hover .drop-area {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.03);
}

.upload-drop.has-file .drop-area {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.05);
  border-style: solid;
}

body.dragging-blocks .upload-drop:not(.has-file):hover .drop-area {
  border-color: var(--border-color);
  background: transparent;
}

body.dragging-blocks .upload-drop.has-file:hover .drop-area {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.05);
}

body.dragging-blocks .upload-drop {
  pointer-events: none;
}

body.dragging-blocks .upload-drop:hover .upload-icon {
  color: var(--text-tertiary);
  transform: none;
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: var(--text-tertiary);
  transition: all 0.3s ease;
}

.upload-drop:hover .upload-icon {
  color: var(--primary);
  transform: scale(1.1);
}

.upload-drop.has-file .upload-icon {
  color: var(--success);
}

.drop-area .prompt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.drop-area .filename {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-drop.has-file .drop-area .prompt {
  display: none;
}

/* Video Preview Deck */
.video-preview-deck {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.5rem;
}

.video-preview-item {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.video-preview-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.video-preview-item:nth-child(1) {
  transform: rotate(-2deg);
}

.video-preview-item:nth-child(2) {
  transform: rotate(2deg);
}

.video-preview-item:nth-child(3) {
  transform: rotate(2deg);
}

.video-preview-item:nth-child(4) {
  transform: rotate(-2deg);
}

.video-preview-item:hover {
  transform: scale(1.05) rotate(0deg) !important;
}

.video-preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-preview-item .preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 0.5rem 0.4rem;
  font-size: 0.7rem;
  color: white;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-preview-item .remove-video {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 0;
  line-height: 1;
}

.video-preview-item:hover .remove-video {
  opacity: 1;
}

.video-preview-item .remove-video:hover {
  background: rgba(239, 68, 68, 1);
  transform: scale(1.1);
}

/* Generate Section */
.generate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0;
}

.generate-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 3.5rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  background-size: 200% 200%;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4);
  transition: all 0.3s ease;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}

.generate-button::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.5s ease;
}

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

.generate-button:hover {
  transform: scale(1.05);
  box-shadow: 0 25px 50px rgba(99, 102, 241, 0.5);
  background-position: 100% 50%;
}

.generate-button:active {
  transform: scale(1.02);
}

.button-icon {
  font-size: 1.5rem;
  animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.generate-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.one-free, .process-time {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.one-free {
  color: var(--primary);
  font-weight: 700;
}

/* Results Section */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  width: 100%;
  box-sizing: border-box;
}

.result-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.archive-count {
  padding: 0.4rem 0.9rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}

.status-inline {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
  text-align: center;
}

.status-inline.success {
  color: var(--success);
  font-weight: 600;
}

.status-inline.error {
  color: var(--error);
  font-weight: 600;
}

.status-inline.processing {
  color: var(--primary);
  font-weight: 600;
}

.status-inline a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.status-inline a:hover {
  border-bottom-color: var(--primary);
}

.progress-panel {
  width: 100%;
  display: grid;
  gap: 1rem;
  padding: 1.5rem 1.75rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.progress-panel.active {
  opacity: 1;
  transform: translateY(0);
}

.progress-panel.prefetch .progress-percentage {
  display: none;
}

.progress-panel.prefetch .progress-bar {
  display: none;
}

.progress-panel.prefetch .progress-spinner {
  background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
  background-size: 200% 200%;
  animation: gradient-pulse 2s ease-in-out infinite;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5), 0 0 60px rgba(236, 72, 153, 0.3);
  transform: scale(1.1);
}

.progress-panel.prefetch .spinner-dot {
  border-width: 6px;
  border-top-color: #a855f7;
  border-right-color: #ec4899;
  animation: spin 0.8s linear infinite, pulse-border 2s ease-in-out infinite;
}

.progress-panel.prefetch .progress-message {
  font-weight: 700;
  font-size: 1.15rem;
  opacity: 1;
  background: linear-gradient(135deg, #ffffff, #e0e7ff, #ffffff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: text-shimmer 3s ease-in-out infinite;
  text-shadow: none;
}

@keyframes gradient-pulse {
  0%, 100% {
    background-position: 0% 50%;
    transform: scale(1.1);
  }
  50% {
    background-position: 100% 50%;
    transform: scale(1.15);
  }
}

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

@keyframes text-shimmer {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.progress-panel[hidden] {
  display: none !important;
}

.progress-visual {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.progress-spinner {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: grid;
  place-items: center;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.progress-spinner::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: rgba(15, 23, 42, 0.85);
  transition: background 0.3s ease;
}

.spinner-dot {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 5px solid transparent;
  border-top-color: #6366f1;
  border-right-color: #8b5cf6;
  animation: spin 1s linear infinite;
  z-index: 1;
  transition: opacity 0.25s ease;
}

.spinner-check {
  position: absolute;
  font-size: 2rem;
  font-weight: 700;
  color: #22c55e;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 2;
}

.progress-percentage {
  font-size: 2.6rem;
  font-weight: 900;
  color: white;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.progress-bar {
  position: relative;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(30, 41, 59, 0.8);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.progress-message {
  transition: opacity 0.25s ease;
}
.progress-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
  overflow: hidden;
  border-radius: 999px;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.progress-panel.completed .progress-spinner {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.progress-panel.completed .progress-spinner::after {
  background: rgba(15, 23, 42, 0.85);
}

.progress-panel.completed .spinner-dot {
  opacity: 0;
}

.progress-panel.completed .spinner-check {
  opacity: 1;
  transform: scale(1);
}

.progress-panel.completed .progress-bar-fill {
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 50%, #15803d 100%);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
  border-radius: 999px;
}

.progress-message {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 1rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress-download {
  display: flex;
  justify-content: stretch;
  width: 100%;
}

.progress-download[hidden] {
  display: none !important;
}

.progress-download .download-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.progress-download .download-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.progress-download .download-link:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.progress-download .download-link:hover::before {
  transform: translateX(100%);
}

.progress-reset {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  align-self: stretch;
  padding: 0.85rem 2rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.progress-reset::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.progress-reset:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.progress-reset:hover::before {
  transform: translateX(100%);
}

.progress-reset:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.progress-reset[hidden] {
  display: none !important;
}

.reset-icon {
  font-size: 1.1rem;
  line-height: 1;
}

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

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-tertiary);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state p {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 0.5rem 0;
}

.empty-state span {
  font-size: 0.9rem;
  color: var(--text-tertiary);
}

.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  overflow: hidden;
}

.archive-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.archive-item:hover {
  background: rgba(99, 102, 241, 0.05);
}

.archive-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.file-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
  flex-shrink: 0;
}

.archive-item a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.archive-item a:hover {
  color: var(--primary);
}

.file-size {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-weight: 500;
  flex-shrink: 0;
}

/* FAQ Section */
.faq {
  background: white;
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.faq h2 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 2rem 0;
  color: var(--text-primary);
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.faq-item {
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.faq-item:hover {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.2);
}

.faq-item h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  color: var(--text-primary);
}

.faq-item p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* Footer */
.footer {
  background: white;
  border-top: 1px solid var(--border-color);
  padding: 2rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.footer-brand .logo-icon {
  width: 32px;
  height: 32px;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
  .upload-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .upload-form {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .top-bar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
  }

  .page {
    padding: 2rem 1rem 4rem;
    gap: 3rem;
  }

  /* Fix text overflow on mobile */
  .howto,
  .step,
  .step-content,
  .step-content p,
  .step-content h3,
  .step-content ul li,
  .step-content strong,
  .step-content code {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    box-sizing: border-box;
  }

  .hero {
    padding: 2rem 0;
  }

  .stats-row {
    gap: 1rem;
    grid-template-columns: 1fr;
  }

  .howto,
  .faq {
    padding: 1.5rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .upload-form {
    padding: 1.5rem;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
  }

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

  .results {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .result-card {
    padding: 1.5rem;
  }

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

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }

  /* Archive items responsive */
  .archive-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.875rem;
  }

  .archive-info {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .archive-item a {
    white-space: normal;
    word-break: break-word;
    font-size: 0.875rem;
    line-height: 1.4;
  }

  .file-size {
    font-size: 0.75rem;
  }

  /* Progress download link responsive */
  .progress-download .download-link {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    white-space: normal;
    word-break: break-word;
    text-align: center;
    line-height: 1.4;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .stat-item {
    padding: 1rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .generate-button {
    padding: 1.25rem 2.5rem;
    font-size: 1.1rem;
  }

  /* Extra small screens - archive adjustments */
  .archive-item {
    padding: 0.75rem;
  }

  .archive-item a {
    font-size: 0.8125rem;
  }

  .file-icon {
    width: 20px;
    height: 20px;
  }

  .progress-download .download-link {
    padding: 0.625rem 0.875rem;
    font-size: 0.85rem;
    gap: 0.375rem;
  }

  /* Extra protection for very narrow screens */
  .step-content p,
  .step-content h3 {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .step-content ul li {
    font-size: 0.85rem;
  }
}

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

.hero,
.howto,
.upload-form,
.results,
.faq {
  animation: fadeInUp 0.6s ease forwards;
}

.howto {
  animation-delay: 0.1s;
}

.upload-form {
  animation-delay: 0.2s;
}

.results {
  animation-delay: 0.3s;
}

.faq {
  animation-delay: 0.4s;
}

/* Application Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  opacity: 1;
}

.modal-content {
  background: #1a1a2e;
  border-radius: 16px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: #fff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-description {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 24px 0;
  line-height: 1.6;
}

.application-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.form-group input[type="tel"] {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  transition: all 0.2s ease;
}

.form-group input[type="tel"]:focus {
  outline: none;
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group.valid input[type="tel"] {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.form-group.valid input[type="tel"]:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group.invalid input[type="tel"] {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.form-group.invalid input[type="tel"]:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group.valid::after {
  content: '✓';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  margin-top: 12px;
  color: #10b981;
  font-size: 18px;
  font-weight: bold;
  pointer-events: none;
}

.form-group.invalid::after {
  content: '✕';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  margin-top: 12px;
  color: #ef4444;
  font-size: 18px;
  font-weight: bold;
  pointer-events: none;
}

.form-group {
  position: relative;
}

.messenger-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.messenger-option {
  position: relative;
  cursor: pointer;
}

.messenger-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.messenger-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
}

.messenger-option input[type="radio"]:checked + .messenger-label {
  background: rgba(102, 126, 234, 0.15);
  border-color: #667eea;
  color: #fff;
}

.messenger-label svg {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.messenger-option input[type="radio"]:checked + .messenger-label svg {
  opacity: 1;
}

.messenger-option:hover .messenger-label {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.form-actions {
  margin-top: 8px;
}

.submit-button {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  margin-top: 8px;
}

.form-status.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.form-status.error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Mobile responsive */
@media (max-width: 640px) {
  .modal-content {
    padding: 24px;
    width: 95%;
  }

  .modal-title {
    font-size: 20px;
  }

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

  /* Collapsible steps mobile */
  .step-header {
    padding: 1rem 1.25rem;
    gap: 1rem;
    width: 100%;
  }

  .step-header h3 {
    font-size: 1rem;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .step.collapsible .step-content {
    padding: 0 1.25rem;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease,
                visibility 0s linear 0.35s,
                padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .step.collapsible.active .step-content {
    padding: 0 1.25rem 1.5rem 1.25rem;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease 0.05s,
                visibility 0s linear 0s,
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Script table mobile */
  .script-table {
    font-size: 0.8rem;
  }

  .script-table th,
  .script-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
  }

  .script-table th:first-child,
  .script-table td:first-child {
    min-width: 70px;
  }
}

/* Block Management Controls */
.reset-blocks-button {
  background: white;
  color: var(--text-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.reset-blocks-button:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.reset-blocks-button:active {
  transform: scale(0.97);
}

/* Upload Card Header with Controls */
.upload-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.drag-handle {
  cursor: grab;
  color: var(--primary);
  font-size: 1.4rem;
  padding: 0.5rem;
  user-select: none;
  transition: all 0.2s ease;
  border-radius: 6px;
  line-height: 1;
  opacity: 0.7;
}

.drag-handle:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  opacity: 1;
  transform: scale(1.1);
}

.drag-handle:active {
  cursor: grabbing;
  transform: scale(1.05);
}

body.dragging-blocks .drag-handle:hover {
  color: var(--primary);
}

.upload-card[draggable="true"] {
  cursor: move;
}

.upload-card.dragging {
  opacity: 0.5;
  transform: scale(0.95);
  transition: all 0.3s ease;
}

.remove-block-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  line-height: 1;
}

.remove-block-btn:hover {
  background: var(--error);
  color: white;
  transform: scale(1.1);
}

.remove-block-btn:active {
  transform: scale(0.95);
}

body.dragging-blocks .remove-block-btn:hover {
  background: transparent;
  color: var(--text-tertiary);
  transform: none;
}

/* Add Block Card */
.add-block-card {
  background: transparent;
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.add-block-card:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.02);
}

.add-block-btn {
  background: white;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.add-block-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.add-block-btn:active {
  transform: translateY(0);
}

body.dragging-blocks .add-block-card:hover {
  border-color: var(--border-color);
  background: transparent;
}

body.dragging-blocks .add-block-btn:hover {
  background: white;
  color: var(--primary);
  transform: none;
  box-shadow: var(--shadow-sm);
}

.add-block-btn .add-icon {
  font-size: 1.5rem;
  line-height: 1;
}

/* Add Block Modal */
#add-block-modal .modal-content {
  max-width: 500px;
}

.add-block-form .form-group {
  margin-bottom: 1.5rem;
}

.add-block-form label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.add-block-form input[type="text"],
.add-block-form textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: white;
}

.add-block-form input[type="text"]:focus,
.add-block-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.add-block-form textarea {
  resize: vertical;
  min-height: 80px;
}

/* Icon Picker */
.icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.icon-option {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}

.icon-option:hover {
  border-color: var(--primary);
  transform: scale(1.1);
}

.icon-option.selected {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.15);
  box-shadow: var(--shadow-lg);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .reset-blocks-button {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
  }

  .drag-handle {
    font-size: 1rem;
  }

  .add-block-card {
    min-height: 240px;
  }

  .upload-card {
    min-height: 240px;
  }

  .upload-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .icon-picker {
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 0.4rem;
  }

  .icon-option {
    font-size: 1.25rem;
    padding: 0.5rem;
  }
}

@media (min-width: 769px) and (max-width: 1200px) {
  .upload-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* Pricing Section */
.pricing {
  max-width: 1400px;
  margin: 4rem auto;
  padding: 0 2rem;
}

.pricing-header {
  text-align: center;
  margin-bottom: 3rem;
}

.pricing-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.pricing-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

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

  .pricing-card[data-tier="agency"] {
    grid-column: 1 / -1;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (min-width: 1200px) {
  .pricing-card {
    padding: 1.75rem;
  }

  .pricing-price {
    font-size: 2.25rem;
  }

  .pricing-card[data-tier="agency"] {
    max-width: 450px;
  }
}

.pricing-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}

.pricing-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.pricing-card.pricing-popular {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow);
}

.pricing-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 1rem;
}

.pricing-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 1rem;
}

.pricing-price {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary);
  text-align: center;
  margin-bottom: 1.5rem;
}

.pricing-price span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  flex-grow: 1;
}

.pricing-features li {
  padding: 0.75rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  border-bottom: 1px solid var(--border-color);
}

.pricing-features li:last-child {
  border-bottom: none;
}

.pricing-button {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  text-transform: none;
}

.pricing-button:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.pricing-button:active {
  transform: scale(0.98);
}

.pricing-popular .pricing-button {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .pricing-header h2 {
    font-size: 2rem;
  }

  .pricing-card {
    padding: 1.5rem;
  }
}

/* Tier Selected Message */
.tier-selected-message {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  animation: slideDown 0.3s ease;
}

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

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }
  50% {
    box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
  }
}

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

/* Make pricing section informative */
.pricing {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.02), rgba(236, 72, 153, 0.02));
  border: 2px solid rgba(99, 102, 241, 0.1);
  border-radius: 24px;
  padding: 3rem 2rem;
  margin: 3rem auto;
}

.pricing-header {
  position: relative;
}

/* Application Modal Two-Step Layout */
.application-modal-large {
  max-width: 1000px;
  width: 95%;
}

.modal-step {
  transition: all 0.3s ease;
}

.modal-step.hidden {
  display: none;
}

.modal-step.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Modal Pricing Grid */
.modal-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.modal-pricing-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.modal-pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.modal-pricing-card.modal-popular {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  position: relative;
}

.modal-pricing-card .pricing-icon {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 0.75rem;
}

.modal-pricing-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.modal-pricing-card .pricing-price {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  text-align: center;
  margin-bottom: 1rem;
}

.modal-pricing-card .pricing-price span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.modal-pricing-card .pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  flex-grow: 1;
}

.modal-pricing-card .pricing-features li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
  border-bottom: 1px solid var(--border-color);
}

.modal-pricing-card .pricing-features li:last-child {
  border-bottom: none;
}

.modal-pricing-button {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.875rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.modal-pricing-button:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.modal-pricing-button:active {
  transform: scale(0.98);
}

.modal-popular .modal-pricing-button {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

#selected-tier-display {
  color: var(--success);
  font-weight: 600;
}

@media (max-width: 768px) {
  .application-modal-large {
    max-width: 100%;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .modal-pricing-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
