/* Certificate Verification Portal — lightweight professional UI */

:root {
  --brand: #1f4e5f;
  --brand-dark: #163a47;
  --brand-light: #eaf1f2;
  --accent: #2f7d6b;
  --ink: #1b2226;
  --muted: #6b7684;
  --line: #e2e6ea;
  --bg: #f6f8f9;
  --surface: #ffffff;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --success: #1c7c3f;
  --success-bg: #eaf7ed;
  --warn: #92600a;
  --warn-bg: #fdf3e0;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.04), 0 4px 16px rgba(16, 24, 32, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 6px; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }

p { margin: 0 0 8px; color: var(--muted); }

/* ---------- Layout ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
}

.brand .mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.brand .sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  display: block;
}

.topbar-actions { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.container-narrow {
  max-width: 460px;
  margin: 0 auto;
  padding: 48px 20px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card + .card { margin-top: 16px; }

.card-header {
  border-bottom: 1px solid var(--line);
  margin: -24px -24px 20px;
  padding: 18px 24px;
}

.card-header h2 { margin: 0; }
.card-header p { margin: 4px 0 0; font-size: 13px; }

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid .full { grid-column: 1 / -1; }

@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
}

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  font-size: 14px;
  font-family: var(--font);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea { resize: vertical; min-height: 80px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 78, 95, 0.12);
}

input[readonly] { background: #f4f6f7; color: var(--muted); }

.radio-group { display: flex; gap: 20px; margin-top: 4px; }
.radio-option { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.radio-option input { width: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  font-family: var(--font);
}

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #256356; text-decoration: none; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1f19; text-decoration: none; }

.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: #f4f6f7; text-decoration: none; }

.btn-ghost { background: transparent; color: var(--brand); border-color: transparent; padding: 6px 8px; }
.btn-ghost:hover { background: var(--brand-light); text-decoration: none; }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.btn-row { display: flex; gap: 10px; margin-top: 22px; }

/* ---------- Badges / status ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-under_verification { background: var(--brand-light); color: var(--brand); }
.badge-verified { background: var(--success-bg); color: var(--success); }
.badge-rejected { background: var(--danger-bg); color: var(--danger); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 650;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }

.reg-link {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
}

/* ---------- Misc ---------- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}

.empty-state .icon { font-size: 34px; margin-bottom: 10px; }

.alert {
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #f3cfcb; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #c7e8d0; }
.alert-info { background: var(--brand-light); color: var(--brand-dark); border-color: #d3e3e6; }

.hidden { display: none !important; }

.section-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}

.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}

@media (max-width: 620px) {
  .kv-grid { grid-template-columns: 1fr; }
}

.kv-item .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 650;
  margin-bottom: 3px;
}

.kv-item .v { font-size: 14.5px; color: var(--ink); font-weight: 500; }
.kv-item .v.muted { color: var(--muted); font-weight: 400; }

.tag-section {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--brand);
  background: var(--brand-light);
  padding: 6px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 30px;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.nav-tabs button {
  background: none;
  border: none;
  padding: 10px 4px;
  margin-right: 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: var(--font);
}

.nav-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

.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: inline-block;
}

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

.file-note { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.stat-row { display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }

.stat-card {
  flex: 1;
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.stat-card .num { font-size: 22px; font-weight: 700; color: var(--ink); }
.stat-card .label { font-size: 12px; color: var(--muted); margin-top: 2px; }
