/* ── Variables ── */
:root {
  --primary:        #1a3a5c;
  --primary-light:  #2563a8;
  --success:        #16a34a;
  --success-bg:     #f0fdf4;
  --success-border: #86efac;
  --danger:         #dc2626;
  --danger-bg:      #fef2f2;
  --danger-border:  #fca5a5;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius:     10px;
  --shadow-sm:  0 1px 4px rgba(0, 0, 0, 0.07);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #e8edf4;
  min-height: 100vh;
  color: var(--gray-800);
}

/* ── Nav ── */
.nav {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 32px;
  height: 56px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
}

/* ── Layout ── */
.inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 88px 16px 32px;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
}

.page-header p {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 3px;
}

/* ── Card ── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.card-body {
  padding: 24px;
}

/* ── Form ── */
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.field-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

.field-hint code {
  background: var(--gray-100);
  padding: 1px 5px;
  border-radius: 4px;
}

.doc-input-wrap {
  display: flex;
  gap: 10px;
}

.doc-input {
  flex: 1;
  padding: 13px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  outline: none;
  transition: border-color 0.15s;
  color: var(--gray-900);
}

.doc-input:focus {
  border-color: var(--primary-light);
}

.doc-input::placeholder {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--gray-300);
}

.doc-input:disabled {
  background: #f9fafb;
  cursor: not-allowed;
}

.btn-register {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 22px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

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

/* ── Result cards ── */
.result {
  display: none;
  margin-top: 20px;
  border-radius: var(--radius);
  overflow: hidden;
}

.result.visible {
  display: block;
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.result-success {
  background: var(--success-bg);
  border: 1.5px solid var(--success-border);
}

.result-duplicate {
  background: var(--danger-bg);
  border: 1.5px solid var(--danger-border);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.result-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.result-success .result-icon  { background: #dcfce7; }
.result-duplicate .result-icon { background: #fee2e2; }

.result-title {
  font-size: 16px;
  font-weight: 700;
}

.result-success .result-title   { color: var(--success); }
.result-duplicate .result-title { color: var(--danger);  }

.result-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

.result-body {
  padding: 14px 20px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.result-row:last-child {
  border-bottom: none;
}

.result-row span:first-child { color: var(--gray-500); }
.result-row span:last-child  { font-weight: 600; color: var(--gray-800); }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }

.doc-cell {
  font-family: monospace;
  font-size: 14px;
  letter-spacing: 0.05em;
  font-weight: 700;
}

/* ── Btn new ── */
.btn-new {
  display: none;
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  background: var(--gray-100);
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}

.btn-new:hover {
  background: var(--gray-200);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--gray-900);
  color: #fff;
  padding: 12px 20px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  display: none;
  z-index: 300;
}

.toast.visible {
  display: block;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}
