:root {
  color-scheme: dark;
  --bg: #06070d;
  --panel: #141522;
  --panel-strong: #1d1c2d;
  --line: #303044;
  --text: #f7f7fb;
  --muted: #a7a4b8;
  --faint: #747185;
  --red: #ff174f;
  --blue: #2f7cff;
  --green: #19e58b;
  --danger: #ff5a66;
  --radius: 28px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 23, 79, 0.08), transparent 270px),
    radial-gradient(circle at 70% 10%, rgba(47, 124, 255, 0.12), transparent 340px),
    var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 36px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 22px;
  align-items: center;
  padding: 28px 0;
}

.brand-panel,
.setup-panel {
  border: 1px solid var(--line);
  background: rgba(20, 21, 34, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.brand-panel {
  min-height: 720px;
  border-radius: 34px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.setup-panel {
  border-radius: var(--radius);
  padding: 30px;
}

.brand-lockup {
  display: flex;
  gap: 18px;
  align-items: center;
}

.brand-logo {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  object-fit: cover;
  background: #05050a;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1;
}

h1 span {
  color: var(--red);
}

.brand-lockup h1 {
  color: var(--blue);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.pairing-card {
  border-radius: 24px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  padding: 22px;
}

.pairing-card label,
.field span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-weight: 750;
}

.pairing-row {
  display: flex;
  gap: 12px;
}

.code-input,
.field input {
  width: 100%;
  min-height: 58px;
  color: var(--text);
  background: #0d0e17;
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: none;
  padding: 0 16px;
}

.code-input {
  text-transform: uppercase;
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.code-input:focus,
.field input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 23, 79, 0.16);
}

.status-chip {
  min-width: 104px;
  min-height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #0d0e17;
  border: 1px solid var(--line);
  font-weight: 800;
}

.status-chip.ready {
  color: var(--green);
  background: rgba(25, 229, 139, 0.1);
  border-color: rgba(25, 229, 139, 0.35);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.summary-grid div,
.result-card,
.file-drop,
.toggle {
  border: 1px solid var(--line);
  background: rgba(13, 14, 23, 0.72);
}

.summary-grid div {
  border-radius: 20px;
  padding: 16px 14px;
}

.summary-grid strong {
  display: block;
  font-size: 1.5rem;
}

.summary-grid span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.panel-heading,
.submit-row,
.options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ghost-button,
.secondary-button,
.primary-button {
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  padding: 0 20px;
  color: var(--text);
  font-weight: 850;
  cursor: pointer;
}

.ghost-button,
.secondary-button {
  background: #0d0e17;
  border: 1px solid var(--line);
}

.primary-button {
  min-width: 210px;
  background: linear-gradient(90deg, var(--red), #c41447);
  box-shadow: 0 16px 34px rgba(255, 23, 79, 0.22);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 28px 0 22px;
}

.tab {
  min-height: 58px;
  border-radius: 18px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #0d0e17;
  font-weight: 850;
  cursor: pointer;
}

.tab.active {
  color: var(--text);
  background: rgba(255, 23, 79, 0.16);
  border-color: rgba(255, 23, 79, 0.45);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field.wide,
.mode-fields,
.file-drop.wide {
  grid-column: 1 / -1;
}

.mode-fields {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mode-fields.active {
  display: grid;
}

.file-drop {
  min-height: 138px;
  border-radius: 22px;
  padding: 22px;
  display: grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
}

.file-drop input {
  display: none;
}

.file-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  margin-bottom: 10px;
  color: var(--red);
  background: rgba(255, 23, 79, 0.15);
  font-size: 1.8rem;
  font-weight: 700;
}

.file-drop small {
  color: var(--muted);
}

.options-row {
  justify-content: flex-start;
  margin: 18px 0 22px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--muted);
  font-weight: 800;
}

.toggle input {
  accent-color: var(--red);
}

.submit-row {
  justify-content: flex-start;
}

.result-card {
  margin-top: 22px;
  border-radius: 22px;
  padding: 20px;
}

.result-card.success {
  border-color: rgba(25, 229, 139, 0.36);
  background: rgba(25, 229, 139, 0.08);
}

.result-card.error {
  border-color: rgba(255, 90, 102, 0.42);
  background: rgba(255, 90, 102, 0.08);
}

.result-card h3 {
  margin-bottom: 8px;
}

.result-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.site-footer {
  width: min(1180px, calc(100% - 36px));
  margin: -14px auto 0;
  padding: 0 0 28px;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--muted);
  font-weight: 750;
  text-underline-offset: 4px;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--text);
}

@media (max-width: 920px) {
  .shell {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .brand-panel {
    min-height: auto;
    gap: 26px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding: 12px 0;
  }

  .brand-panel,
  .setup-panel {
    border-radius: 24px;
    padding: 18px;
  }

  .brand-logo {
    width: 66px;
    height: 66px;
    border-radius: 18px;
  }

  .pairing-row,
  .panel-heading,
  .submit-row,
  .options-row {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs,
  .form-grid,
  .mode-fields,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }
}
