:root {
  --bg-page: #0f172a;
  --card-bg: #1e293b;
  --card-border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --input-bg: #0f172a;
  --input-border: #475569;
  --input-focus: #38bdf8;
  --btn-primary: #0ea5e9;
  --btn-primary-hover: #38bdf8;
  --btn-disabled: #475569;
  --success: #00c853;
  --success-bg: rgba(0, 200, 83, 0.35);
  --danger: #d50000;
  --danger-bg: rgba(213, 0, 0, 0.35);
  --neutral: #475569;
  --neutral-bg: rgba(71, 85, 105, 0.3);
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Outfit",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-page);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

main {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

#form {
  width: 100%;
  position: relative;
}

.field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.textinput {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 16px;
}

input[type="text"] {
  font-size: 1.25rem;
  font-family: inherit;
  width: 100%;
  height: 52px;
  padding: 12px 44px 12px 16px;
  border: 2px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  display: block;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

input[type="text"]::placeholder {
  color: var(--text-muted);
}

input[type="text"]:hover {
  border-color: var(--text-muted);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

#bReset {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--input-border);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#bReset:hover {
  background: var(--text-muted);
}

#bReset:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--input-focus);
}

#bReset i {
  font-size: 0.875rem;
  color: var(--text);
}

.btn-wrap {
  text-align: center;
  margin: 24px 0;
}

input[type="submit"] {
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  min-width: 160px;
  height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--btn-primary);
  color: #fff;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
}

input[type="submit"]:hover:not([disabled]) {
  background: var(--btn-primary-hover);
}

input[type="submit"]:active:not([disabled]) {
  transform: scale(0.98);
}

input[type="submit"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.4);
}

input[type="submit"][disabled] {
  background: var(--btn-disabled);
  color: var(--text-muted);
  cursor: not-allowed;
  border: 2px solid var(--danger);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.success {
  background: var(--success);
}
.legend-dot.danger {
  background: var(--danger);
}

section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.ans {
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  padding: 14px 8px;
  border-radius: var(--radius-sm);
  background: var(--neutral-bg);
  color: var(--text);
  transition:
    background 0.2s,
    color 0.2s;
}

.ans.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.ans.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

@media (max-width: 480px) {
  body {
    padding: 16px;
  }
  main {
    padding: 24px;
  }
  h1 {
    font-size: 1.125rem;
  }
  .textinput {
    max-width: 100%;
  }
  input[type="text"] {
    font-size: 1.125rem;
    height: 48px;
  }
  input[type="submit"] {
    width: 100%;
    max-width: 200px;
    height: 44px;
  }
  .ans {
    font-size: 0.8125rem;
    padding: 12px 6px;
  }
  section {
    gap: 8px;
  }
}

@media (min-width: 481px) and (max-width: 600px) {
  main {
    max-width: 90%;
  }
}
