/* OTP Code Generator Web — 데스크톱 도구(mockup/otp-generator)의 다크 팔레트를 그대로 승계 (DI-C10). */
:root {
  --bg: #0F1419;
  --surface: #171E26;
  --surface2: #1E2833;
  --text: #E6EBF0;
  --muted: #8A97A3;
  --line: #26303A;
  --admin: #E8B84B;
  --admin-soft: rgba(232, 184, 75, 0.12);
  --service: #4BC3D9;
  --service-soft: rgba(75, 195, 217, 0.12);
  --danger: #F08C7A;
  --danger-soft: rgba(240, 140, 122, 0.12);
  --ok: #7ED9A5;
  --accent: var(--admin);
  --accent-soft: var(--admin-soft);
  --font: "Segoe UI", "Apple SD Gothic Neo", Roboto, system-ui, sans-serif;
  /* 0/O·1/l 구별이 분명한 고정폭 (DI-C06) */
  --mono: Consolas, "Cascadia Mono", "SF Mono", Menlo, "DejaVu Sans Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--service); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--service); outline-offset: 2px; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--surface2); padding: 1px 6px; border-radius: 4px; }

/* ── 상단 바 ─────────────────────────────────────────── */
.top { border-bottom: 1px solid var(--line); background: var(--bg); }
.top__inner { max-width: 640px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__eyebrow { font-size: 10px; letter-spacing: 0.12em; color: var(--muted); font-weight: 600; }
.brand__name { font-size: 16px; font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.who__name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who__kind { color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.who__link { color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 12px; }
.inline { display: inline; margin: 0; }

.page { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 20px 40px; }
.foot { max-width: 640px; margin: 0 auto; padding: 16px 20px 28px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; width: 100%; }

/* ── 타이포 ──────────────────────────────────────────── */
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; margin: 0 0 4px; }
.h1 { font-size: 22px; font-weight: 600; margin: 0 0 10px; line-height: 1.3; }
.h2 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }

/* ── 카드 ────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-bottom: 16px; }
.card--narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.card--accent { border-top: 3px solid var(--accent); }
.card--admin { --accent: var(--admin); --accent-soft: var(--admin-soft); }
.card--service { --accent: var(--service); --accent-soft: var(--service-soft); }

/* ── 버튼·폼 ─────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn--primary { background: var(--accent); color: #0F1419; border-color: transparent; }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { background: transparent; }
.btn--sm { min-height: 32px; padding: 4px 10px; font-size: 12px; font-weight: 500; }
.btn--danger { color: var(--danger); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: default; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; }
.field .hint { color: var(--muted); font-size: 12px; }
input[type="email"], input[type="text"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
.code-input { font-family: var(--mono); font-size: 26px; letter-spacing: 0.3em; text-align: center; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; }
.checks label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }

.notice { border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: 13px; border: 1px solid var(--line); background: var(--surface2); }
.notice--ok { border-color: rgba(126, 217, 165, 0.4); color: var(--ok); }
.notice--warn { border-color: rgba(232, 184, 75, 0.4); color: var(--admin); }
.notice--danger { border-color: rgba(240, 140, 122, 0.4); color: var(--danger); }

/* ── 홈: 로그인 선택 ─────────────────────────────────── */
.choice { display: grid; gap: 10px; margin-top: 18px; }
.choice__item { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface2); color: var(--text); min-height: 44px; }
.choice__item:hover { border-color: var(--service); text-decoration: none; }
.choice__title { font-weight: 600; }
.choice__desc { color: var(--muted); font-size: 13px; }

/* ── 코드 화면 (DI-C01~C06) ─────────────────────────── */
.groups { display: flex; gap: 6px; padding: 6px; background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; }
.groups__btn { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; min-height: 56px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; text-align: left; text-decoration: none; }
.groups__btn small { font-weight: 400; font-size: 11px; }
.groups__btn:hover { text-decoration: none; color: var(--text); }
.groups__btn[aria-current="true"] { background: var(--surface); color: var(--text); border-color: var(--accent); }

.chip { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; padding: 3px 10px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); text-transform: uppercase; }
.chip--admin { color: var(--admin); background: var(--admin-soft); }
.chip--service { color: var(--service); background: var(--service-soft); }
.chip--muted { color: var(--muted); background: var(--surface2); }
.chip--danger { color: var(--danger); background: var(--danger-soft); }
.chip--ok { color: var(--ok); background: rgba(126, 217, 165, 0.12); }

.codehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.coderow { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.code { font-family: var(--mono); font-weight: 600; letter-spacing: 0.16em; font-variant-numeric: tabular-nums; user-select: all; -webkit-user-select: all; word-break: break-all; }
.code--now { font-size: 34px; line-height: 1.2; }
.code--adj { font-size: 17px; }
.validity { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--muted); }
.validity strong { color: var(--text); font-variant-numeric: tabular-nums; }
.meter { height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; margin-top: 12px; }
.meter__bar { height: 100%; width: 100%; background: var(--accent); border-radius: 2px; transition: width 1s linear; }
.adj { display: grid; gap: 10px; }
.adj__row { display: flex; align-items: center; gap: 14px; justify-content: space-between; flex-wrap: wrap; padding: 6px 0; }
.adj__row + .adj__row { border-top: 1px solid var(--line); padding-top: 12px; }
.adj__when { display: flex; flex-direction: column; min-width: 92px; }
.adj__name { font-size: 12px; font-weight: 600; }
.adj__time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tzrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.tzrow select { min-height: 36px; width: auto; padding: 6px 10px; font-size: 13px; }
.stale { opacity: 0.5; }

/* ── 표 (관리 화면) ──────────────────────────────────── */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; background: var(--surface2); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.mono, th.mono { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
tr.expiring td { background: rgba(232, 184, 75, 0.06); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { min-height: 38px; width: auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.tabs a[aria-current="true"] { color: var(--text); border-color: var(--service); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } .code--now { font-size: 28px; } .who__name { max-width: 120px; } }
