:root {
  color-scheme: light;
  --background: #f5f6f7;
  --surface: #fafafa;
  --surface-muted: #f1f3f5;
  --border: #d4d7dc;
  --text: #202124;
  --muted: #666b73;
  --accent: #2864dc;
  --accent-hover: #1f54bd;
  --success: #168248;
  --danger: #bd2c38;
  --focus: #8eb4ff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

.verification-widget {
  width: min(100%, 420px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgb(0 0 0 / 10%);
}

.verification-row {
  display: flex;
  align-items: center;
  min-height: 94px;
  padding: 16px 18px;
}

.check-control {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  min-height: 54px;
  gap: 13px;
  padding: 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.check-control:not(:disabled) {
  cursor: pointer;
}

.check-control:not(:disabled):hover .check-box {
  border-color: var(--accent);
}

.check-control:focus-visible,
.retry-button:focus-visible,
.input-row button:focus-visible,
.input-row input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.check-box {
  position: relative;
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid #777d85;
  border-radius: 2px;
  background: #fff;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.check-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.check-copy strong {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
}

.check-copy small {
  max-width: 220px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.sample-brand {
  display: flex;
  flex: 0 0 82px;
  flex-direction: column;
  align-items: center;
  margin-left: 12px;
  color: #4d5259;
  text-align: center;
}

.sample-brand strong {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}

.sample-brand small {
  margin-top: 1px;
  color: #777c83;
  font-size: 8px;
  line-height: 1.2;
}

.sample-mark {
  position: relative;
  width: 29px;
  height: 29px;
  transform: rotate(45deg);
  border: 3px solid var(--accent);
  border-radius: 5px;
}

.sample-mark i {
  position: absolute;
  inset: 6px;
  border: 2px solid var(--accent);
  border-radius: 2px;
}

.verification-widget[data-state="loading"] .check-box {
  border: 3px solid #c5c9ce;
  border-top-color: var(--accent);
  border-radius: 50%;
  background: transparent;
  animation: spin .85s linear infinite;
}

.verification-widget[data-state="active"] .check-box,
.verification-widget[data-state="success"] .check-box {
  border-color: var(--success);
  background: var(--success);
}

.verification-widget[data-state="active"] .check-box::after,
.verification-widget[data-state="success"] .check-box::after {
  width: 7px;
  height: 13px;
  transform: translateY(-1px) rotate(45deg);
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  content: "";
}

.verification-widget[data-state="error"] .check-box {
  border-color: var(--danger);
}

.verification-widget[data-state="error"] .check-box::before,
.verification-widget[data-state="error"] .check-box::after {
  position: absolute;
  width: 2px;
  height: 15px;
  background: var(--danger);
  content: "";
}

.verification-widget[data-state="error"] .check-box::before {
  transform: rotate(45deg);
}

.verification-widget[data-state="error"] .check-box::after {
  transform: rotate(-45deg);
}

.challenge-panel {
  padding: 15px 18px 17px;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
}

.challenge-panel label {
  display: block;
  margin-bottom: 7px;
  color: #4f545b;
  font-size: 11px;
  font-weight: 600;
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  min-width: 0;
  flex: 1 1 auto;
  height: 41px;
  padding: 0 11px;
  border: 1px solid #b7bcc3;
  border-radius: 3px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.input-row input:disabled {
  background: #e9ebed;
  color: #777;
}

.input-row button,
.retry-button {
  min-height: 41px;
  padding: 0 15px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.input-row button:hover:not(:disabled),
.retry-button:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.input-row button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.session-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.result {
  margin: 12px 0 0;
  color: var(--success);
  font-size: 12px;
  line-height: 1.45;
}

.result.error {
  color: var(--danger);
}

.retry-button {
  width: 100%;
  margin-top: 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 430px) {
  body {
    padding: 12px;
  }

  .verification-row {
    padding: 14px;
  }

  .sample-brand {
    flex-basis: 70px;
    margin-left: 7px;
  }

  .challenge-panel {
    padding-right: 14px;
    padding-left: 14px;
  }

  .input-row {
    align-items: stretch;
    flex-direction: column;
  }

  .input-row button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .check-box {
    transition: none;
  }

  .verification-widget[data-state="loading"] .check-box {
    animation: none;
  }
}
