*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #eef6f4;
  --ink: #20242c;
  --muted: #667085;
  --line: #d9e2e7;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #e85d44;
  --success: #13795b;
  --danger: #c24135;
  --shadow: 0 24px 70px rgba(32, 36, 44, 0.16);
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --focus-ring: 0 0 0 4px rgba(15, 118, 110, 0.22);
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(232, 93, 68, 0.14), transparent 38%),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 440px);
  align-items: center;
  gap: 48px;
  padding: 48px 0;
}

.hero-panel {
  max-width: 620px;
}

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

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 56ch;
  margin: 24px 0 0;
  color: #414754;
  font-size: 1.08rem;
}

.validator-card {
  width: 100%;
  padding: 28px;
  border: 1px solid rgba(217, 226, 231, 0.88);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.card-header,
.results-heading,
.button-row {
  display: flex;
  align-items: center;
}

.card-header {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.card-header h2,
.results-heading h3 {
  margin: 0;
  line-height: 1.1;
}

.card-header h2 {
  font-size: 1.75rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 52px;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 800;
  background: var(--ink);
}

.validator-form {
  display: grid;
  gap: 18px;
}

.field-group {
  display: grid;
  gap: 8px;
}

label {
  font-weight: 700;
}

#user-input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #ffffff;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(32, 36, 44, 0.04);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

#user-input:hover {
  border-color: #a9bdc6;
}

#user-input:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

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

.button-row {
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.28);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  color: var(--ink);
  background: var(--surface-soft);
}

.btn-secondary:hover {
  background: #dcefed;
}

.results-panel {
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfcfd;
}

.results-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.results-heading h3 {
  font-size: 1rem;
}

#result-count {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

#results-div {
  min-height: 168px;
  max-height: 280px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #b4c5cc transparent;
}

#results-div::-webkit-scrollbar {
  width: 10px;
}

#results-div::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
  background-color: #b4c5cc;
}

#results-div:empty::before {
  content: "No numbers checked yet.";
  min-height: 168px;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.results-text {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid currentColor;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--muted);
  font-weight: 700;
}

.results-text.is-valid {
  color: var(--success);
  background: #f0faf6;
}

.results-text.is-invalid {
  color: var(--danger);
  background: #fff4f2;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 28px;
    padding: 32px 0;
  }

  .hero-panel {
    max-width: none;
  }

  h1 {
    max-width: 11ch;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 20px 0;
  }

  h1 {
    font-size: 2.65rem;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .validator-card {
    padding: 20px;
    border-radius: var(--radius-lg);
  }

  .card-header {
    align-items: flex-start;
  }

  .status-pill {
    min-width: 44px;
    min-height: 44px;
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
