:root {
  color-scheme: light dark;
  font-family: "Fredoka", "Space Grotesk", "Segoe UI", sans-serif;
  line-height: 1.6;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-muted: rgba(255, 255, 255, 0.82);
  --ink: #102a43;
  --accent: #6366f1;
  --accent-secondary: #22d3ee;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --accent-border: rgba(99, 102, 241, 0.35);
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2.5rem 1.25rem 5rem;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff8e7 0%, #f3f4ff 40%, #f9fbff 70%);
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 65%);
  filter: blur(0px);
  opacity: 0.28;
  z-index: -1;
  transition: transform 400ms ease, opacity 400ms ease;
}

body::before {
  top: -140px;
  left: -120px;
}

body::after {
  bottom: -160px;
  right: -120px;
  background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 65%);
}

.page {
  width: min(920px, 100%);
  display: grid;
  gap: 2.5rem;
}

.hero {
  text-align: center;
  background: var(--surface);
  border-radius: 28px;
  padding: 3rem 2.5rem;
  box-shadow: 0 26px 55px rgba(15, 23, 42, 0.12);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.9), transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.6), transparent 60%);
  opacity: 0.7;
  pointer-events: none;
}

.hero h1 {
  margin: 0.6rem 0 0.8rem;
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
}

.card {
  background: var(--surface-muted);
  border-radius: 28px;
  padding: 2.3rem;
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(12px);
}

.form {
  display: grid;
  gap: 1.7rem;
}

.field {
  display: grid;
  gap: 0.6rem;
}

label {
  font-weight: 600;
  font-size: 1.02rem;
}

.field__label,
.field--remix legend {
  font-weight: 600;
  font-size: 1.02rem;
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.field--remix {
  gap: 0.9rem;
}

.field--remix legend {
  margin-bottom: -0.2rem;
}

.remix-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.remix-option {
  display: block;
  position: relative;
}

.remix-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  border-radius: 20px;
}

.remix-option__card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid rgba(148, 163, 184, 0.32);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  min-height: 100%;
}

.remix-option__icon {
  font-size: 1.35rem;
}

.remix-option__label {
  font-weight: 600;
  font-size: 1rem;
}

.remix-option__description {
  font-size: 0.9rem;
  color: rgba(15, 23, 42, 0.7);
}

.remix-option input:checked + .remix-option__card {
  border-color: var(--accent);
  box-shadow: 0 18px 32px rgba(99, 102, 241, 0.22);
  transform: translateY(-2px);
}

.remix-option input:focus-visible + .remix-option__card {
  box-shadow: 0 0 0 4px var(--accent-soft);
  border-color: var(--accent-secondary);
}

.field--showcase {
  gap: 0.9rem;
}

.style-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
}

.style-card {
  position: relative;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100%;
}

.style-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.style-card__image {
  position: relative;
  min-height: 160px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.3));
}

.style-card__image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--sample-image);
  background-size: cover;
  background-position: center;
  filter: saturate(1.1) contrast(1.05);
  opacity: 0;
  transition: opacity 220ms ease;
}

.style-card__image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.55), rgba(34, 211, 238, 0.55));
  mix-blend-mode: screen;
  opacity: 0.85;
  transition: opacity 220ms ease;
}

.style-card__image--has-preview::before {
  opacity: 1;
}

.style-card__meta {
  padding: 1.2rem 1.35rem 1.4rem;
  display: grid;
  gap: 0.4rem;
}

.style-card__label {
  font-weight: 600;
  font-size: 1.05rem;
}

.style-card__description {
  font-size: 0.92rem;
  color: rgba(15, 23, 42, 0.75);
}

.style-card--active {
  transform: translateY(-4px);
  box-shadow: 0 24px 45px rgba(99, 102, 241, 0.28);
}

.style-card--active .style-card__image::after {
  opacity: 1;
}

.style-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.2);
}

.style-card:hover .style-card__image::after {
  opacity: 0.95;
}

.style-card[data-theme="cinematic"] .style-card__image::after {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.68), rgba(251, 113, 133, 0.62));
}

.style-card[data-theme="editorial"] .style-card__image::after {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.68), rgba(250, 204, 21, 0.45));
}

.style-card[data-theme="artdeco"] .style-card__image::after {
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.68), rgba(253, 230, 138, 0.45));
}

.style-card[data-theme="lifestyle"] .style-card__image::after {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.6), rgba(34, 197, 94, 0.58));
}

.style-card[data-theme="fantasy"] .style-card__image::after {
  background: linear-gradient(135deg, rgba(180, 83, 241, 0.65), rgba(59, 130, 246, 0.58));
}

.style-card[data-theme="neon"] .style-card__image::after {
  background: linear-gradient(135deg, rgba(255, 97, 216, 0.68), rgba(255, 165, 58, 0.62));
}

.style-card[data-theme="vacation"] .style-card__image::after {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.65), rgba(249, 115, 22, 0.58));
}

.style-card[data-theme="vintage"] .style-card__image::after {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.68), rgba(180, 83, 9, 0.58));
}

.style-card[data-theme="cyber"] .style-card__image::after {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.68), rgba(168, 85, 247, 0.58));
}

.style-card[data-theme="professional"] .style-card__image::after {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.65), rgba(34, 211, 238, 0.58));
}

.status {
  margin-top: 1.2rem;
  min-height: 3.8rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.85);
  display: grid;
  gap: 0.6rem;
}

.status__message {
  min-height: 1.4rem;
}

.status__timeline[hidden] {
  display: none;
}

.status__timeline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.timeline__steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.timeline__step {
  position: relative;
  padding: 0.55rem 0.9rem 0.55rem 2rem;
  border-radius: 18px;
  background: rgba(99, 102, 241, 0.12);
  color: rgba(15, 23, 42, 0.8);
  font-size: 0.9rem;
  line-height: 1.3;
  transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease, color 220ms ease;
  overflow: hidden;
}

.timeline__step::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  width: 0.65rem;
  height: 0.65rem;
  transform: translateY(-50%) scale(0.9);
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.4);
  transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.timeline__step--active {
  background: rgba(99, 102, 241, 0.2);
  color: rgba(15, 23, 42, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 18px 28px rgba(99, 102, 241, 0.25);
}

.timeline__step--active::before {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.18);
}

.timeline__step--complete {
  opacity: 0.8;
}

input[type="password"],
input[type="file"],
select {
  font: inherit;
  width: 100%;
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  border: 2px solid transparent;
  background: rgba(248, 250, 252, 0.95);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input[type="password"]:focus,
input[type="file"]:focus,
select:focus,
button:focus {
  outline: none;
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.select {
  position: relative;
  display: block;
}

.select select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding-right: 3rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='12' viewBox='0 0 20 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 2.5L10 9.5L18 2.5' stroke='%236366f1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.1rem center;
}

.style-info {
  margin: 0;
  font-size: 0.98rem;
  color: rgba(15, 23, 42, 0.72);
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.button {
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: white;
  border: none;
  padding: 1rem 1.6rem;
  font-size: 1.05rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.button:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 32px rgba(99, 102, 241, 0.35);
}

.button:disabled {
  cursor: wait;
  filter: saturate(0.8);
  transform: none;
  box-shadow: none;
}

.button--secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--accent);
  border: 2px solid var(--accent);
}

.button--secondary:hover {
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.25);
}

.button--loading::after {
  content: "⏳";
  font-size: 1.1rem;
}

input[type="file"] {
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  border: none;
  padding: 0.7rem 1.4rem;
  margin-right: 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

input[type="file"]::file-selector-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.28);
}

input[type="file"]:disabled::file-selector-button {
  cursor: not-allowed;
  filter: saturate(0.8);
  transform: none;
  box-shadow: none;
}

.help {
  font-size: 0.92rem;
  color: rgba(15, 23, 42, 0.68);
  margin: 0;
}

.preview {
  display: grid;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 1.1rem;
  border: 2px dashed var(--accent-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.preview__label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.58);
}

.preview img {
  width: 190px;
  height: 190px;
  object-fit: cover;
  border-radius: 18px;
  justify-self: start;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.2);
}

.status--error {
  color: #dc2626;
}

.status--success {
  color: #16a34a;
}

.result {
  display: block;
  width: min(360px, 100%);
  border-radius: 28px;
  box-shadow: 0 24px 55px rgba(15, 23, 42, 0.25);
  margin-bottom: 1.7rem;
}

.gallery {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.gallery img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
}

@media (max-width: 720px) {
  body {
    padding: 2.2rem 1rem 3.8rem;
  }

  .card {
    padding: 2rem;
  }

  .preview img {
    width: 160px;
    height: 160px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: rgba(15, 23, 42, 0.7);
    --surface-muted: rgba(15, 23, 42, 0.75);
    --ink: #f8fafc;
    --accent-soft: rgba(165, 180, 252, 0.18);
    --accent-border: rgba(165, 180, 252, 0.45);
  }

  body {
    color: var(--ink);
    background: radial-gradient(circle at top, #1a1035 0%, #10172a 45%, #081424 85%);
  }

  .help,
  .style-info,
  .preview__label,
  .status {
    color: rgba(241, 245, 249, 0.8);
  }

  .preview {
    background: rgba(15, 23, 42, 0.55);
  }
}

body[data-theme="neon"] {
  --accent: #ff61d8;
  --accent-secondary: #ffa53a;
  --accent-soft: rgba(255, 97, 216, 0.18);
  --accent-border: rgba(255, 97, 216, 0.45);
}

body[data-theme="vacation"] {
  --accent: #10b981;
  --accent-secondary: #f97316;
  --accent-soft: rgba(16, 185, 129, 0.18);
  --accent-border: rgba(16, 185, 129, 0.45);
}

body[data-theme="vintage"] {
  --accent: #d97706;
  --accent-secondary: #b45309;
  --accent-soft: rgba(217, 119, 6, 0.18);
  --accent-border: rgba(217, 119, 6, 0.45);
}

body[data-theme="cyber"] {
  --accent: #0ea5e9;
  --accent-secondary: #a855f7;
  --accent-soft: rgba(14, 165, 233, 0.2);
  --accent-border: rgba(14, 165, 233, 0.45);
}

body[data-theme="professional"] {
  --accent: #6366f1;
  --accent-secondary: #22d3ee;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --accent-border: rgba(99, 102, 241, 0.35);
}

body[data-theme="cinematic"] {
  --accent: #f97316;
  --accent-secondary: #fb7185;
  --accent-soft: rgba(249, 115, 22, 0.16);
  --accent-border: rgba(249, 115, 22, 0.4);
}

body[data-theme="editorial"] {
  --accent: #1d4ed8;
  --accent-secondary: #facc15;
  --accent-soft: rgba(29, 78, 216, 0.16);
  --accent-border: rgba(29, 78, 216, 0.45);
}

body[data-theme="artdeco"] {
  --accent: #d946ef;
  --accent-secondary: #fde68a;
  --accent-soft: rgba(217, 70, 239, 0.16);
  --accent-border: rgba(217, 70, 239, 0.45);
}

body[data-theme="lifestyle"] {
  --accent: #0ea5e9;
  --accent-secondary: #22c55e;
  --accent-soft: rgba(14, 165, 233, 0.18);
  --accent-border: rgba(14, 165, 233, 0.45);
}

body[data-theme="fantasy"] {
  --accent: #a855f7;
  --accent-secondary: #f472b6;
  --accent-soft: rgba(168, 85, 247, 0.18);
  --accent-border: rgba(168, 85, 247, 0.45);
}
