/* 1.4.0 (S): the 2FA codes page, "Move your codes", the camera, export. Uses the shared tokens of app.css. */

.otp-av { font-size: .82rem; letter-spacing: .02em; }

/* the clock check */
.otp-clock { margin: calc(var(--s2) * -1) 0 var(--s4); min-height: 20px; }
.otp-clock-ok { display: inline-flex; align-items: center; gap: var(--s1); color: var(--ok); }
.otp-clock-ok .ico { width: 16px; height: 16px; }
.otp-clock-warn { margin: 0; }
.otp-clock-warn strong { color: var(--text); display: block; margin-bottom: var(--s1); }
.otp-clock-warn p { margin: 0 0 var(--s2); }
.otp-clock-warn .btns { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* the code cards */
.otp-card { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "av name more" "av sub more" "av code ring"; min-height: 112px; position: relative; }
.otp-card > .avatar { grid-area: av; align-self: center; }
.otp-card > .name { grid-area: name; }
.otp-card > .sub { grid-area: sub; }
.otp-card > .otp-code-line { grid-area: code; display: flex; align-items: baseline; gap: var(--s1) var(--s3); flex-wrap: wrap; min-width: 0; margin-top: var(--s1); }
.otp-card .totp-code { white-space: nowrap; }
.otp-card > .ring, .otp-card > .otp-hotp-next, .otp-card > span:empty { grid-area: ring; justify-self: end; }
.otp-card > .code-more { grid-area: more; align-self: start; justify-self: end; margin: calc(var(--s2) * -1) calc(var(--s2) * -1) 0 0; }
.otp-card:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.otp-card.bad { cursor: default; }
.totp-code.steam { letter-spacing: .16em; }
.otp-next { font-family: var(--mono); font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.otp-hotp-next .ico { width: 16px; height: 16px; }

/* phone: a compact list */
@media (max-width: 760px) {
  .otp-codes { gap: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
  .otp-codes > .empty { border: 0; }
  .otp-card { grid-template-columns: auto minmax(0, 1fr) auto auto auto; grid-template-areas: "av name code ring more" "av sub code ring more"; min-height: 64px; padding: var(--s2) var(--s2) var(--s2) var(--s3); border: 0; border-bottom: 1px solid var(--border); border-radius: 0; gap: 0 var(--s2); }
  .otp-card:last-child { border-bottom: 0; }
  .otp-card > .otp-code-line { flex-direction: column; align-items: flex-end; gap: 0; margin: 0; }
  .otp-card .totp-code { font-size: 1.15rem; letter-spacing: .05em; }
  .otp-card > .code-more { align-self: center; margin: 0; }
  .otp-card > .ring, .otp-card > .otp-hotp-next, .otp-card > span:empty { align-self: center; }
  .otp-card .otp-hotp-next span { display: none; }
  .otp-page .page-head .actions .btn span { display: none; }
  .otp-page .page-head .actions .btn .ico { margin: 0; }
}

/* ---------- Move your codes ---------- */
.otp-import { max-width: 1000px; }
.otp-step h2 { margin-bottom: var(--s2); }
.otp-guide { margin: 0 0 var(--s4); }
.otp-seg { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.otp-steps { margin: var(--s3) 0 0; padding-left: 1.3em; color: var(--muted); max-width: 72ch; }
.otp-steps li { margin: 0 0 var(--s1); }
.otp-drop { display: flex; flex-direction: column; align-items: center; gap: var(--s1); padding: var(--s5) var(--s4); margin: 0 0 var(--s3); }
.otp-drop .ico { width: 26px; height: 26px; color: var(--accent); }
.otp-drop strong { color: var(--text); }
.otp-src-btns { display: flex; gap: var(--s2); flex-wrap: wrap; margin: 0 0 var(--s3); }
.otp-paste { margin: 0 0 var(--s3); border: 1px solid var(--border); border-radius: var(--radius-ctl); }
.otp-paste > summary { display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4); cursor: pointer; list-style: none; font-weight: 560; }
.otp-paste > summary::-webkit-details-marker { display: none; }
.otp-paste[open] .more-chev { transform: rotate(90deg); }
.otp-paste .more-body { padding: 0 var(--s4) var(--s4); }
.otp-paste textarea { margin-bottom: var(--s2); }
.otp-status { display: flex; flex-direction: column; gap: var(--s1); }
.otp-src { display: flex; gap: var(--s2); align-items: flex-start; font-size: .88rem; color: var(--muted); }
.otp-src .ico { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--ok); }
.otp-src.warn .ico { color: var(--warn); }
.otp-src.ok span { color: var(--text); }

/* the camera */
.otp-cam { margin: 0 0 var(--s3); }
.otp-cam-ask { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); border-radius: var(--radius-ctl); background: var(--surface-2); border: 1px solid var(--border); }
.otp-cam-ask .ico { width: 28px; height: 28px; color: var(--accent); flex: none; }
.otp-cam-ask p { margin: var(--s1) 0 0; }
.otp-video-box { position: relative; width: 100%; max-width: 480px; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: #000; margin: 0 0 var(--s2); }
.otp-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.otp-aim { position: absolute; inset: 8%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); pointer-events: none; }
.otp-cam .btns { display: flex; gap: var(--s2); }

/* the review */
.otp-review { display: flex; flex-direction: column; gap: var(--s2); margin: var(--s3) 0; }
.otp-rrow { display: grid; grid-template-columns: auto auto minmax(0, 1fr) minmax(150px, auto) minmax(200px, 260px); grid-template-areas: "tick av name code act"; gap: var(--s2) var(--s3); align-items: center; min-height: 64px; padding: var(--s2) var(--s3); border: 1px solid var(--border); border-radius: var(--radius-ctl); background: var(--surface); }
.otp-rrow.skipped { background: var(--surface-2); }
.otp-rrow.skipped .otp-rname .name, .otp-rrow.skipped .totp-code { color: var(--muted); }
.otp-rrow > .avatar { grid-area: av; }
.otp-tick { grid-area: tick; display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; font-size: .82rem; color: var(--muted); padding: var(--s1) var(--s2); border-radius: var(--radius-sm); border: 1px solid var(--border); min-height: var(--ctl-sm); white-space: nowrap; }
.otp-tick.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.otp-tick input { margin: 0; accent-color: var(--ok); width: 16px; height: 16px; }
.otp-tick:has(input:disabled) { opacity: .55; cursor: default; }
.otp-rname { grid-area: name; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.otp-rname .name { font-weight: 600; }
.otp-rname .sub { color: var(--muted); font-size: .82rem; }
.otp-rname .chips { margin-top: 2px; }
.otp-rname .badge { white-space: normal; height: auto; min-height: 20px; }
.otp-rcode { grid-area: code; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.otp-raction { grid-area: act; min-width: 0; }
.otp-raction > span { display: block; text-align: right; }
.otp-save-bar { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; padding-top: var(--s3); border-top: 1px solid var(--border); }
.otp-done { text-align: center; padding: var(--s6) var(--s5); }
.otp-done-ico { width: 56px; height: 56px; margin: 0 auto var(--s3); border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.otp-done-ico .ico { width: 30px; height: 30px; }
.otp-after { text-align: left; max-width: 62ch; margin: var(--s4) auto; padding-left: 1.2em; color: var(--muted); }
.otp-after li { margin-bottom: var(--s2); }
.otp-done .btns { display: flex; gap: var(--s2); justify-content: center; flex-wrap: wrap; }

@media (max-width: 900px) {
  .otp-rrow { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "av name code" "tick tick tick" "act act act"; }
  .otp-tick { justify-self: start; }
}
@media (max-width: 760px) {
  .otp-video-box { max-width: none; }
  .otp-save-bar .grow { flex-basis: 100%; }
}

/* ---------- export ---------- */
.otp-exp-list { display: flex; flex-direction: column; gap: var(--s2); }
.otp-exp { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 64px; padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--radius-ctl); background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.otp-exp:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.otp-exp .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.otp-exp small { color: var(--muted); font-size: .82rem; }
.otp-exp .type-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); flex: none; }
.otp-exp.warn .type-ico { color: var(--warn); }
.otp-qr-view { display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.otp-qr-view .notice { align-self: stretch; margin: 0; }
.otp-qr-name { display: flex; align-items: center; gap: var(--s3); align-self: stretch; }
.otp-qr-name .grow { display: flex; flex-direction: column; min-width: 0; }
.otp-qr { width: 280px; margin: 0; }
.otp-qr-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); align-self: stretch; }
