/* ============================================================
   DESIGN SYSTEM – AutoForm Premium
   ============================================================ */
:root {
  --bg-base: #06070d;
  --bg-surface: #0d0f1e;
  --bg-card: #111428;
  --bg-input: #181b30;
  --bg-hover: #1c2038;

  --border: #1e2540;
  --border-light: #273055;

  --text-primary: #eef0ff;
  --text-secondary: #8892b8;
  --text-muted: #4e5878;

  --accent: #6366f1;
  --accent-hover: #4f52d9;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --accent-glow: rgba(99, 102, 241, 0.4);
  --accent-neon: rgba(99, 102, 241, 0.6);

  --neon-purple: #a855f7;
  --neon-pink: #ec4899;
  --neon-cyan: #06b6d4;
  --neon-green: #22c55e;

  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.12);
  --green-neon: rgba(34, 197, 94, 0.5);
  --yellow: #f59e0b;
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.12);

  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #ec4899 100%);
  --gradient-text: linear-gradient(90deg, #818cf8, #a78bfa, #f472b6);
  --gradient-neon: linear-gradient(135deg, #6366f1, #a855f7, #06b6d4);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-card: 0 4px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 48px rgba(99, 102, 241, 0.22);
  --shadow-neon: 0 0 20px rgba(99, 102, 241, 0.5), 0 0 60px rgba(99, 102, 241, 0.2);

  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

/* ============================================================
   PAGES
   ============================================================ */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 11, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
}

.nav-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  transition: opacity var(--transition);
}

.nav-logo:hover {
  opacity: 0.85;
}

.logo-image {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  background: rgb(255 255 255 / 0%);
}

.app-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  color: currentColor;
  vertical-align: -0.15em;
}

.app-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inline-icon {
  margin-right: 0.45rem;
}

.logo-icon {
  font-size: 1.35rem;
}

.nav-logo:not(.logo-fallback) .logo-icon {
  display: none;
}

.logo-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-input);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 1.5rem 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 40%, transparent 100%);
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: orbFloat 8s ease-in-out infinite;
}

.orb-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: -100px;
  left: 10%;
}

.orb-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #a855f7, transparent 70%);
  bottom: 50px;
  right: 5%;
  animation-delay: -3s;
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-30px) scale(1.05);
  }
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 680px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-soft);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.8rem;
  color: #a5b4fc;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.5);
  }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.65;
}

/* URL Input Card */
.url-input-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  box-shadow: var(--shadow-card), 0 0 60px rgba(99, 102, 241, 0.15);
  transition: border-color var(--transition), box-shadow var(--transition);
  max-width: 620px;
  margin: 0 auto 1rem;
}

.url-input-card:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-card), 0 0 0 3px var(--accent-soft), var(--shadow-glow);
}

.url-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.url-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.url-input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  padding: 0.65rem 0;
}

.url-input::placeholder {
  color: var(--text-muted);
}

.url-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 20px var(--accent-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px var(--accent-glow), 0 0 0 1px rgba(99, 102, 241, 0.4);
  filter: brightness(1.1);
}

.btn-primary:hover::after {
  opacity: 1;
}

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

/* Ripple effect for all interactive buttons */
.ripple-btn {
  position: relative;
  overflow: hidden;
}

.ripple-btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: rippleAnim 0.6s linear;
  background-color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

@keyframes rippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.btn-start {
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.5rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* btn-success */
.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  animation: successPulse 0.4s ease;
}

.btn-success:hover {
  background: rgba(34, 197, 94, 0.2);
  transform: translateY(-1px);
}

@keyframes successPulse {
  0% {
    transform: scale(0.92);
    opacity: 0;
  }

  60% {
    transform: scale(1.04);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Required-field warning */
.required-warning {
  font-size: 0.78rem;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 6px;
  padding: 4px 10px;
  margin-top: 6px;
}


.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 0.4rem 0;
  transition: color var(--transition);
}

.btn-back:hover {
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
  margin-left: 8px;
}

.btn-copy .app-icon {
  width: 0.85em;
  height: 0.85em;
}

.btn-copy:hover {
  background: var(--accent-soft);
}

.btn-ai {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.83rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-ai:hover {
  background: rgba(139, 92, 246, 0.25);
  transform: translateY(-1px);
}

/* Loader */
.btn-loader {
  display: inline-flex;
  align-items: center;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* ============================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

/* ============================================================
   FEATURES
   ============================================================ */
.features-section {
  padding: 5rem 1.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient);
  opacity: 0;
  transition: opacity var(--transition);
}

.feature-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.feature-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-6px);
  box-shadow: var(--shadow-card), 0 0 30px rgba(99, 102, 241, 0.1);
}

.feature-card:hover::before {
  opacity: 0.04;
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-icon {
  width: 2rem;
  height: 2rem;
  margin-bottom: 1rem;
  display: inline-flex;
  transition: transform var(--transition-bounce);
  color: #f6d48b;
}

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

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   PRICING
   ============================================================ */
.pricing-section {
  padding: 4rem 1.5rem;
}

.pricing-card {
  max-width: 460px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  position: relative;
}

.pricing-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 50px;
  padding: 4px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.pricing-amount {
  margin-bottom: 1.5rem;
}

.price-number {
  font-size: 2.8rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.price-unit {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: 2rem;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.list-item-icon {
  margin-top: 0.15rem;
  color: #8ce2ae;
}

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

/* ============================================================
   FAQ
   ============================================================ */
.faq-section {
  padding: 4rem 1.5rem 5rem;
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.faq-item.open {
  border-color: rgba(99, 102, 241, 0.4);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.93rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}

.faq-question:hover {
  background: var(--bg-hover);
}

.faq-arrow {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
  color: var(--accent);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding var(--transition);
  padding: 0 1.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0.25rem 1.25rem 1.1rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-note {
  margin-top: 0.4rem;
  font-size: 0.78rem;
}

/* ============================================================
   CONFIGURE PAGE
   ============================================================ */
.configure-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 72px 0 1.25rem;
}

.configure-header .container {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.config-title-area {
  flex: 1;
  min-width: 0;
}

.config-form-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.config-form-url {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.config-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  padding: 2rem 0 4rem;
  align-items: start;
}

/* On tablets and smaller, stack vertically */
@media (max-width: 1024px) {
  .config-layout {
    grid-template-columns: 1fr;
  }

  .settings-card {
    position: static !important;
    top: auto;
  }
}

@media (max-width: 900px) {
  .config-layout {
    grid-template-columns: 1fr;
  }

  .settings-card {
    position: static;
    top: auto;
  }
}

/* Questions Panel */
.questions-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.panel-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

/* Question Card */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition);
}

.question-card:hover {
  border-color: var(--border-light);
}

.question-header {
  margin-bottom: 1rem;
}

.question-title {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
  line-height: 1.55;
}

.question-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.25rem;
}

.question-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 8px;
  font-weight: 500;
}

.question-type .type-icon {
  width: 0.85em;
  height: 0.85em;
  opacity: 0.7;
}

/* Per-type colored badges */
.question-type-grid,
.question-type-checkbox_grid {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

.question-type-radio,
.question-type-checkbox {
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
}

.question-type-text,
.question-type-textarea {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.2);
}

.question-type-dropdown {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
}

.question-type-linear_scale,
.question-type-rating {
  color: #f472b6;
  background: rgba(244, 114, 182, 0.1);
  border-color: rgba(244, 114, 182, 0.3);
}

.question-badge-max {
  color: #f97316;
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.3);
}

.question-required {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 5px;
  padding: 2px 8px;
  font-weight: 700;
}

.entry-id-badge {
  display: inline-block;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  opacity: 0.7;
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}

.option-row:hover {
  border-color: var(--border-light);
}

.option-label {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.option-pct-input {
  width: 65px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.83rem;
  font-family: 'Inter', sans-serif;
  padding: 0.3rem 0.5rem;
  text-align: right;
  transition: border-color var(--transition);
}

.option-pct-input:focus {
  outline: none;
  border-color: var(--accent);
}

.option-pct-suffix {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pct-bar-bg {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 2px;
  overflow: hidden;
}

.pct-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--gradient);
  transition: width 0.3s ease;
}

.pct-total {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 0.5rem;
}

.pct-total-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pct-total-value {
  font-size: 0.83rem;
  font-weight: 700;
}

.pct-ok {
  color: var(--green);
}

.pct-err {
  color: var(--red);
}

/* Text question */
.text-question-area {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.text-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.text-option-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

.text-option-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  resize: vertical;
  min-height: 36px;
  padding: 0;
}

.text-option-input::placeholder {
  color: var(--text-muted);
}

.btn-add-text {
  background: none;
  border: 1px dashed var(--border-light);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: all var(--transition);
  margin-top: 0.5rem;
}

.btn-add-text:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.btn-del-text {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color var(--transition);
  flex-shrink: 0;
  margin-top: 4px;
}

.btn-del-text:hover {
  color: var(--red);
}

/* â”€â”€ New multi-line text config â”€â”€ */
.text-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.text-multiline-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  padding: 0.65rem 0.75rem;
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
  outline: none;
  transition: border-color var(--transition);
}

.text-multiline-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.text-multiline-input::placeholder {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.text-line-count {
  font-size: 0.76rem;
  margin-top: 0.3rem;
  font-weight: 600;
  transition: color 0.2s;
}

/* AI gen button inside text card */
.btn-ai-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition);
}

.btn-ai-text:hover {
  background: rgba(139, 92, 246, 0.22);
  transform: translateY(-1px);
}

.btn-ai-text:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}


/* Settings Panel */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.settings-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.admin-dashboard {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.admin-card,
.admin-login-card {
  position: static;
  top: auto;
  width: min(100%, 800px);
  margin-left: auto;
  margin-right: auto;
}

.admin-login-card {
  width: min(100%, 400px);
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.setting-row+.setting-row {
  margin-top: 1rem;
}

.setting-row-split {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.setting-row-split .url-input {
  flex: 0 0 auto;
}

.admin-password-row {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.admin-inline-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.admin-inline-form .url-input {
  flex: 1 1 220px;
  min-width: 0;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table-wrap table {
  width: 100%;
  min-width: 640px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.setting-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  transition: all var(--transition);
}

.toggle-slider:before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle input:checked+.toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle input:checked+.toggle-slider:before {
  transform: translateX(20px);
}

.count-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.count-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.count-btn .app-icon {
  width: 1rem;
  height: 1rem;
}

.count-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.count-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.93rem;
  font-family: 'Inter', sans-serif;
  padding: 0.5rem 0.75rem;
  text-align: center;
  width: 100%;
}

.count-input:focus {
  outline: none;
  border-color: var(--accent);
}

.spaced-options {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.price-estimate {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.price-total {
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.btn-confirm {
  width: 100%;
}

/* ============================================================
   PAYMENT PAGE
   ============================================================ */
.payment-container {
  padding: calc(56px + 2rem) 1.5rem 4rem;
  max-width: 580px;
}

.payment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.payment-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.payment-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.payment-header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.payment-summary {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.payment-total {
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--green);
}

.truncate {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-info {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.bank-info h4 {
  font-size: 0.87rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bank-detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  flex-wrap: wrap;
}

.bank-detail:last-of-type {
  border-bottom: none;
}

.bank-detail span {
  color: var(--text-muted);
  min-width: 90px;
}

.bank-detail strong {
  color: var(--text-primary);
}

.qr-placeholder {
  text-align: center;
  margin-top: 1.25rem;
}

.qr-box {
  width: 140px;
  height: 140px;
  margin: 0 auto 0.75rem;
  background: white;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #888;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.qr-inner {
  font-size: 2rem;
  color: #ccc;
}

.qr-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.payment-note {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.payment-note p {
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.payment-note strong {
  color: var(--text-primary);
}

.payment-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.payment-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.payment-status-badge.pending {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.payment-status-badge.paid {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.payment-status-badge.cancelled {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-payment-link {
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.55rem 0.9rem;
}

.qr-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.btn-confirm-pay {
  width: 100%;
}

/* ============================================================
   RUNNING PAGE
   ============================================================ */
.running-container {
  padding: calc(56px + 2.5rem) 1.5rem 4rem;
  max-width: 680px;
}

.running-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}

.running-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.running-status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--neon-green), 0 0 24px rgba(34, 197, 94, 0.4);
  flex-shrink: 0;
  animation: dotNeonPulse 1.5s ease-in-out infinite;
}

.running-status-dot.paused {
  background: var(--yellow);
  box-shadow: 0 0 8px var(--yellow), 0 0 20px rgba(245, 158, 11, 0.4);
}

.running-status-dot.done {
  background: var(--green);
  box-shadow: 0 0 8px var(--neon-green), 0 0 24px rgba(34, 197, 94, 0.4);
  animation: none;
}

@keyframes dotNeonPulse {

  0%,
  100% {
    box-shadow: 0 0 8px var(--neon-green), 0 0 24px rgba(34, 197, 94, 0.4);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 12px var(--neon-green), 0 0 40px rgba(34, 197, 94, 0.6);
    transform: scale(1.15);
  }
}

.running-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.running-form-name {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.progress-area {
  margin-bottom: 1.25rem;
}

.progress-bar-bg {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--gradient);
  transition: width 0.5s ease;
  width: 0%;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.6), 0 0 20px rgba(99, 102, 241, 0.3);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
  animation: progressShine 1.5s linear infinite;
}

@keyframes progressShine {
  from {
    transform: translateX(-40px);
  }

  to {
    transform: translateX(40px);
  }
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.running-logs {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 1.5rem;
  font-size: 0.78rem;
  font-family: 'Courier New', monospace;
}

.log-item {
  color: var(--text-muted);
  line-height: 1.5;
}

.log-item.success {
  color: var(--green);
}

.log-item.error {
  color: var(--red);
}

.log-item.info {
  color: #60a5fa;
}

.running-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* ============================================================
   HISTORY PAGE
   ============================================================ */
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(56px + 2rem) 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.history-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 4rem;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color var(--transition);
  cursor: pointer;
}

.history-item:hover {
  border-color: var(--border-light);
}

.history-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-done {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.status-stopped {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.status-running {
  background: var(--yellow);
  box-shadow: 0 0 8px var(--yellow);
  animation: pulse 1.5s infinite;
}

.history-info {
  flex: 1;
  min-width: 0;
}

.history-title {
  font-size: 0.93rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.history-count {
  text-align: right;
  flex-shrink: 0;
}

.history-count-num {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.history-count-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

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

.empty-icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: rgba(17, 20, 40, 0.97);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.8rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-card), 0 0 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), toastOut 0.3s ease 2.7s forwards;
  pointer-events: all;
  max-width: 340px;
  backdrop-filter: blur(16px);
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: var(--shadow-card), 0 0 20px rgba(34, 197, 94, 0.12);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: var(--shadow-card), 0 0 20px rgba(239, 68, 68, 0.12);
}

.toast.warning {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: var(--shadow-card), 0 0 20px rgba(245, 158, 11, 0.12);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ============================================================
   AI Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-card);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.modal-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .url-input-card {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .btn-start {
    width: 100%;
  }

  .running-actions {
    flex-wrap: wrap;
  }
}

/* ============================================================
   NEW FEATURES (History Detail & AI Controls)
   ============================================================ */
.ai-gen-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-count-input {
  width: 50px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  text-align: center;
}

.ai-count-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-detail-modal {
  max-width: 600px;
}

.history-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.history-detail-url {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  word-break: break-all;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  flex-shrink: 0;
}

.modal-close-btn .app-icon {
  width: 1.1em;
  height: 1.1em;
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.history-detail-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: var(--bg-surface);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.detail-stat {
  flex: 1;
  text-align: center;
}

.detail-stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.detail-stat-lbl {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.history-detail-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.detail-status-badge {
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.history-detail-logs-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.history-detail-logs {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  height: 200px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-log-badge {
  display: inline-block;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 6px;
  color: var(--text-muted);
}

/* responsive updates */
@media (max-width: 768px) {
  .navbar {
    position: sticky;
    padding: 0.75rem 1rem;
    height: auto;
    min-height: 64px;
  }

  .nav-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .nav-logo {
    justify-content: center;
  }

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

  .nav-link {
    flex: 1 1 140px;
    text-align: center;
  }

  .hero {
    min-height: calc(100vh - 64px);
    padding-top: 2.5rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .url-input-card {
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .btn-start {
    width: 100%;
    padding: 1rem;
  }

  .configure-header {
    padding: 1rem 0 1rem;
  }

  .configure-header .container {
    flex-direction: column;
    align-items: stretch;
  }

  .config-form-title,
  .config-form-url {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    word-break: break-word;
  }

  .text-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-gen-controls {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .ai-count-input {
    width: 72px;
  }

  .count-input-wrapper {
    flex-wrap: wrap;
  }

  .settings-card {
    padding: 1rem;
  }

  .settings-card input[type="number"],
  .settings-card input[type="text"] {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .settings-card button {
    width: 100%;
    margin-top: 0.5rem;
  }

  .setting-row-split {
    align-items: stretch;
  }

  .admin-inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-inline-form .btn-primary,
  .admin-inline-form .btn-secondary,
  .admin-inline-form .btn-danger {
    width: 100%;
  }

  .history-detail-stats,
  .history-detail-meta {
    flex-direction: column;
    align-items: stretch;
  }

  #admin-gifts-container table,
  #admin-history-container table {
    font-size: 0.8rem;
  }

  #admin-gifts-container th,
  #admin-gifts-container td,
  #admin-history-container th,
  #admin-history-container td {
    padding: 4px;
  }
}

@media (max-width: 480px) {
  .nav-link {
    flex-basis: 100%;
  }

  .hero {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .question-card,
  .settings-card {
    padding: 1rem;
  }

  .btn-ai-text {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   NEON GLOW ENHANCEMENTS
   ============================================================ */
.neon-text {
  text-shadow: 0 0 10px rgba(99, 102, 241, 0.8), 0 0 30px rgba(99, 102, 241, 0.4);
}

/* Neon border card variant */
.card-neon {
  border-color: rgba(99, 102, 241, 0.4) !important;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2), 0 0 20px rgba(99, 102, 241, 0.1) !important;
}

/* Question card hover neon */
.question-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15), 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   GRID TABLE UI
   ============================================================ */
.grid-inline-required {
  color: #ff7d7d;
  font-weight: 800;
}

.grid-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}

.grid-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 0.84rem;
  background: rgba(255, 255, 255, 0.015);
}

.grid-table th {
  background: rgba(99, 102, 241, 0.06);
  color: var(--text-primary);
  font-weight: 700;
  text-align: center;
  padding: 0.85rem 0.75rem;
  border: 1px solid rgba(99, 102, 241, 0.15);
  font-size: 0.82rem;
  line-height: 1.4;
  word-break: break-word;
  white-space: normal;
  min-width: 110px;
}

.grid-table .grid-row-title {
  text-align: left;
  min-width: 110px;
  width: 110px;
  white-space: nowrap;
}

.grid-table th.grid-row-title {
  vertical-align: middle;
}

.grid-th-icon {
  width: 0.9em;
  height: 0.9em;
  opacity: 0.6;
  flex-shrink: 0;
}

.grid-table td {
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.75rem 0.6rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
}

.grid-table td.grid-row-header-cell {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  text-align: left;
  min-width: 110px;
  width: 110px;
  font-size: 0.83rem;
}

.grid-empty-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.75rem;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.grid-cell-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.grid-pct-input {
  width: 48px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.86rem;
  font-family: inherit;
  font-weight: 700;
  padding: 0.42rem 0.25rem;
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.grid-pct-input:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.85);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.grid-cell-suffix {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.grid-summary-row td,
.grid-summary-row td:first-child {
  padding: 0.52rem 0.75rem 0.92rem;
  background: transparent;
  border-top: 0;
  text-align: initial;
  color: inherit;
}

.grid-row-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 0.9rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.012);
}

.grid-row-total,
.grid-row-remaining {
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.grid-row-total.ok,
.grid-row-remaining.ok {
  color: #eef0ff;
}

.grid-row-total.err,
.grid-row-remaining.err {
  color: #ff8f8f;
}

@media (max-width: 768px) {
  .grid-table {
    font-size: 0.78rem;
  }
  .grid-table th,
  .grid-table td.grid-row-header-cell {
    min-width: 90px;
    width: 90px;
  }
  .grid-table th {
    min-width: 95px;
    padding: 0.65rem 0.5rem;
  }
}

/* ============================================================
   ADMIN SESSION POPUP & LOG VIEWER
   ============================================================ */
.admin-session-row {
  cursor: pointer;
  transition: background var(--transition);
}

.admin-session-row:hover td {
  background: rgba(99, 102, 241, 0.07) !important;
}

.admin-log-modal {
  max-width: 720px;
}

.session-log-viewer {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  height: 240px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.74rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 0.75rem;
}

.admin-action-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.admin-link-short {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

/* ============================================================
   FORM CACHE BADGE
   ============================================================ */
.cache-restore-banner {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  animation: slideDown 0.35s ease;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cache-restore-banner p {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: #a5b4fc;
  margin: 0;
}

.cache-restore-banner .cache-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ============================================================
   SHIMMER LOADING
   ============================================================ */
@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }

  100% {
    background-position: 400px 0;
  }
}

.shimmer {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.6s infinite linear;
  border-radius: var(--radius-sm);
}

/* ============================================================
   CONFIGURE PAGE — OVERFLOW & RESPONSIVE FIXES
   ============================================================ */
.question-card {
  overflow: hidden;
  max-width: 100%;
  word-break: break-word;
}

.grid-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.options-list {
  overflow: hidden;
}

.option-row {
  flex-wrap: wrap;
  min-width: 0;
}

.questions-panel {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.settings-card {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .settings-card {
    position: static !important;
    max-height: none;
    overflow-y: visible;
  }
}

/* ============================================================
   GIFT CODE — CLICK TO COPY ANIMATION
   ============================================================ */
.gift-code-clickable {
  display: inline-block;
  cursor: pointer;
  transition: color var(--transition), transform var(--transition), text-shadow var(--transition);
  user-select: none;
}

.gift-code-clickable:hover {
  color: #c084fc !important;
  text-shadow: 0 0 12px rgba(168, 85, 247, 0.7);
  transform: scale(1.05);
}

.gift-code-clickable:active {
  transform: scale(0.96);
}

/* ============================================================
   BTN-SUCCESS
   ============================================================ */
.btn-success {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-success:hover {
  background: #16a34a;
  transform: translateY(-1px);
}

.btn-success:active {
  transform: translateY(0) scale(0.97);
}

.btn-success.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
}

/* ============================================================
   HISTORY MODAL ACTIONS — flex wrap for extra buttons
   ============================================================ */
.history-detail-modal .modal-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* ============================================================
   TOAST ICON
   ============================================================ */
.toast-icon {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--green); }
.toast.error   .toast-icon { color: var(--red); }
.toast.warning .toast-icon { color: var(--yellow); }

/* ============================================================
   GIFT SECTION (Payment page)
   ============================================================ */
.gift-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.gift-input-row {
  display: flex;
  gap: 8px;
}

.gift-input-row .url-input {
  flex: 1;
  padding: 10px;
}

.gift-msg-text {
  margin-top: 8px;
  font-size: 0.875rem;
  min-height: 1.2rem;
}

/* ============================================================
   ADMIN — HELPER UTILITIES
   ============================================================ */
.admin-section-card {
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.admin-section-card h3 {
  margin-bottom: 1.5rem;
}

.setting-label-bold {
  font-weight: 600;
  display: block;
}

.setting-desc-small {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}

.admin-input-sm {
  width: 130px;
  padding: 6px;
  text-align: right;
}

.admin-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

.admin-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.admin-scroll-box {
  background: var(--bg-base);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  max-height: 300px;
  overflow-y: auto;
  overflow-x: auto;
}

.admin-scroll-box-lg {
  max-height: 400px;
}

.admin-login-card {
  max-width: 400px;
  margin: 2rem auto;
}

/* ============================================================
   PANEL HEADER ICON
   ============================================================ */
.panel-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-header h3 .app-icon {
  font-size: 1.1rem;
  color: var(--accent);
}

