:root {
  --text: #111;
  --text-secondary: #555;
  --bg: #fafafa;
  --surface: #fff;
  --border: #e0e0e0;
  --primary: #111;
  --primary-fg: #fff;
  --error: #d32f2f;
  --radius: 8px;
}

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

body {
  font-family:
    "Noto Sans Thai",
    system-ui,
    -apple-system,
    sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 4rem 1rem 2rem;
}

main {
  width: 100%;
  max-width: 380px;
}

/* Header */
header {
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}

/* Form */
.search-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-form label {
  font-size: 0.813rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.search-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
}

.search-form input:focus-visible {
  outline: none;
  border-color: var(--primary);
}

.search-form input::placeholder {
  color: #aaa;
}

.search-form button {
  padding: 0.75rem;
  background: var(--primary);
  color: var(--primary-fg);
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.938rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.search-form button:hover:not(:disabled) {
  opacity: 0.8;
}

.search-form button:active:not(:disabled) {
  opacity: 0.7;
}

.search-form button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.search-form button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Error */
.error-msg {
  color: var(--error);
  font-size: 0.813rem;
  font-weight: 500;
}

/* Result */
.result-area {
  margin-top: 1.5rem;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-card hr {
  border: none;
  border-top: 1px solid var(--border);
}

.field-label {
  font-size: 0.688rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.125rem;
}

.field-value {
  font-size: 1.063rem;
  font-weight: 600;
}

.field-value--id {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* Copy button */
.copy-btn {
  align-self: flex-start;
  padding: 0.375rem 0.875rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.813rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.copy-btn:hover {
  background: var(--border);
}

.copy-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Not found */
.not-found-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
  }
}
