:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #d6dce5;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --blue: #0000FF;
  --blue-dark: #1743a8;
  --green: #137c55;
  --red: #d92714;
  --soft-blue: #edf3ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(36, 88, 211, 0.08), transparent 260px),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

.app {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 28px 16px 40px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(25, 38, 72, 0.09);
  overflow: hidden;
}

.header {
  padding: 28px 24px 22px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 1.8rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.form {
  display: grid;
  gap: 22px;
  padding: 24px;
}

.intro {
  padding: 16px;
  border: 1px solid #d9e2f2;
  border-radius: 8px;
  background: #f7faff;
  color: #344054;
  line-height: 1.55;
}

.intro-emphasis {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 750;
}

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

.field > span {
  font-weight: 800;
}

select,
input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #b9c3d3;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
button:focus-visible,
.choice input:focus-visible + span,
.slot input:focus-visible + span {
  outline: 3px solid rgba(36, 88, 211, 0.24);
  outline-offset: 2px;
}

.segmented,
.choices,
.slot-grid {
  display: grid;
  gap: 10px;
}

.segmented {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choices {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slot-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice,
.slot {
  position: relative;
  display: block;
}

.choice input,
.slot input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span,
.slot span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #b9c3d3;
  border-radius: 8px;
  background: #fff;
  text-align: center;
  font-weight: 750;
  line-height: 1.22;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.choice input:checked + span,
.slot input:checked + span {
  border-color: var(--blue);
  background: var(--soft-blue);
  color: var(--blue-dark);
}

.choice input:disabled + span,
.slot input:disabled + span {
  border-color: #e2e6ee;
  background: #f1f3f7;
  color: #98a2b3;
}

.slot input:disabled + span {
  opacity: 0.68;
}

.slot.taken span {
  background: #f7f8fb;
}

.slot-note {
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 850;
}

.existing {
  padding: 14px 16px;
  border: 1px solid #a8d5c1;
  border-radius: 8px;
  background: #effaf5;
  color: #0d5f42;
  font-weight: 750;
  line-height: 1.45;
}

small {
  color: var(--muted);
  line-height: 1.45;
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

button {
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

button:hover {
  background: var(--blue-dark);
}

button.secondary {
  border: 1px solid #d3d8e2;
  background: #fff;
  color: #344054;
}

button.secondary:hover {
  background: #f5f7fb;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.message {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

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

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

.hidden {
  display: none;
}

@media (max-width: 640px) {
  .app {
    padding: 12px;
  }

  .header,
  .form {
    padding-left: 16px;
    padding-right: 16px;
  }

  .segmented,
  .choices,
  .slot-grid,
  .actions {
    grid-template-columns: 1fr;
  }
}
