*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f0f2f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────── */
header {
  background: #fff;
  border-bottom: 3px solid #00ab50;
  padding: 18px 32px;
  display: flex;
  align-items: center;
}

header img {
  height: 44px;
  width: auto;
}

/* ── Main content area ───────────────────────────────────── */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
}

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
  padding: 40px 44px 36px;
  width: 100%;
  max-width: 640px;
}

.card h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 12px;
}

.card .instructions {
  font-size: 0.875rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 28px;
}

.card .instructions strong {
  color: #1a1a1a;
}

/* ── Form fields ─────────────────────────────────────────── */
.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #333;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.field input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 1rem;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.08em;
  border: 1px solid #ccc;
  border-radius: 5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: #1a1a1a;
}

.field input[type="text"]:focus {
  border-color: #00ab50;
  box-shadow: 0 0 0 3px rgba(0, 171, 80, 0.15);
}

.field .hint {
  font-size: 0.75rem;
  color: #888;
  margin-top: 4px;
}

/* ── Button ──────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #00ab50;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 11px 28px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 4px;
}

.btn-primary:hover { background: #009444; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  background: #a0d4b5;
  cursor: not-allowed;
  transform: none;
}

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn-primary.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result box ──────────────────────────────────────────── */
.result {
  margin-top: 28px;
  padding: 18px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  display: none;
}

.result.success {
  background: #f0faf4;
  border: 1px solid #00ab50;
  display: block;
}

.result.error {
  background: #fff5f5;
  border: 1px solid #e53e3e;
  display: block;
}

.result-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
  margin-bottom: 6px;
}

.key-code {
  font-family: "Courier New", Courier, monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: #00ab50;
  letter-spacing: 0.06em;
  word-break: break-all;
}

.key-note {
  font-size: 0.75rem;
  color: #666;
  margin-top: 8px;
}

.error-message {
  color: #c53030;
  font-weight: 500;
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 28px 0 24px;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 20px;
  font-size: 0.75rem;
  color: #999;
}
