:root {
  --bg: #09090b;
  --surface: #121217;
  --surface-2: #18181f;
  --border: #27272a;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --green: #10b981;
  --radius: 16px;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* TOPBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #09090b;
  font-weight: 900;
  font-size: 13px;
  display: grid;
  place-items: center;
}

.pro-tag {
  color: var(--accent);
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-install {
  background: #064e3b;
  color: #6ee7b7;
  border: 1px solid #059669;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* LAYOUT */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.hero {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 28px;
}

.hero-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(26px, 5vw, 40px);
  line-height: 1.15;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.accent-text {
  color: var(--accent);
}

.hero p {
  color: var(--muted);
  font-size: 15px;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

@media (min-width: 900px) {
  .workspace {
    grid-template-columns: 1.05fr 0.95fr;
  }
  .preview-panel {
    position: sticky;
    top: 76px;
  }
}

/* CARDS & FORMS */
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.step-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 13px;
  color: #d4d4d8;
  margin: 12px 0 6px;
  font-weight: 500;
}

input[type="text"],
input[type="url"],
input[type="tel"],
select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

input:focus,
select:focus {
  border-color: var(--accent);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  cursor: pointer;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* TABS & TEMPLATE BUTTONS */
.type-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.type-tab,
.tpl-btn {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.type-tab.active,
.tpl-btn.active {
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
  border-color: var(--accent);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}

/* LOGO & COLORS */
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-file {
  display: inline-block;
  margin: 0;
  background: var(--surface-2);
  border: 1px dashed #3f3f46;
  color: var(--text);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}

.btn-ghost-sm {
  background: transparent;
  color: #fca5a5;
  border: 1px solid #7f1d1d;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

input[type="color"] {
  width: 40px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #27272a;
  cursor: pointer;
}

/* PREVIEW PANEL */
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12px;
}

.live-hint {
  color: #34d399;
  font-weight: 600;
}

.size-badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.canvas-wrap {
  background: #050507;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  justify-content: center;
}

#posterCanvas {
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.error-msg {
  color: #fca5a5;
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
}

.download-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.btn-primary,
.btn-stripe-main {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  color: #09090b;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
}

.btn-secondary {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.promo-line {
  text-align: center;
  font-size: 12px;
  color: #fcd34d;
  margin-top: 2px;
}

/* FEATURES */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.features-grid h4 {
  font-size: 15px;
  margin-bottom: 6px;
}

.features-grid p {
  font-size: 13px;
  color: var(--muted);
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  background: #121217;
  border: 1px solid #2e2e38;
  border-radius: 20px;
  padding: 24px 20px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.badge-bf {
  display: inline-block;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 10px;
}

.modal-box h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.price-now {
  font-size: 34px;
  font-weight: 900;
  color: var(--accent);
}

.price-old {
  font-size: 16px;
  color: var(--muted);
  text-decoration: line-through;
}

.badge-life {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.modal-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.benefits-list {
  list-style: none;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #e4e4e7;
}

.divider-label {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 14px 0 8px;
}

.feedback-msg {
  font-size: 12px;
  margin-top: 8px;
  text-align: center;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 90vw;
  text-align: center;
}
