﻿* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #667085;
  --border: #dfe5ee;
  --line: #edf1f6;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --cyan: #13cdb4;
  --green: #16a34a;
  --shadow: 0 22px 58px rgba(17, 24, 39, 0.12);
}

html {
  min-height: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

/* ADMIN */

.admin-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.admin-card {
  width: 420px;
  max-width: 100%;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.admin-logo,
.brand-logo {
  width: 56px;
  height: 56px;
  display: block;
  flex: 0 0 auto;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.10);
}

.admin-card h1 {
  margin: 22px 0;
  font-size: 28px;
  line-height: 1.16;
}

.admin-card input {
  width: 100%;
  min-height: 50px;
  margin-bottom: 12px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  background: #f8fafc;
  color: var(--text);
  font-size: 15px;
}

.admin-card input:focus {
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.admin-card button,
.primary-btn {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  background: var(--blue);
  color: #ffffff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.admin-card button {
  margin-top: 6px;
}

.admin-card button:hover,
.primary-btn:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(37, 99, 235, 0.25);
}

.created-for {
  color: var(--muted);
}

.created-link {
  display: block;
  margin-top: 18px;
  color: var(--blue);
  font-weight: 800;
  line-height: 1.35;
  word-break: break-all;
}

.back-link {
  display: inline-block;
  margin-top: 22px;
  color: var(--muted);
  font-weight: 700;
}

.admin-dashboard-body {
  align-items: flex-start;
  justify-content: center;
}

.admin-shell {
  width: min(1120px, 100%);
}

.admin-topbar {
  position: sticky;
  top: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(14px);
}

.admin-menu {
  display: inline-flex;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
}

.admin-menu a {
  padding: 10px 13px;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.admin-menu a:hover {
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
}

.admin-alert,
.admin-panel {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.admin-alert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px 20px;
}

.admin-alert b,
.admin-alert span {
  display: block;
}

.admin-alert span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.admin-alert a {
  color: var(--blue);
  font-weight: 900;
  line-height: 1.35;
  text-align: right;
  word-break: break-all;
}

.admin-panel {
  padding: 24px;
}

.admin-panel + .admin-panel {
  margin-top: 18px;
}

.admin-section-title {
  margin-bottom: 18px;
}

.admin-section-title span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-section-title h1,
.admin-section-title h2 {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1.15;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) auto;
  gap: 12px;
}

.admin-form-grid input {
  width: 100%;
  min-height: 52px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  background: #f8fafc;
  color: var(--text);
}

.admin-form-grid input:focus {
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.admin-form-grid button {
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: var(--blue);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.history-empty {
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.history-table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) 120px minmax(190px, 1.35fr) minmax(150px, 0.9fr) minmax(180px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 15px 16px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.history-row:first-child {
  border-top: 0;
}

.history-head {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.history-person b,
.history-person small,
.history-date small {
  display: block;
}

.history-person small,
.history-date small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-pill {
  width: fit-content;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.status-pill.pending {
  background: #eff6ff;
  color: #1d4ed8;
}

.status-pill.done {
  background: #ecfdf3;
  color: #047857;
}

.history-message {
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
}

.history-date {
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
}

.history-link {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-all;
}

.login-card {
  margin-top: 0;
}

.login-error {
  margin: -10px 0 16px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 800;
}

/* VERIFY LAYOUT */

.verify-body {
  min-height: 100vh;
  background: var(--bg);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  padding: 14px 20px;
  background: rgba(245, 247, 251, 0.74);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(223, 229, 238, 0.74);
}

.header-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.header-badge {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
}

.main-area {
  min-height: calc(100vh - 77px);
  display: grid;
  place-items: center;
  padding: 34px 18px 56px;
}

/* WELCOME */

.welcome-card,
.verify-card,
.success-card {
  width: min(100%, 520px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.welcome-card {
  padding: 38px;
  text-align: center;
  animation: welcomePop 0.55s ease forwards;
}

@keyframes welcomePop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.welcome-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

.brand-logo.big {
  width: 92px;
  height: 92px;
  border-radius: 24px;
}

.welcome-kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.welcome-card h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.welcome-text {
  margin: 18px auto 0;
  max-width: 390px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.info-box {
  margin-top: 24px;
  padding: 17px 18px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: #f1f7ff;
  color: #1e3a8a;
  font-weight: 800;
  line-height: 1.45;
}

.primary-btn {
  margin-top: 26px;
  padding: 0 20px;
}

.fade-out {
  animation: fadeOut 0.35s ease forwards;
}

.fade-in {
  animation: fadeIn 0.45s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hidden {
  display: none !important;
}

/* VERIFY CARD */

.verify-card {
  padding: 22px;
  text-align: center;
}

.verify-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  text-align: left;
}

.verify-top h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.2;
}

.verify-top p {
  margin: 5px 0 0;
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.live-dot {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #047857;
  font-size: 13px;
  font-weight: 900;
}

.live-dot span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: blink 1s infinite;
}

@keyframes blink {
  50% {
    opacity: 0.35;
  }
}

.camera-box {
  position: relative;
  width: 100%;
  height: min(58vh, 520px);
  min-height: 390px;
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 22px;
  background: #e9eef5;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.face-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(17, 24, 39, 0.09) 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
}

.face-frame {
  position: absolute;
  left: 50%;
  top: 49%;
  width: min(58vw, 245px);
  max-width: 245px;
  height: min(78vw, 330px);
  max-height: 330px;
  transform: translate(-50%, -50%);
  overflow: hidden;
  border: 3px solid rgba(37, 99, 235, 0.92);
  border-radius: 48% 48% 43% 43%;
  box-shadow:
    0 0 0 999px rgba(255, 255, 255, 0.12),
    0 0 28px rgba(37, 99, 235, 0.24),
    inset 0 0 24px rgba(37, 99, 235, 0.12);
  z-index: 3;
}

.scan-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, transparent, #2563eb, #13cdb4, transparent);
  box-shadow: 0 0 18px rgba(37, 99, 235, 0.8);
  animation: scan 2.2s infinite ease-in-out;
}

@keyframes scan {
  0% {
    top: 0%;
    opacity: 0.3;
  }
  50% {
    top: 98%;
    opacity: 1;
  }
  100% {
    top: 0%;
    opacity: 0.3;
  }
}

.corner {
  position: absolute;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-color: var(--blue);
}

.c1 {
  top: 14px;
  left: 14px;
  border-top: 4px solid;
  border-left: 4px solid;
}

.c2 {
  top: 14px;
  right: 14px;
  border-top: 4px solid;
  border-right: 4px solid;
}

.c3 {
  bottom: 14px;
  left: 14px;
  border-bottom: 4px solid;
  border-left: 4px solid;
}

.c4 {
  right: 14px;
  bottom: 14px;
  border-right: 4px solid;
  border-bottom: 4px solid;
}

.face-points span {
  position: absolute;
  z-index: 4;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #13cdb4;
  box-shadow: 0 0 12px rgba(19, 205, 180, 0.9);
  animation: pointPulse 1.25s infinite alternate;
}

@keyframes pointPulse {
  from {
    opacity: 0.35;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1.25);
  }
}

#instruction {
  min-height: 28px;
  margin: 19px 0 12px;
  font-size: 20px;
  line-height: 1.3;
}

.progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf1;
}

#bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: 0.25s;
}

#percent {
  margin: 12px 0 0;
  color: var(--blue);
  font-weight: 900;
}

.small-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* SUCCESS */

.success-card {
  padding: 38px;
  text-align: center;
  animation: welcomePop 0.5s ease forwards;
}

.success-logo-wrap {
  width: 96px;
  height: 96px;
  margin: 0 auto 22px;
}

.success-logo {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.12);
}

.success-card h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
}

.success-subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.upload-box {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f8fafc;
  text-align: left;
}

.upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-weight: 900;
}

.upload-header b {
  color: var(--blue);
}

.upload-progress {
  width: 100%;
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf1;
}

#uploadBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: 0.2s;
}

.upload-text {
  min-height: 30px;
  margin: 18px 0 0;
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
}

.status-change {
  animation: statusChange 0.22s ease;
}

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

/* RETRY */

.retry-card {
  width: min(100%, 500px);
  padding: 38px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
  animation: welcomePop 0.5s ease forwards;
}

.retry-icon {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: #fef2f2;
  color: #dc2626;
  font-size: 42px;
  font-weight: 900;
}

.retry-card h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.18;
}

.retry-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.retry-card .primary-btn {
  margin-top: 26px;
}

/* FINAL */

.final-card {
  width: min(100%, 520px);
  padding: 48px 38px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
  animation: welcomePop 0.5s ease forwards;
}

.final-check-wrap {
  width: 104px;
  height: 104px;
  margin: 0 auto 28px;
}

.final-check-svg {
  width: 104px;
  height: 104px;
}

.final-check-circle {
  fill: none;
  stroke: var(--green);
  stroke-width: 4;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: drawFinalCircle 0.85s ease forwards;
}

.final-check-mark {
  fill: none;
  stroke: var(--green);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: drawFinalCheck 0.5s ease forwards;
  animation-delay: 0.62s;
}

.final-card h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.18;
}

.final-subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

@keyframes drawFinalCircle {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes drawFinalCheck {
  to {
    stroke-dashoffset: 0;
  }
}

/* MOBILE */

@media (max-width: 640px) {
  .admin-body {
    align-items: flex-start;
    padding: 18px;
  }

  .admin-topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .admin-menu {
    width: 100%;
  }

  .admin-menu a {
    flex: 1;
    text-align: center;
  }

  .admin-alert {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .admin-alert a {
    text-align: left;
  }

  .admin-panel {
    padding: 18px;
    border-radius: 18px;
  }

  .admin-section-title h1,
  .admin-section-title h2 {
    font-size: 24px;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-form-grid button {
    width: 100%;
  }

  .history-table {
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  .history-head {
    display: none;
  }

  .history-row {
    display: block;
    margin-top: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
  }

  .history-row:first-child {
    margin-top: 0;
  }

  .history-row > * + * {
    display: block;
    margin-top: 12px;
  }

  .admin-card {
    margin-top: 26px;
    padding: 24px;
    border-radius: 18px;
  }

  .admin-card h1 {
    font-size: 25px;
  }

  .site-header {
    padding: 10px 12px;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .brand-title {
    font-size: 15px;
  }

  .brand-subtitle {
    font-size: 11px;
  }

  .header-badge {
    display: none;
  }

  .main-area {
    min-height: calc(100vh - 63px);
    align-items: start;
    padding: 18px 12px 32px;
  }

  .welcome-card,
  .verify-card,
  .success-card,
  .final-card,
  .retry-card {
    border-radius: 18px;
  }

  .welcome-card,
  .success-card,
  .final-card,
  .retry-card {
    padding: 24px;
  }

  .verify-card {
    padding: 14px;
  }

  .brand-logo.big {
    width: 78px;
    height: 78px;
    border-radius: 22px;
  }

  .welcome-card h1,
  .success-card h1,
  .final-card h1,
  .retry-card h1 {
    font-size: 28px;
  }

  .welcome-text,
  .success-subtitle,
  .final-subtitle,
  .retry-card p {
    font-size: 16px;
  }

  .info-box {
    padding: 15px;
    font-size: 14px;
  }

  .verify-top {
    margin: 3px 2px 14px;
  }

  .verify-top h1 {
    font-size: 20px;
  }

  .verify-top p {
    font-size: 14px;
  }

  .live-dot {
    padding: 7px 9px;
    font-size: 12px;
  }

  .camera-box {
    height: min(62vh, 470px);
    min-height: 360px;
    border-radius: 18px;
  }

  #instruction {
    margin-top: 16px;
    font-size: 18px;
  }

  .upload-box {
    padding: 16px;
    border-radius: 16px;
  }

  .final-check-wrap,
  .final-check-svg {
    width: 88px;
    height: 88px;
  }
}

@media (max-width: 380px) {
  .site-header {
    padding: 8px 10px;
  }

  .main-area {
    padding-inline: 10px;
  }

  .welcome-card,
  .success-card,
  .final-card,
  .retry-card {
    padding: 20px;
  }

  .welcome-card h1,
  .success-card h1,
  .final-card h1,
  .retry-card h1 {
    font-size: 25px;
  }

  .primary-btn,
  .admin-card button {
    min-height: 50px;
  }

  .camera-box {
    min-height: 330px;
  }
}
