:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --radius: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
}

/* Navigation */
header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
}
.nav-container {
  max-width: 1050px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo span.accent { color: var(--primary); }
.badge {
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Layout Structure */
main {
  max-width: 1050px;
  margin: 32px auto;
  padding: 0 20px;
}
.hero {
  text-align: center;
  margin-bottom: 28px;
}
.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin-bottom: 8px;
}
.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 750px;
  margin: 0 auto;
}

/* Main Container (Form + Preview Side-by-Side) */
.container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
}

@media (max-width: 840px) {
  .container {
    grid-template-columns: 1fr;
  }
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.form-group {
  margin-bottom: 1rem;
}
.form-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Tabs */
.tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.tab-btn {
  background: none;
  border: none;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: 0.9rem;
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.input-group { display: none; }
.input-group.active { display: block; }

textarea {
  width: 100%;
  height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  resize: vertical;
  outline: none;
}
textarea:focus { border-color: var(--primary); }

/* Button Toggles */
.btn-group {
  display: flex;
  gap: 0.5rem;
}

.btn-option {
  flex: 1;
  height: 40px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-option:hover { border-color: var(--primary); }
.btn-option.active {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* Select & Input Elements */
select, input[type="text"] {
  width: 100%;
  height: 40px;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-main);
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.15s ease;
}

select:focus, input[type="text"]:focus {
  border-color: var(--primary);
}

/* Color Pickers */
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 0.5rem;
  height: 40px;
  background: #fff;
}

.color-picker-wrapper input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  background: none;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--border);
  border-radius: 4px;
}

.color-picker-wrapper span {
  font-size: 0.85rem;
  font-family: monospace;
  color: var(--text-main);
}

/* Dropzone Upload */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease;
  background: var(--bg-body);
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone:hover { border-color: var(--primary); }
.dropzone p {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropzone input { display: none; }

/* Tooltips */
.label-with-tooltip { display: flex; align-items: center; gap: 6px; }
.tooltip-container { position: relative; display: inline-flex; align-items: center; }
.tooltip-icon { 
  display: inline-flex; justify-content: center; align-items: center; 
  width: 16px; height: 16px; background: #e2e8f0; color: #475569; 
  border-radius: 50%; font-size: 0.7rem; font-weight: 700; cursor: help; 
}
.tooltip-text {
  visibility: hidden; opacity: 0; width: 200px; background-color: #0f172a; color: #fff;
  text-align: left; border-radius: 6px; padding: 8px 10px; position: absolute;
  z-index: 10; bottom: 125%; left: 50%; transform: translateX(-50%);
  font-size: 0.75rem; font-weight: 400; line-height: 1.3;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); transition: opacity 0.2s ease, visibility 0.2s ease;
}
.tooltip-text::after {
  content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px;
  border-width: 5px; border-style: solid; border-color: #0f172a transparent transparent transparent;
}
.tooltip-container:hover .tooltip-text { visibility: visible; opacity: 1; }

/* Preview Sidebar */
.preview-section {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.preview-box {
  width: 100%;
  aspect-ratio: 1;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.preview-box div {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  width: 100%;
  height: 44px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }

/* Progress UI */
.progress-wrapper {
  width: 100%;
  margin-top: 12px;
  display: none;
}
.progress-bar { background: var(--border); height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.progress-fill { background: var(--primary); height: 100%; width: 0%; transition: width 0.1s linear; }
.status-text { font-size: 0.75rem; color: var(--text-muted); text-align: center; }

.hidden { display: none !important; }

/* SEO & FAQ Section */
.content-section { margin-top: 60px; }
.content-section h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 16px; color: var(--text-main); }
.content-section p { margin-bottom: 16px; color: var(--text-muted); }

.grid-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin: 28px 0; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); padding: 20px; border-radius: var(--radius); }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 6px; }

.faq-category { font-size: 1.1rem; font-weight: 700; margin: 24px 0 12px 0; color: var(--text-main); border-bottom: 2px solid var(--border); padding-bottom: 6px; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; }
.faq-item h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; color: var(--text-main); }
.faq-item p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0; }

footer { text-align: center; border-top: 1px solid var(--border); padding: 32px 20px; margin-top: 60px; color: var(--text-muted); font-size: 0.875rem; }