:root {
  --navy: #13213c;
  --navy-2: #1e335d;
  --orange: #f58220;
  --line: #d8e0ec;
  --ink: #162033;
  --muted: #66748a;
  --bg: #eef3f8;
  --ok: #117044;
  --warn: #9d5a00;
  --bad: #b42318;
  --focus: #2d6cdf;
  font-family: Arial, "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  background: var(--navy);
  color: #fff;
  padding: 18px 20px;
  box-shadow: 0 8px 24px rgba(17, 28, 52, 0.18);
}

.app-header h1 {
  margin: 2px 0 6px;
  font-size: 23px;
  letter-spacing: 0;
}

.app-header p {
  margin: 0;
  color: #d5deef;
  font-size: 13px;
  line-height: 1.45;
}

.eyebrow {
  color: #ffb26d !important;
  font-weight: 800;
}

.status-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  padding: 7px 10px;
  color: #dbe5f6;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.status-chip.ok {
  background: #0f6b42;
  color: #fff;
}

.status-chip.bad {
  background: #9f241c;
  color: #fff;
}

main {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.step-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.step-progress button {
  min-height: 42px;
  margin: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: #526077;
  font-size: 13px;
}

.step-progress button.active {
  background: var(--navy);
  color: #fff;
}

.step-progress button:disabled {
  background: #dfe6ef;
  color: #8490a3;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 10px 28px rgba(20, 36, 70, 0.06);
}

.step-panel[hidden] {
  display: none;
}

.section-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.section-title > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
}

h2 {
  margin: 0;
  font-size: 18px;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

label {
  display: block;
  margin: 12px 0 6px;
  font-size: 13px;
  font-weight: 800;
  color: #30405f;
}

input[type="text"],
input[type="tel"],
input[type="password"] {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 16px;
  background: #fbfcff;
}

input:focus {
  outline: 2px solid rgba(45, 108, 223, .22);
  border-color: var(--focus);
}

input[type="file"] {
  width: 100%;
  padding: 14px;
  border: 1px dashed #aeb9cb;
  border-radius: 8px;
  background: #fbfcff;
  font-size: 15px;
}

button {
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

button.secondary {
  background: var(--navy-2);
}

button.small {
  width: 96px;
  min-height: 48px;
  margin-top: 0;
}

button:disabled {
  background: #c2cad6;
  cursor: not-allowed;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.inline-action {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.wizard-actions {
  margin-top: 12px;
}

.wizard-actions.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hint {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #eef4fc;
  color: #34425c;
  font-size: 14px;
  line-height: 1.45;
}

.status,
.quality-status {
  margin-top: 12px;
  padding: 13px;
  border-radius: 8px;
  background: #eef2f8;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.status strong,
.status span,
.quality-status strong,
.quality-status span {
  display: block;
}

.status strong,
.quality-status strong {
  color: var(--ink);
  margin-bottom: 4px;
}

.status.ok,
.quality-status.ok {
  background: #eaf6ef;
  color: var(--ok);
}

.status.warn,
.quality-status.warn {
  background: #fff5e5;
  color: var(--warn);
}

.status.bad,
.quality-status.bad {
  background: #fdecec;
  color: var(--bad);
}

.preview {
  width: 100%;
  max-height: 260px;
  margin-top: 10px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
}

.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 13, 28, 0.86);
}

.camera-modal[hidden] {
  display: none;
}

.camera-shell {
  width: min(820px, 100%);
  color: #fff;
}

.camera-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  background: #050912;
}

.camera-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.id-guide-box {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(86%, 640px);
  aspect-ratio: 1.586 / 1;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 255, 255, .86);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .32);
}

.id-guide-box::after {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px dashed rgba(255, 255, 255, .54);
}

.corner {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: #28d17c;
}

.corner.tl {
  left: -3px;
  top: -3px;
  border-left: 6px solid;
  border-top: 6px solid;
}

.corner.tr {
  right: -3px;
  top: -3px;
  border-right: 6px solid;
  border-top: 6px solid;
}

.corner.bl {
  left: -3px;
  bottom: -3px;
  border-left: 6px solid;
  border-bottom: 6px solid;
}

.corner.br {
  right: -3px;
  bottom: -3px;
  border-right: 6px solid;
  border-bottom: 6px solid;
}

.camera-score {
  position: absolute;
  right: 14px;
  top: 14px;
  min-width: 72px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(19, 33, 60, .88);
  color: #fff;
  text-align: center;
  font-weight: 900;
}

.camera-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.camera-guide-text {
  margin: 10px 0 0;
  color: #d9e4f5;
  font-size: 14px;
  line-height: 1.45;
}

.result-json {
  max-height: 260px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #101827;
  color: #d6e4ff;
  font-size: 12px;
  line-height: 1.45;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #f4f7fb;
  color: #30405f;
  font-weight: 900;
}

.admin-table tbody tr {
  cursor: pointer;
}

.admin-table tbody tr:hover {
  background: #eef4fc;
}

.admin-table td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.version {
  margin: 18px 0 8px;
  text-align: center;
  color: #7c8798;
  font-size: 12px;
}

@media (max-width: 640px) {
  .app-header {
    display: block;
  }

  .status-chip {
    display: inline-block;
    margin-top: 10px;
  }

  .grid,
  .grid.three,
  .step-progress,
  .wizard-actions.two {
    grid-template-columns: 1fr;
  }
}
