@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

html[data-theme='dark'] {
  --page-text: #eaf2ff;
  --hero-text: #eaf2ff;
  --hero-copy: rgba(234, 242, 255, 0.76);
  --bg-main:
    radial-gradient(circle at top left, rgba(70, 215, 172, 0.18), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(255, 178, 77, 0.18), transparent 22%),
    linear-gradient(145deg, #07101d 0%, #091525 48%, #0a1020 100%);
  --panel-shell: linear-gradient(180deg, rgba(16, 28, 50, 0.82), rgba(9, 16, 31, 0.94));
  --panel-bg: rgba(255, 255, 255, 0.94);
  --panel-soft: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 255, 0.95));
  --panel-text: #0d1730;
  --panel-text-soft: #51617f;
  --line: rgba(130, 160, 214, 0.18);
  --line-strong: rgba(255, 255, 255, 0.08);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.96));
  --card-text: #0d1730;
  --input-bg: #ffffff;
  --input-border: rgba(133, 155, 194, 0.38);
  --muted-chip-bg: rgba(239, 244, 255, 0.86);
  --muted-chip-text: #183058;
  --secondary-bg: #eff4ff;
  --secondary-text: #152d58;
  --summary-bg: rgba(255, 255, 255, 0.08);
  --summary-text: rgba(234, 242, 255, 0.8);
  --footer-text: rgba(234, 242, 255, 0.72);
  --empty-text: #7482a2;
  --meta-bg: #f4f7fd;
  --meta-text: #445270;
  --meta-title: #223252;
  --theme-button-bg: rgba(255, 255, 255, 0.08);
  --theme-button-text: #f8fbff;
  --theme-button-border: rgba(255, 255, 255, 0.12);
}

html[data-theme='light'] {
  --page-text: #10203c;
  --hero-text: #10203c;
  --hero-copy: rgba(16, 32, 60, 0.76);
  --bg-main:
    radial-gradient(circle at top left, rgba(14, 184, 138, 0.14), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(255, 178, 77, 0.16), transparent 22%),
    linear-gradient(145deg, #f5fbff 0%, #edf4ff 45%, #fdf6ef 100%);
  --panel-shell: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(242, 247, 255, 0.94));
  --panel-bg: rgba(255, 255, 255, 0.92);
  --panel-soft: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 249, 253, 0.98));
  --panel-text: #0d1730;
  --panel-text-soft: #52627d;
  --line: rgba(89, 117, 168, 0.15);
  --line-strong: rgba(89, 117, 168, 0.12);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 255, 0.98));
  --card-text: #10203c;
  --input-bg: #ffffff;
  --input-border: rgba(133, 155, 194, 0.35);
  --muted-chip-bg: rgba(248, 250, 255, 0.96);
  --muted-chip-text: #183058;
  --secondary-bg: #f5f8ff;
  --secondary-text: #17315f;
  --summary-bg: rgba(12, 34, 65, 0.04);
  --summary-text: rgba(16, 32, 60, 0.82);
  --footer-text: rgba(16, 32, 60, 0.72);
  --empty-text: #697793;
  --meta-bg: #f6f8fc;
  --meta-text: #41506d;
  --meta-title: #20314f;
  --theme-button-bg: rgba(12, 34, 65, 0.06);
  --theme-button-text: #10203c;
  --theme-button-border: rgba(89, 117, 168, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
  background: var(--bg-main);
  color: var(--page-text);
  font: 16px/1.5 'IBM Plex Sans', 'Segoe UI', sans-serif;
  transition: background 180ms ease, color 180ms ease;
}

button,
input,
textarea {
  font: inherit;
}

.scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 85%);
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(14px);
}

.orb-a {
  width: 340px;
  height: 340px;
  top: -80px;
  left: -70px;
  background: rgba(70, 215, 172, 0.2);
}

.orb-b {
  width: 280px;
  height: 280px;
  right: -40px;
  top: 18%;
  background: rgba(255, 178, 77, 0.18);
}

.app {
  position: relative;
  width: min(1120px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--panel-shell);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 28px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(70, 215, 172, 0.14), rgba(255, 178, 77, 0.08), transparent 72%);
}

.hero-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.theme-toggle {
  border: 1px solid var(--theme-button-border);
  background: var(--theme-button-bg);
  color: var(--theme-button-text);
  border-radius: 999px;
  padding: 10px 14px;
}

.hero-mark {
  display: grid;
  place-items: center;
  width: 74px;
  aspect-ratio: 1;
  border-radius: 24px;
  background: linear-gradient(145deg, #46d7ac, #ffb24d);
  color: #07101d;
  font: 700 1.4rem/1 'Space Grotesk', sans-serif;
  letter-spacing: 0.08em;
}

.eyebrow {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--theme-button-bg);
  color: var(--theme-button-text);
  font-size: 0.77rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1,
.insight-head h2 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
}

.hero h1 {
  margin-top: 12px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.02;
  max-width: 12ch;
  color: var(--hero-text);
}

.hero p {
  margin: 12px 0 0;
  max-width: 60ch;
  color: var(--hero-copy);
}

.hero-side {
  display: grid;
  gap: 12px;
  min-width: 180px;
}

.hero-stat {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--theme-button-bg);
  border: 1px solid var(--line-strong);
  color: var(--hero-text);
}

.hero-stat-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: var(--hero-copy);
}

.content {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
}

.left,
.right {
  padding: 24px;
}

.left {
  border-right: 1px solid var(--line);
}

.panel,
.card {
  border-radius: 24px;
}

.panel {
  padding: 20px;
  background: var(--panel-bg);
  color: var(--panel-text);
  border: 1px solid rgba(148, 165, 201, 0.2);
}

.panel-soft {
  background: var(--panel-soft);
}

.field {
  margin-bottom: 18px;
}

.field-stretch {
  min-width: 0;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

label,
.facts dt {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--panel-text);
}

textarea,
input[type='number'] {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--panel-text);
  padding: 14px 16px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

textarea:focus,
input[type='number']:focus,
input[type='range']:focus {
  border-color: rgba(14, 184, 138, 0.6);
  box-shadow: 0 0 0 4px rgba(70, 215, 172, 0.14);
}

input[type='range'] {
  width: 100%;
  accent-color: #0eb88a;
}

.field-hint {
  margin: 8px 0 0;
  color: var(--panel-text-soft);
  font-size: 0.88rem;
}

.status-badge,
.feedback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge {
  background: #e9eefb;
  color: #47526e;
}

.status-badge.ready {
  background: rgba(70, 215, 172, 0.16);
  color: #0b7e5f;
}

.status-badge.link {
  background: rgba(56, 153, 255, 0.14);
  color: #1b5eb6;
}

.status-badge.whatsapp {
  background: rgba(43, 194, 120, 0.16);
  color: #118652;
}

.status-badge.text {
  background: rgba(255, 178, 77, 0.18);
  color: #aa6508;
}

.quick-actions,
.actions,
.settings-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ghost-pill {
  border: 1px solid rgba(85, 108, 149, 0.24);
  background: var(--muted-chip-bg);
  color: var(--muted-chip-text);
  border-radius: 999px;
  padding: 10px 14px;
}

.settings-grid {
  align-items: end;
}

.settings-grid .field:first-child {
  flex: 1 1 260px;
}

.settings-grid .field:last-child {
  flex: 0 0 160px;
}

button {
  appearance: none;
  border: none;
  cursor: pointer;
  border-radius: 16px;
  padding: 13px 18px;
  font-weight: 700;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease, background 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  filter: none;
}

#btnGenerate {
  background: linear-gradient(135deg, #46d7ac, #0eb88a);
  color: #042118;
  box-shadow: 0 14px 30px rgba(14, 184, 138, 0.24);
}

.secondary {
  background: var(--secondary-bg);
  color: var(--secondary-text);
  border: 1px solid rgba(94, 118, 165, 0.18);
}

.danger {
  background: linear-gradient(135deg, #ffb4b4, #ff6f6f);
  color: #3d1010;
}

.insight-panel {
  margin-top: 18px;
  background: var(--summary-bg);
  color: var(--summary-text);
  border: 1px solid var(--line-strong);
}

.insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.feedback {
  background: var(--theme-button-bg);
  color: var(--theme-button-text);
}

.feedback.success {
  background: rgba(70, 215, 172, 0.16);
  color: #0b7e5f;
}

.feedback.warn {
  background: rgba(255, 178, 77, 0.16);
  color: #aa6508;
}

.feedback.error {
  background: rgba(255, 111, 111, 0.16);
  color: #c03a3a;
}

.facts {
  display: grid;
  gap: 16px;
  margin: 0;
}

.facts div {
  display: grid;
  gap: 6px;
}

.facts dd {
  margin: 0;
  color: var(--summary-text);
  word-break: break-word;
}

.card {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 18px;
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid rgba(148, 165, 201, 0.2);
}

.qrbox {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(139, 160, 197, 0.6);
  background: linear-gradient(45deg, rgba(14, 184, 138, 0.035), transparent 38%), #fff;
}

.qrbox img {
  max-width: 100%;
  height: auto;
  animation: reveal 220ms ease;
}

.empty-state {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  color: var(--empty-text);
}

.meta {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  color: var(--meta-text);
  font-size: 0.92rem;
}

.meta-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--meta-bg);
  border: 1px solid rgba(148, 165, 201, 0.2);
  word-break: break-word;
}

.meta-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--meta-title);
}

.ok {
  color: #0eb88a;
}

.err {
  color: #c03a3a;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--line);
  color: var(--footer-text);
  font-size: 0.87rem;
}

.creator {
  color: var(--hero-text);
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 920px) {
  body {
    padding: 16px;
  }

  .hero,
  .content {
    grid-template-columns: 1fr;
  }

  .hero-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .left {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .hero,
  .left,
  .right,
  footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero-mark {
    width: 60px;
    border-radius: 18px;
  }

  .hero-side {
    grid-template-columns: 1fr;
  }

  .actions > button,
  .quick-actions > button,
  .hero-topbar > button {
    width: 100%;
  }

  .settings-grid .field:last-child {
    flex-basis: 100%;
  }

  .qrbox {
    min-height: 320px;
  }
}