:root {
  color-scheme: light;
  font-family: Inter, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f8fafc;
  color: #0f172a;
}

body.landing-page {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, #1e3a8a 0%, #0b1024 45%, #060a1a 100%);
  color: #f8fafc;
  overflow-x: hidden;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
}

.single-column {
  grid-template-columns: 1fr;
}

.narrow {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.panel {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 24px rgba(2, 6, 23, 0.08);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input,
textarea,
button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
}

button {
  cursor: pointer;
  background: #2563eb;
  color: #fff;
  border: none;
}

.btn-secondary {
  background: #475569;
}

.actions {
  display: flex;
  gap: 10px;
}

.muted {
  color: #64748b;
}

.preview-wrap {
  margin: 0 16px 16px;
}

.preview-full {
  margin: 0;
  width: 100%;
  height: 100vh;
}

.preview-brand {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1100;
  display: flex;
  align-items: center;
  padding: 4px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.preview-brand:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
}

.preview-brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: block;
  object-fit: cover;
}

.publish-fab {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1100;
  padding: 10px 16px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.preview-status {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 1050;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  max-width: min(560px, calc(100% - 32px));
}

.publish-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 32px);
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.publish-success-glow {
  position: absolute;
  width: min(90vw, 520px);
  height: min(90vw, 520px);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(34, 197, 94, 0.22) 0%,
    rgba(37, 99, 235, 0.12) 40%,
    transparent 70%
  );
  filter: blur(40px);
  pointer-events: none;
  animation: publishSuccessGlow 5s ease-in-out infinite;
}

.publish-success-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(88vh, 920px);
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 28px;
  padding: clamp(24px, 4vw, 40px) clamp(24px, 5vw, 44px) clamp(28px, 4vw, 36px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.04),
    0 4px 24px rgba(15, 23, 42, 0.08),
    0 32px 64px rgba(15, 23, 42, 0.28);
  animation: publishSuccessIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.publish-success-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(90deg, #22c55e, #3b82f6, #a855f7, #22c55e);
  background-size: 200% 100%;
  animation: publishAccentShift 4s linear infinite;
}

.publish-success-icon-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 8px;
}

.publish-success-icon-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ecfdf5, #d1fae5);
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.25),
    0 8px 24px rgba(34, 197, 94, 0.2);
  margin-bottom: 14px;
  animation: publishIconPop 0.55s cubic-bezier(0.34, 1.4, 0.64, 1) 0.1s both;
}

.publish-success-check {
  width: 38px;
  height: 38px;
  color: #15803d;
}

.publish-success-check path {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: publishCheckDraw 0.55s ease forwards 0.4s;
}

.publish-success-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #64748b;
}

.publish-success-body {
  color: #0f172a;
}

.publish-success-title {
  font-weight: 800;
  margin: 12px 0 18px;
  font-size: clamp(1.65rem, 5vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #15803d 0%, #0d9488 50%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
}

.publish-success-text {
  margin: 0 0 16px;
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  line-height: 1.7;
  text-align: center;
  color: #334155;
}

.publish-success-body a {
  color: #2563eb;
  font-weight: 600;
  word-break: break-all;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.publish-success-body a:hover {
  color: #1d4ed8;
}

.publish-success-contact {
  margin: 22px 0 0;
  font-weight: 600;
  font-size: clamp(0.98rem, 2.3vw, 1.15rem);
  text-align: center;
  padding: 20px 16px 0;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  color: #475569;
}

.publish-success-close {
  margin-top: 26px;
  width: 100%;
  padding: 16px 22px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 45%, #7c3aed 100%);
  box-shadow:
    0 4px 14px rgba(37, 99, 235, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.publish-success-close-main {
  font-size: 1.08rem;
  font-weight: 700;
}

.publish-success-close-sub {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.92;
}

.publish-success-close:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 28px rgba(37, 99, 235, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  filter: brightness(1.03);
}

.publish-success-close:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 3px;
}

@keyframes publishSuccessIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes publishSuccessGlow {
  0%,
  100% {
    opacity: 0.85;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes publishAccentShift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes publishIconPop {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes publishCheckDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .publish-success-title {
    color: #15803d;
    background: none;
  }
}

.hidden {
  display: none;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1000;
  display: grid;
  place-items: center;
  color: #fff;
  gap: 12px;
  text-align: center;
}

.loading-overlay.hidden {
  display: none;
}

.loading-card {
  min-width: 280px;
  padding: 24px 28px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.35);
}

.loading-card small {
  opacity: 0.75;
}

.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.landing-page .layout.landing-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
  position: relative;
  z-index: 2;
}

.landing-page .landing-brand {
  margin-bottom: 20px;
}

.landing-page .landing-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.landing-page .landing-brand-link:hover .landing-brand-name {
  opacity: 0.92;
}

.landing-page .landing-brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.landing-page .landing-brand-name {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, #e0f2fe, #a5b4fc, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-page .hero-panel {
  background: linear-gradient(140deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.6));
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(12px);
  padding: 30px;
  animation: panelFloat 6s ease-in-out infinite;
}

.landing-page .hero-badge {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(147, 197, 253, 0.45);
  padding: 7px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.landing-page h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0 0 12px;
  line-height: 1.15;
}

.landing-page .muted {
  color: #cbd5e1;
}

.landing-page .hero-form textarea {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.6);
  color: #f8fafc;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  resize: vertical;
  min-height: 150px;
}

.landing-page .hero-form input {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.6);
  color: #f8fafc;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.landing-page .hero-form textarea:focus,
.landing-page .hero-form input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  transform: translateY(-1px);
}

.landing-page .hero-form textarea::placeholder,
.landing-page .hero-form input::placeholder {
  color: #94a3b8;
}

.landing-page .cta-button {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(191, 219, 254, 0.45);
  background: linear-gradient(90deg, #2563eb, #7c3aed, #2563eb);
  background-size: 200% 200%;
  animation: gradientShift 3.5s ease infinite;
}

.landing-page .cta-button span {
  position: relative;
  z-index: 2;
}

.landing-page .cta-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.3), transparent 80%);
  transform: translateX(-110%);
  animation: shineSweep 2.2s ease-in-out infinite;
}

.landing-page #status {
  min-height: 22px;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(22px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.orb-one {
  width: 320px;
  height: 320px;
  top: -80px;
  left: -70px;
  background: #2563eb;
  animation: orbDrift 10s ease-in-out infinite;
}

.orb-two {
  width: 360px;
  height: 360px;
  right: -100px;
  bottom: -90px;
  background: #9333ea;
  animation: orbDrift 12s ease-in-out infinite reverse;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 95%);
  opacity: 0.3;
  pointer-events: none;
  z-index: 1;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shineSweep {
  0% { transform: translateX(-110%); }
  60%, 100% { transform: translateX(120%); }
}

@keyframes panelFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes orbDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(18px, -22px) scale(1.05); }
}

#previewFrame {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: none;
  border-radius: 0;
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.35);
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
}