:root {
  --bg: #12151c;
  --card: #1b1f29;
  --card-border: #262b38;
  --text: #e8e9ed;
  --text-muted: #9099a8;
  --input-bg: #12151c;
  --input-border: #2c3140;
  --accent: #e0392f;
  --accent-hover: #c72e25;
  --accent-contrast: #ffffff;
  --success: #3ba55d;
  --error: #e0392f;
  --focus: #4b5566;
  --shadow: rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
  --bg: #f4f5f7;
  --card: #ffffff;
  --card-border: #e6e8ec;
  --text: #1a1c22;
  --text-muted: #666e7d;
  --input-bg: #f8f9fb;
  --input-border: #dde1e8;
  --accent: #e0392f;
  --accent-hover: #c72e25;
  --accent-contrast: #ffffff;
  --success: #2f8a4d;
  --error: #d13a30;
  --focus: #b7bec9;
  --shadow: rgba(20, 22, 30, 0.08);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f4f5f7;
    --card: #ffffff;
    --card-border: #e6e8ec;
    --text: #1a1c22;
    --text-muted: #666e7d;
    --input-bg: #f8f9fb;
    --input-border: #dde1e8;
    --success: #2f8a4d;
    --error: #d13a30;
    --focus: #b7bec9;
    --shadow: rgba(20, 22, 30, 0.08);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.15s ease, color 0.15s ease;
}

/* ── Top bar ─────────────────────────────────────────── */
.topbar {
  border-bottom: 1px solid var(--card-border);
}

.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.brand-name {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  color: var(--text);
  font-size: 18px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.brand-sub {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-buttons { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { border-color: var(--focus); color: var(--text); }

#lang-toggle-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  font-size: 20px;
  line-height: 1;
}

/* ── Stage / card ────────────────────────────────────── */
.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 10px 40px var(--shadow);
  padding: 32px 28px;
}

.mascot-hello {
  position: absolute;
  top: -44px;
  right: 4px;
  width: 108px;
  height: 108px;
  filter: drop-shadow(0 8px 18px var(--shadow));
}

.step { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.step[hidden] { display: none; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.kicker::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.kicker.success { color: var(--success); }
.kicker.success::before { background: var(--success); }
.kicker.error { color: var(--error); }
.kicker.error::before { background: var(--error); }

.headline {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 28px;
  line-height: 1.15;
  color: var(--text);
}
.headline.small { font-size: 22px; }

.lede { color: var(--text-muted); font-size: 15px; line-height: 1.5; }
.lede.muted { font-size: 13px; margin-top: 4px; }

#form-code, #form-fields { width: 100%; display: flex; flex-direction: column; gap: 12px; }

.code-input {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 3px;
  text-align: center;
  text-transform: uppercase;
  padding: 14px 12px;
  border: 1.5px solid var(--input-border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
}
.code-input::placeholder { color: var(--text-muted); opacity: 0.6; }
.code-input:focus { outline: none; border-color: var(--focus); }
.code-input.invalid { border-color: var(--error); }

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -6px;
}

.field-group { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.field-label { font-size: 13px; font-weight: 600; letter-spacing: 0.2px; color: var(--text); }
.field-help { font-size: 12px; color: var(--text-muted); }

.field-input {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  padding: 12px 14px;
  border: 1.5px solid var(--input-border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
}
.field-input:focus { outline: none; border-color: var(--focus); }
.field-input.invalid { border-color: var(--error); }

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: 10px;
  padding: 14px 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.error-text {
  color: var(--error);
  font-size: 13px;
  font-weight: 500;
  min-height: 1em;
}

.bot-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.bot-link:hover { text-decoration: underline; }

.mascot {
  width: 140px; height: 140px;
  align-self: center;
  filter: drop-shadow(0 8px 20px var(--shadow));
}

#step-pending, #step-done, #step-rejected { align-items: center; text-align: center; }

@media (max-width: 480px) {
  .topbar-inner { padding: 14px 16px; }
  .card { padding: 26px 20px; border-radius: 14px; }
  .headline { font-size: 22px; }
  .brand-name { font-size: 15px; }
  .brand-sub { font-size: 10px; max-width: 44vw; }
  .mascot-hello { width: 84px; height: 84px; top: -30px; right: 0; }
  .mascot { width: 116px; height: 116px; }
}

@media (max-width: 360px) {
  .icon-buttons { gap: 6px; }
  .icon-btn { width: 36px; height: 36px; }
}
