:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --panel: #ffffff;
  --text: #1f1f1f;
  --muted: #5e5e5e;
  --soft: #a3a4a4;
  --line: #e4e1dd;
  --accent: #ff6f17;
  --accent-dark: #dc5d0e;
  --accent-soft: #fff0e7;
  --danger: #b42318;
  --success: #067647;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 6% 8%, rgba(255, 111, 23, 0.09) 0 92px, transparent 93px),
    linear-gradient(135deg, #ffffff 0%, var(--bg) 58%, #ecebe8 100%);
  font-family: Montserrat, Arial, Helvetica, sans-serif;
}

body.embedded {
  min-height: auto;
  background: #fff;
}

.app-shell {
  position: relative;
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 48px 18px;
}

.brand-mark {
  position: absolute;
  inset: 24px auto auto -54px;
  width: 156px;
  height: 156px;
  border: 18px solid rgba(31, 31, 31, 0.06);
  border-right-color: transparent;
  border-radius: 50%;
  pointer-events: none;
}

.panel {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.985) 58%),
    url("/static/assets/pattern-gray.png");
  background-position: center, right -120px top -160px;
  background-repeat: no-repeat;
  background-size: auto, 320px auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(31, 31, 31, 0.1);
  padding: 34px;
  animation: panelIn 420ms ease-out both;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: var(--accent);
}

.embedded-shell {
  width: min(100%, 600px);
  padding: 16px;
}

.embedded-panel {
  border: 0;
  box-shadow: none;
  padding: 22px;
}

.header {
  margin-bottom: 30px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.logo-symbol {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(255, 111, 23, 0.16));
}

.brand-name,
.brand-subtitle {
  margin: 0;
  text-transform: uppercase;
}

.brand-name {
  color: var(--accent);
  font-size: 17px;
  font-weight: 800;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 560px;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 900;
}

.form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfbfa;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 0 15px;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus {
  border-color: var(--accent);
  background: #fff;
  outline: 4px solid rgba(255, 111, 23, 0.16);
}

.primary-button {
  min-height: 54px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0 18px;
  text-transform: uppercase;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  background: var(--accent-dark);
  box-shadow: 0 12px 26px rgba(255, 111, 23, 0.24);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.message {
  min-height: 24px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.message a {
  color: var(--accent-dark);
  font-weight: 800;
}

.generation-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 240, 231, 0.86)),
    url("/static/assets/pattern-gray.png");
  background-position: center;
  background-size: 360px auto;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.01);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 5;
}

.panel.is-generating .generation-loader {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.loader-card {
  position: relative;
  display: grid;
  place-items: center;
  width: 174px;
  height: 174px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 62px rgba(31, 31, 31, 0.14);
}

.loader-card p {
  position: absolute;
  top: calc(100% + 16px);
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.loader-symbol {
  width: 78px;
  height: 78px;
  object-fit: contain;
  animation: loaderPulse 1100ms ease-in-out infinite;
}

.loader-ring {
  position: absolute;
  inset: 12px;
  border: 3px solid rgba(163, 164, 164, 0.26);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: loaderSpin 900ms linear infinite;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes loaderPulse {
  0%,
  100% {
    transform: scale(0.96);
  }

  50% {
    transform: scale(1.04);
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 16px;
  }

  .panel {
    padding: 20px;
  }

  h1 {
    font-size: 27px;
  }

  .brand-mark {
    display: none;
  }
}
