:root {
  --bg-1: #061330;
  --bg-2: #081b46;
  --bg-3: #03153f;
  --card: rgba(10, 20, 52, 0.9);
  --card-border: rgba(212, 175, 55, 0.1);
  --text: #f7f4ea;
  --muted: #c8cde0;
  --gold: #d9b84d;
  --gold-strong: #e8c85f;
  --gold-soft: rgba(217, 184, 77, 0.12);
  --dark-btn: #1d2748;
  --dark-btn-hover: #293860;
  --input-bg: #f3f4f8;
  --input-text: #1f2940;
  --line: rgba(255, 255, 255, 0.08);
  --success: #24c38a;
  --danger: #ef6b6b;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(17, 41, 95, 0.92), transparent 32%),
    radial-gradient(circle at bottom right, rgba(14, 39, 103, 0.65), transparent 26%),
    linear-gradient(90deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
}

body {
  padding: 24px;
}

.page-shell {
  position: relative;
}

.container {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.topbar {
  margin-bottom: 28px;
}

.hero-copy {
  margin-bottom: 18px;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--gold);
  font-size: 0.92rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.small-eyebrow {
  margin-bottom: 8px;
  font-size: 0.78rem;
}

h1 {
  margin: 0 0 14px;
  max-width: 980px;
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 0.94;
  font-weight: 850;
  color: var(--gold-strong);
}

.subtitle {
  margin: 0 0 18px;
  max-width: 780px;
  font-size: 1.18rem;
  line-height: 1.6;
  color: var(--muted);
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.feature-pill.locked {
  background: var(--gold-soft);
  color: var(--gold-strong);
}

.account-shell {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  margin-top: 22px;
  border: 1px solid var(--card-border);
  border-radius: 28px;
  background: rgba(11, 20, 48, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.account-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.account-label {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.auth-status {
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold-strong);
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 800;
  font-size: 0.92rem;
}

.plan-status-copy {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.auth-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.link-btn {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--gold-strong);
  font-weight: 700;
  font-size: 0.92rem;
  width: fit-content;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

.reset-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.grid {
  display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(460px, 1fr);
  gap: 22px;
  align-items: start;
}

.right-stack {
  display: grid;
  gap: 22px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.left-card {
  position: sticky;
  top: 16px;
}

.card-head,
.output-top,
.history-top,
.pricing-head,
.plan-top,
.locked-tools-head,
.dashboard-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.card h2,
.history-title,
.dashboard-head h2 {
  margin: 0 0 18px;
  font-size: 2rem;
  line-height: 1.1;
}

.output-top h2,
.history-top h2,
.card-head h2,
.dashboard-head h2 {
  margin: 0;
}

label {
  display: block;
  margin-bottom: 9px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

textarea,
input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  border: none;
  outline: none;
  border-radius: 14px;
  padding: 16px 18px;
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 1rem;
  font-family: inherit;
}

textarea {
  resize: vertical;
  min-height: 165px;
  line-height: 1.45;
}

.starter-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.starter-chip {
  border: 1px solid rgba(217, 184, 77, 0.28);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 0.87rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.14s ease;
}

.starter-chip:hover {
  background: var(--gold-soft);
  transform: translateY(-1px);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

#customBrandWrap {
  margin-top: 12px;
}

.advanced-panel {
  margin-top: 16px;
  border: 1px solid rgba(217, 184, 77, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  padding: 14px 16px;
}

.advanced-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--muted);
  list-style: none;
}

.advanced-panel summary::-webkit-details-marker {
  display: none;
}

.advanced-panel summary::after {
  content: "＋";
  margin-left: 8px;
  color: var(--gold-strong);
}

.advanced-panel[open] summary::after {
  content: "−";
}

.advanced-content {
  margin-top: 14px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  font-weight: 600;
  color: var(--text);
}

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

.image-only-upload-section {
  padding: 2px 0;
}

.image-only-helper {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.upload-wrap {
  padding: 18px;
  border: 1.5px dashed rgba(217, 184, 77, 0.42);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 18px;
}

.upload-hint {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--muted);
}

.image-preview-wrap {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.image-preview {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  margin-bottom: 12px;
}

.button-stack {
  display: grid;
  gap: 12px;
}

.secondary-actions {
  margin-top: 12px;
}

.primary-generate-btn {
  min-height: 58px;
  font-size: 1.05rem;
  box-shadow: 0 10px 28px rgba(217, 184, 77, 0.24);
}

.gate-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(217,184,77,0.08);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.btn {
  border: none;
  outline: none;
  border-radius: 16px;
  padding: 15px 18px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease, background 0.14s ease;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: 0.98;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn.full {
  width: 100%;
}

.btn.small {
  width: auto;
  padding: 11px 14px;
  font-size: 0.92rem;
}

.btn.gold {
  background: var(--gold);
  color: #0b1533;
}

.btn.gold:hover {
  background: var(--gold-strong);
}

.btn.dark {
  background: var(--dark-btn);
  color: #f5f7ff;
}

.btn.dark:hover {
  background: var(--dark-btn-hover);
}

.premium-lock-btn.locked-state {
  position: relative;
  opacity: 0.82;
}

.premium-lock-btn.locked-state::after {
  content: "Premium";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
}

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

.dashboard-card {
  padding-bottom: 24px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.metric-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(217,184,77,0.08);
}

.metric-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.metric-value {
  color: var(--gold-strong);
  font-size: 2rem;
  font-weight: 850;
  line-height: 1;
}

.metric-value.small {
  font-size: 1.15rem;
  line-height: 1.2;
}

.dashboard-lower {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.dashboard-panel {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(217,184,77,0.08);
}

.dashboard-panel h3 {
  margin: 0;
  font-size: 1.18rem;
}

.activity-list,
.revenue-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.activity-item,
.revenue-item {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}

.activity-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.activity-brand {
  color: var(--gold-strong);
  font-weight: 800;
}

.activity-platform {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.activity-prompt {
  color: var(--text);
  font-size: 0.94rem;
}

.revenue-title {
  color: var(--text);
  font-weight: 800;
  margin-bottom: 4px;
}

.revenue-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-mini {
  color: var(--muted);
  font-size: 0.95rem;
}

.locked-tools {
  margin-top: 24px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(217,184,77,0.08);
}

.locked-tools h3 {
  margin: 0;
  font-size: 1.35rem;
}

.locked-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.locked-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-weight: 600;
  position: relative;
}

.locked-item::after {
  content: "Locked";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-strong);
  font-size: 0.84rem;
  font-weight: 800;
}

.locked-item.upcoming-item::after {
  content: "Coming soon";
}

.locked-item.unlocked {
  color: var(--text);
  background: rgba(36,195,138,0.08);
  border: 1px solid rgba(36,195,138,0.2);
}

.locked-item.unlocked::after {
  content: "Unlocked";
  color: var(--success);
}

.mid-cta-card {
  display: grid;
  gap: 14px;
  background: linear-gradient(145deg, rgba(217, 184, 77, 0.12), rgba(29, 39, 72, 0.5));
  border: 1px solid rgba(217, 184, 77, 0.2);
}

.mid-cta-copy {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold-strong);
}

.mid-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.upgrade-cta-strip {
  margin-top: 18px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(217, 184, 77, 0.08);
  border: 1px solid rgba(217, 184, 77, 0.18);
  display: grid;
  gap: 12px;
}

.upgrade-cta-copy {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-strong);
}

.upgrade-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pricing-box {
  margin-top: 28px;
  padding-top: 4px;
}

.marketplace-card {
  display: grid;
  gap: 18px;
}

.marketplace-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.marketplace-head h2 {
  margin: 0 0 10px;
  font-size: 2rem;
}

.marketplace-subheadline {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.65;
}

.marketplace-support {
  margin: 0;
  color: var(--gold-strong);
  font-weight: 700;
}

.marketplace-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.marketplace-value-grid,
.marketplace-creator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.marketplace-value-card,
.marketplace-creator-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(217, 184, 77, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.marketplace-value-card h3,
.marketplace-preview-head h3 {
  margin: 0 0 8px;
  color: var(--gold-strong);
}

.marketplace-value-card p,
.marketplace-creator-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.marketplace-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.marketplace-chip-wrap .feature-pill {
  padding: 8px 12px;
  font-size: 0.84rem;
}

.marketplace-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.marketplace-creator-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.marketplace-creator-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.marketplace-creator-top strong {
  color: var(--text);
}

.marketplace-creator-top span {
  color: var(--gold-strong);
  font-size: 0.9rem;
  font-weight: 700;
}

.marketplace-creator-card p + p {
  margin-top: 6px;
}

.marketplace-creator-card .btn {
  margin-top: 10px;
}

.marketplace-form-wrap {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(217, 184, 77, 0.14);
}

.marketplace-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.marketplace-form-head h3 {
  margin: 0;
}

.marketplace-form-grid {
  display: grid;
  gap: 10px;
}

.pricing-box h3 {
  margin: 0 0 8px;
  font-size: 1.9rem;
}

.pricing-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.pricing-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.plan-group {
  position: relative;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(217, 184, 77, 0.08);
}

.plan-group.featured {
  border: 1px solid rgba(217,184,77,0.22);
  box-shadow: inset 0 0 0 1px rgba(217,184,77,0.06);
}

.popular-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-strong);
  font-size: 0.8rem;
  font-weight: 800;
}

.plan-group h4 {
  margin: 0 0 6px;
  font-size: 1.22rem;
  color: var(--gold-strong);
}

.plan-group p {
  margin: 0 0 14px;
  font-size: 0.95rem;
}

.plan-features {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.plan-features span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.plan-group .btn + .btn {
  margin-top: 10px;
}

.price-tag {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-strong);
  font-weight: 800;
  white-space: nowrap;
}

.output-card {
  min-height: 760px;
}

.status-pill,
.mini-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f7fbff;
  font-weight: 700;
  font-size: 0.95rem;
}

.gold-pill {
  background: var(--gold-soft);
  color: var(--gold-strong);
}

.output-box,
.history-box {
  min-height: 135px;
  padding: 26px 28px;
  border-radius: 24px;
  border: 1px solid rgba(217, 184, 77, 0.08);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  line-height: 1.7;
}

.output-box h3,
.history-item h3 {
  margin: 14px 0 8px;
  color: var(--gold-strong);
  font-size: 1.12rem;
}

.output-box h3:first-child,
.history-item h3:first-child {
  margin-top: 0;
}

.output-box p,
.history-item p {
  margin: 0 0 12px;
  color: var(--text);
}

.loading-stage strong {
  color: var(--gold-strong);
  display: inline-block;
  margin-bottom: 8px;
}

.loading-stage p {
  margin: 0;
  color: var(--muted);
}

.copy-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 24px;
}

.history-top {
  margin-top: 10px;
  margin-bottom: 16px;
}

.history-item {
  padding: 0;
}

.compact-history {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(217, 184, 77, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.history-details {
  margin-top: 10px;
}

.history-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--gold-strong);
}

.history-details-body {
  margin-top: 12px;
}

.history-box hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

.empty-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.empty-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: var(--gold);
}

.empty-title {
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.empty-subtitle {
  color: var(--muted);
}

.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100% - 36px));
}

.toast {
  padding: 14px 16px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 20, 48, 0.96);
  color: white;
  font-weight: 700;
  animation: slideIn 0.2s ease-out;
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.info {
  border-left: 4px solid var(--gold);
}

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

.hidden {
  display: none !important;
}

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

  .left-card {
    position: static;
  }

  .output-card {
    min-height: auto;
  }

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

  .dashboard-lower {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    padding: 16px;
  }

  .card {
    padding: 20px;
    border-radius: 22px;
  }

  .auth-fields,
  .two-col,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .auth-actions {
    width: 100%;
  }

  .auth-actions .btn {
    flex: 1;
  }

  h1 {
    font-size: 2.55rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .hero-cta-row .btn,
  .mid-cta-actions .btn,
  .upgrade-cta-actions .btn,
  .marketplace-cta-row .btn {
    flex: 1;
  }

  .output-box,
  .history-box {
    padding: 20px;
  }

  .pricing-head,
  .plan-top,
  .card-head,
  .output-top,
  .history-top,
  .locked-tools-head,
  .account-top,
  .dashboard-head,
  .panel-head,
  .activity-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .popular-tag {
    position: static;
    display: inline-flex;
    margin-bottom: 12px;
  }

  .marketplace-value-grid,
  .marketplace-creator-grid {
    grid-template-columns: 1fr;
  }
}
