:root {
  color-scheme: light dark;
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --bg: #f7f7fa;
  --card-bg: rgba(255, 255, 255, 0.7);
  --text: #1f2933;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: rgba(15, 23, 42, 0.1);
  --success: #059669;
  --error: #dc2626;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

.container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.wizard-card {
  width: min(960px, 100%);
  background: var(--card-bg);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: 0 28px 64px -36px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.wizard-card.submissions-closed-card {
  min-height: 420px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.submissions-closed-message {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 600;
  color: var(--muted);
}

.wizard-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.language-switcher {
  display: inline-flex;
  gap: 0.4rem;
  background: rgba(37, 99, 235, 0.08);
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}
 
.rules-link {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}

.rules-link:hover,
.rules-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -18px var(--shadow);
  opacity: 0.95;
}

.lang-btn {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-btn:hover,
.lang-btn:focus {
  transform: translateY(-1px);
  background: rgba(37, 99, 235, 0.12);
  box-shadow: 0 12px 24px -20px var(--accent);
}

.lang-btn.active {
  background: rgba(37, 99, 235, 0.2);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.4);
}

.wizard-header h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.subtitle {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.stepper {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

.stepper-item {
  text-align: center;
  padding: 0.85rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s ease, color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
}

.stepper-item.is-active {
  background: var(--accent);
  color: #fff;
}

.stepper-item.is-complete {
  background: rgba(37, 99, 235, 0.2);
  color: var(--accent);
}

.stepper-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  font-weight: 700;
  font-size: 0.95rem;
}

.stepper-item.is-active .stepper-number {
  background: rgba(255, 255, 255, 0.2);
}

.stepper-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

@media (max-width: 700px) {
  .stepper {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .stepper-item {
    padding: 0.5rem;
    font-size: 0.95rem;
    flex-direction: column;
    gap: 0.35rem;
  }
}

@media (max-width: 520px) {
  .stepper {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .stepper-item {
    padding: 0.55rem 0.25rem;
    min-height: 40px;
  }

  .stepper-label {
    display: none;
  }

  .stepper-number {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }
}

.wizard-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.step-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

[hidden] {
  display: none !important;
}

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

.field-grid.single-column {
  grid-template-columns: minmax(260px, 1fr);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.field span {
  font-weight: 600;
  font-size: 0.95rem;
}

.field input {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.field.wide {
  grid-column: 1 / -1;
}

.file-label {
  border: 2px dashed var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.file-label:hover,
.file-label:focus-within {
  border-color: var(--accent);
  color: var(--accent);
}

.file-label input {
  display: none;
}

.existing-photos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.5rem;
}

.existing-photos-header[hidden] {
  display: none;
}

.photo-card {
  position: relative;
  width: 160px;
  height: 160px;
  padding: 0.45rem;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.65), rgba(148, 163, 184, 0.2));
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  box-shadow: 0 12px 24px -18px rgba(15, 23, 42, 0.35);
  pointer-events: none;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  display: block;
}

.photo-card.is-removed img {
  filter: grayscale(0.8);
  opacity: 0.65;
}

.photo-name {
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.85rem;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.remove-photo-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.05);
}

.photo-card:not(.is-removed) .remove-photo-btn {
  color: var(--error);
  border-color: var(--error);
  background: rgba(255, 255, 255, 0.5);
}

.photo-card.is-removed .remove-photo-btn {
  color: var(--success);
  border-color: var(--success);
  background: rgba(255, 255, 255, 0.5);
}

.remove-photo-btn:hover,
.remove-photo-btn:focus-visible {
  box-shadow: 0 8px 18px -12px rgba(15, 23, 42, 0.35);
}

.preview-item.with-remove {
  position: relative;
}

.preview-item.with-remove .remove-photo-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  color: var(--error);
  border: 1px solid var(--error);
  background: rgba(255, 255, 255, 0.5);
}

.empty-note {
  margin: 0.5rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.help-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.primary-btn,
.secondary-btn {
  border: none;
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}

.primary-btn {
  background: var(--accent);
  color: #ffffff;
}

.secondary-btn {
  background: rgba(148, 163, 184, 0.18);
  color: var(--text);
}

.primary-btn:hover,
.primary-btn:focus,
.secondary-btn:hover,
.secondary-btn:focus {
  transform: translateY(-1px);
}

.primary-btn:hover,
.primary-btn:focus {
  box-shadow: 0 16px 36px -22px var(--accent);
}

.secondary-btn:hover,
.secondary-btn:focus {
  box-shadow: 0 16px 32px -26px rgba(148, 163, 184, 0.8);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.actions {
  display: flex;
  gap: 0.85rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.status {
  min-height: 1.25rem;
  font-size: 0.95rem;
}

.status[data-variant='error'] {
  color: var(--error);
}

.status[data-variant='success'] {
  color: var(--success);
}

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

.preview-item {
  position: relative;
  border-radius: 24px;
  padding: 0.45rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.65), rgba(148, 163, 184, 0.2));
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 160px;
}

.preview-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  box-shadow: 0 12px 24px -18px rgba(15, 23, 42, 0.35);
  pointer-events: none;
}

.preview-item img {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: contain;
  display: block;
  background: #111827;
}

.summary {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.summary h2 {
  margin: 0;
  font-size: 1.5rem;
}

.summary h3 {
  margin: 0;
  font-size: 1.15rem;
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem 1.75rem;
  margin: 0;
}

.summary-list dt {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-list dd {
  margin: 0.15rem 0 0;
  font-size: 1rem;
}

.thank-you {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.thank-you h2 {
  margin: 0;
  font-size: 1.75rem;
}

.thank-you-text {
  margin: 0;
}

.thank-you strong {
  color: var(--accent);
}

.thank-you .primary-btn {
  align-self: center;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --card-bg: rgba(17, 28, 61, 0.85);
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.32);
    --shadow: rgba(15, 23, 42, 0.55);
    --accent-soft: rgba(37, 99, 235, 0.25);
  }

  .secondary-btn {
    background: rgba(148, 163, 184, 0.25);
    color: var(--text);
  }

  .file-label {
    border-color: rgba(148, 163, 184, 0.35);
  }

  .language-switcher {
    background: rgba(37, 99, 235, 0.18);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
  }

  .lang-btn:hover,
  .lang-btn:focus {
    box-shadow: 0 12px 24px -20px rgba(37, 99, 235, 0.55);
  }
}

@media (max-width: 600px) {
  .wizard-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .language-switcher {
    order: -1;
  }
}
