:root {
  --p: #6A0BE4;
  --p-h: #5a09c4;
  --p-lt: #f0ebff;
  --p-llt: #f7f4ff;
}
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Be Vietnam Pro', sans-serif; margin: 0; background: #f6f3ff; color: #1a1a2e; }

/* HERO */
#hero {
  background: linear-gradient(145deg, #03010a 0%, #1a0040 55%, #6A0BE4 100%);
  padding: 80px 24px 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 100%, rgba(106,11,228,0.3) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
.ai-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(106,11,228,0.25);
  border: 1px solid rgba(192,132,252,0.35);
  color: #c084fc;
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  padding: 6px 18px; border-radius: 100px; margin-bottom: 22px;
}
.ai-dot { width: 7px; height: 7px; border-radius: 50%; background: #a855f7; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.4; transform:scale(0.7); } }
#hero h1 { font-size: clamp(1.9rem, 4vw, 3.2rem); font-weight: 900; color: #fff; line-height: 1.15; margin: 0 0 16px; }
#hero h1 span { color: #c084fc; }
#hero p { color: rgba(255,255,255,0.6); font-size: 1.05rem; max-width: 560px; margin: 0 auto; line-height: 1.7; }

/* TOOL WRAPPER */
#tool-wrapper {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 20px 60px;
  position: relative;
  z-index: 2;
}

/* TOOL GRID */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(106,11,228,0.14), 0 2px 12px rgba(0,0,0,0.06);
}

/* FORM PANEL */
.form-panel {
  background: #fff;
  border-right: 1px solid #ede9f8;
  padding: 0;
}
.form-header {
  background: linear-gradient(135deg, #f0ebff, #e8dfff);
  padding: 22px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e4daff;
}
.form-header-icon {
  width: 38px; height: 38px;
  background: #f0ebff;
  border: 1px solid #c4b5fd;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #6A0BE4;
}
.form-header-text h3 { font-size: 14px; font-weight: 700; color: #0f0a1e; margin: 0 0 2px; }
.form-header-text p { font-size: 12px; color: #6b7280; margin: 0; }
.ai-chip {
  margin-left: auto;
  background: #f0ebff;
  border: 1px solid #c4b5fd;
  color: #6A0BE4;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 100px;
}

.form-body { padding: 24px 28px; }
#pgForm { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; color: #4b4b6a; letter-spacing: 0.4px; text-transform: uppercase; }
.field input, .field select, .field textarea {
  background: #fff;
  border: 1.5px solid #e4e4f0;
  border-radius: 10px;
  padding: 11px 14px;
  color: #0f0a1e;
  font-size: 14px;
  font-family: 'Be Vietnam Pro', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.field input::placeholder, .field textarea::placeholder { color: #9ca3af; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--p);
  box-shadow: 0 0 0 3px rgba(106,11,228,0.1);
  background: #faf9ff;
}
.field select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.field select option { background: #fff; color: #0f0a1e; }
.field textarea { height: 96px; resize: vertical; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.prominent-field .field-label-lg {
  font-size: 11px; font-weight: 800; color: #6A0BE4; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.prominent-field textarea {
  height: 80px;
  border-color: #c4b5fd;
  background: #faf9ff;
}
.prominent-field textarea:focus { border-color: var(--p); }

#generate {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--p), #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Be Vietnam Pro', sans-serif;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 20px rgba(106,11,228,0.4);
  margin-top: 4px;
}
#generate:hover { opacity: 0.9; transform: translateY(-1px); }
#generate:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
#generate svg { animation: spin 1s linear infinite; }
#generate svg.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* OUTPUT PANEL */
.output-panel { background: #faf9ff; display: flex; flex-direction: column; }

.output-header {
  background: linear-gradient(135deg, #f0ebff, #e8dfff);
  padding: 16px 22px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #e4daff;
  flex-shrink: 0;
}
.output-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 700; color: #0f0a1e;
}
.ai-gen-badge {
  background: linear-gradient(135deg, #6A0BE4, #8b5cf6);
  color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: 0.6px;
  padding: 3px 10px; border-radius: 100px; text-transform: uppercase;
}
.output-actions { display: flex; gap: 8px; align-items: center; }
.out-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #e4e4f0;
  color: #4b4b6a;
  border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: 'Be Vietnam Pro', sans-serif;
  transition: background 0.2s, border-color 0.2s;
}
.out-btn:hover { background: #f0ebff; border-color: #6A0BE4; color: #6A0BE4; }
.out-btn.hidden { display: none !important; }

#stop-btn-container {
  display: flex; align-items: center; gap: 6px;
  color: #ef4444; cursor: pointer; font-size: 13px; font-weight: 600;
}
#stop-btn-container.hidden { display: none !important; }

.output-body { flex: 1; overflow-y: auto; padding: 24px; min-height: 420px; }

#output {
  font-size: 14px; line-height: 1.8; color: #1a1a2e;
  font-family: 'Be Vietnam Pro', sans-serif;
}
#output.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 380px; text-align: center; gap: 14px; color: #9ca3af;
}
#output.empty .empty-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: #f0ebff;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #c4b5fd;
}
#output h1 { color: #6A0BE4; font-size: 1.4em; margin: 1em 0 0.4em; }
#output h2 { color: #5a09c4; font-size: 1.2em; margin: 0.9em 0 0.3em; border-bottom: 1px solid #e4daff; padding-bottom: 6px; }
#output h3 { color: #6A0BE4; font-size: 1.05em; margin: 0.8em 0 0.3em; }
#output p { margin: 0.5em 0; }
#output ul, #output ol { padding-left: 1.4em; }
#output li { margin-bottom: 4px; }
#output strong { color: #0f0a1e; }
#output table { border-collapse: collapse; width: 100%; margin: 1em 0; }
#output th, #output td { border: 1px solid #e4daff; padding: 8px 12px; }
#output th { background: #f0ebff; color: #6A0BE4; }

/* SECTIONS */
.section { padding: 60px 20px; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head .eyebrow { display: inline-block; background: var(--p-lt); color: var(--p); font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; padding: 5px 16px; border-radius: 100px; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; color: #1a1a2e; margin: 0 0 10px; }
.section-head h2 span { color: var(--p); }
.section-head p { font-size: 15px; color: #6b7280; }

body > section { background: #fff; }
body > section:nth-child(odd) { background: var(--p-llt); }

#featuresStrip { background: #fff; }
#howItWorks { background: var(--p-llt); }
#aboutSection { background: #fff; }
#whyBanner { background: linear-gradient(145deg, #03010a 0%, #1a0040 55%, #6A0BE4 100%); }
#faqSection { background: var(--p-llt); }

.cards-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card { background: var(--p-llt); border: 1px solid var(--p-lt); border-radius: 16px; padding: 26px 20px; text-align: center; }
.card-icon { font-size: 28px; margin-bottom: 14px; }
.card h3 { font-size: 15px; font-weight: 700; color: #1a1a2e; margin: 0 0 8px; }
.card p { font-size: 13px; color: #6b7280; line-height: 1.6; margin: 0; }

.steps-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 900px; margin: 0 auto; }
.step { background: #fff; border-radius: 16px; padding: 32px 24px; box-shadow: 0 4px 16px rgba(106,11,228,0.08); text-align: center; }
.step-n { width: 42px; height: 42px; background: var(--p); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; margin: 0 auto 16px; }
.step h3 { font-size: 15px; font-weight: 700; color: #1a1a2e; margin: 0 0 8px; }
.step p { font-size: 13px; color: #6b7280; margin: 0; line-height: 1.6; }

.about-box { max-width: 800px; margin: 0 auto; }
.about-box p { font-size: 15px; color: #4b5563; line-height: 1.8; margin-bottom: 16px; }

#whyBanner .why-inner { max-width: 700px; margin: 0 auto; text-align: center; padding: 60px 0; }
#whyBanner h2 { font-size: 2rem; font-weight: 800; color: #fff; margin-bottom: 14px; }
#whyBanner h2 span { color: #c084fc; }
#whyBanner p { color: rgba(255,255,255,0.65); font-size: 1rem; margin-bottom: 28px; }
.cta-link { display: inline-block; padding: 14px 36px; background: var(--p); color: #fff; border-radius: 12px; font-weight: 700; font-size: 15px; text-decoration: none; box-shadow: 0 4px 20px rgba(106,11,228,0.45); transition: background 0.2s, transform 0.2s; }
.cta-link:hover { background: var(--p-h); transform: translateY(-2px); }

.faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 800px; margin: 0 auto; }
.faq-item { background: #fff; border-radius: 12px; border: 1px solid #ede9f8; overflow: hidden; }
.faq-q { padding: 16px 20px; font-weight: 700; font-size: 14px; color: #1a1a2e; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-q::after { content: '+'; font-size: 20px; color: var(--p); transition: transform 0.2s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.2s; font-size: 14px; color: #4b5563; line-height: 1.7; }
.faq-item.open .faq-a { max-height: 300px; padding: 0 20px 16px; }

@media (max-width: 900px) {
  .tool-grid { grid-template-columns: 1fr; }
  .form-panel { border-right: none; border-bottom: 1px solid #e4daff; }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .steps-3 { grid-template-columns: 1fr; max-width: 480px; }
}
@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; }
  .cards-4 { grid-template-columns: 1fr; }
  #hero h1 { font-size: 1.7rem; }
}
