/* Shared, isolated presentation for all two-factor-authentication views. */
.tf-page {
  --tf-ink: #172b46;
  --tf-muted: #64748b;
  --tf-line: #e2e8f0;
  --tf-blue: var(--bs-primary-active, #056ee9);
  --tf-button-bg: var(--bs-primary-active, #056ee9);
  --tf-blue-soft: var(--bs-primary-light, #e9f3ff);
  --tf-aside-bg: #f4f8fc;
  --tf-illustration-line: #d5e5f5;
  --tf-surface: #fff;
  margin: 0;
  min-height: 100vh;
  background: #f3f6fa;
  color: var(--tf-ink);
  font: 15px/1.6 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.tf-page.tf-standalone { box-sizing: border-box; padding-top: clamp(24px, 6vh, 64px); }
.tf-page *, .tf-page *::before, .tf-page *::after { box-sizing: border-box; }
.tf-page [hidden] { display: none !important; }
.tf-page a { color: var(--tf-blue); text-decoration: none; }
.tf-page a:hover { text-decoration: underline; }
.tf-page button, .tf-page input, .tf-page select, .tf-page textarea { font: inherit; }
.tf-page button { cursor: pointer; }
.tf-page :focus-visible { outline: 3px solid var(--tf-blue); outline-offset: 4px; }
.tf-page h1, .tf-page h2, .tf-page h3, .tf-page p { margin-top: 0; }
.tf-page h1 { margin-bottom: 12px; font-size: clamp(25px, 2.4vw, 32px); font-weight: 720; letter-spacing: -.8px; line-height: 1.2; }
.tf-page h2 { font-size: 18px; line-height: 1.4; }
.tf-page h3 { font-size: 16px; line-height: 1.4; }
.tf-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.tf-icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; vertical-align: middle; }
.tf-footer { width: min(1120px, calc(100% - 64px)); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.tf-shell { display: grid; grid-template-columns: 350px minmax(0, 1fr); max-width: 1120px; margin: 0 auto; background: #fff; border: 1px solid var(--tf-line); border-radius: 22px; overflow: hidden; box-shadow: 0 14px 44px #1834520a; }
.tf-standalone .tf-shell { width: min(560px, calc(100% - 40px)); margin: 0 auto; grid-template-columns: minmax(0, 1fr); }
.tf-standalone .tf-footer { max-width: 560px; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.tf-aside { position: relative; padding: 36px 34px 28px; color: var(--tf-ink); background: var(--tf-aside-bg); border-right: 1px solid var(--tf-line); overflow: hidden; }
.tf-aside-label { color: var(--tf-muted); font-size: 10px; font-weight: 650; letter-spacing: 2px; }
.tf-aside h2 { margin: 12px 0 16px; font-size: 28px; font-weight: 650; line-height: 1.25; letter-spacing: -.6px; }
.tf-aside > p { color: var(--tf-muted); font-size: 14px; line-height: 1.8; }
.tf-illustration { position: relative; height: 215px; display: grid; place-items: center; margin: 8px -12px 18px; }
.tf-orbit { position: absolute; width: 200px; height: 200px; border: 1px solid var(--tf-illustration-line); border-radius: 50%; }
.tf-orbit-inner { width: 148px; height: 148px; background: var(--tf-blue-soft); }
.tf-shield { width: 94px; height: 104px; display: grid; place-items: center; border: 1px solid var(--tf-illustration-line); border-radius: 26px; background: var(--tf-surface); box-shadow: 0 12px 28px #1834520d; transform: rotate(-7deg); }
.tf-shield .tf-icon { width: 60px; height: 60px; color: var(--tf-blue); stroke-width: 1.3; transform: rotate(7deg); }
.tf-orbit-dot { position: absolute; width: 9px; height: 9px; top: 35px; right: 61px; background: var(--tf-blue); border: 2px solid var(--tf-aside-bg); border-radius: 50%; box-shadow: 0 0 0 6px var(--tf-blue-soft); }
.tf-security-pill { position: absolute; bottom: 10px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 8px; border: 1px solid var(--tf-illustration-line); background: var(--tf-surface); color: var(--tf-muted); font-size: 10px; box-shadow: 0 8px 20px #18345208; }
.tf-security-pill .tf-icon { width: 16px; height: 16px; color: var(--tf-blue); }
.tf-aside-steps { padding: 4px 0 0; margin: 28px 0; list-style: none; }
.tf-aside-steps li { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.tf-aside-steps li > span { color: var(--tf-blue); font-size: 11px; padding-top: 3px; font-variant-numeric: tabular-nums; }
.tf-aside-steps strong { display: block; font-size: 13px; font-weight: 600; }
.tf-aside-steps small { display: block; margin-top: 2px; font-size: 11px; color: var(--tf-muted); }
.tf-aside .tf-aside-footnote { border-top: 1px solid var(--tf-line); padding-top: 20px; margin: 30px 0 0; font-size: 11px; line-height: 1.7; color: var(--tf-muted); }
.tf-main { align-self: center; min-width: 0; padding: 48px 56px; }
.tf-main:focus { outline: none; }
.tf-eyebrow { margin-bottom: 15px; font-size: 10px; font-weight: 750; letter-spacing: 1.8px; color: var(--tf-blue); text-transform: uppercase; }
.tf-description { margin-bottom: 28px; color: var(--tf-muted); font-size: 14px; line-height: 1.8; }
.tf-page-icon { width: 48px; height: 48px; display: grid; place-items: center; background: var(--tf-blue-soft); color: var(--tf-blue); border: 1px solid var(--tf-illustration-line); border-radius: 14px; margin-bottom: 22px; }
.tf-page-icon .tf-icon { width: 26px; height: 26px; }
.tf-page-icon-success { color: #138162; background: #e9f8f1; border-color: #d1eee1; }
.tf-page-icon-danger { color: #bf3b49; background: #fff1f2; border-color: #f9dce1; }
.tf-fields { display: grid; gap: 20px; }
.tf-fields:empty { display: none; }
.tf-field { min-width: 0; }
.tf-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 650; }
.tf-input-wrap { position: relative; }
.tf-fields input:not([type=hidden]):not([type=checkbox]):not([type=radio]), .tf-fields select, .tf-fields textarea { width: 100%; min-height: 48px; border: 1px solid #ced7e3; border-radius: 9px; padding: 11px 14px; color: var(--tf-ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
.tf-fields input::placeholder { color: #8392a5; }
.tf-fields input:focus, .tf-fields select:focus, .tf-fields textarea:focus { outline: 0; border-color: var(--tf-blue); box-shadow: 0 0 0 3px var(--tf-blue-soft); }
.tf-fields input[type=password], .tf-fields input[data-password-visible] { padding-right: 84px !important; }
.tf-fields input[type=checkbox], .tf-fields input[type=radio] { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--tf-blue); vertical-align: middle; }
.tf-input-wrap div:has(> label > input[type=radio]) { margin: 8px 0; padding: 12px; border: 1px solid var(--tf-line); border-radius: 8px; }
.tf-checkbox-label { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: #52647b; cursor: pointer; }
.tf-checkbox-label input { margin: 2px 0 0; }
.tf-password-toggle { position: absolute; right: 7px; top: 5px; height: 38px; padding: 0 10px; background: transparent; border: 0; border-radius: 6px; color: #3764a5; font-size: 11px !important; font-weight: 650 !important; }
.tf-password-toggle:hover { background: #f0f5fc; }
.tf-field-token input { font: 600 22px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace !important; letter-spacing: .22em; }
.tf-field-token input[type=number] { appearance: textfield; -moz-appearance: textfield; }
.tf-field-token input::-webkit-inner-spin-button, .tf-field-token input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tf-field-help { margin-top: 6px; color: var(--tf-muted); font-size: 12px; }
.tf-field-errors { color: #b82b40; font-size: 12px; margin-top: 6px; }
.tf-field-invalid input:not([type=checkbox]) { border-color: #dc6977 !important; background: #fffcfc !important; }
.tf-page .errorlist { list-style: none; margin: 0; padding: 0; }
.tf-notice { padding: 14px 16px; margin-bottom: 22px; border: 1px solid #dfe9fa; border-radius: 10px; background: #f4f8ff; color: #425d81; font-size: 13px; }
.tf-notice p:last-child { margin-bottom: 0; }
.tf-notice-danger { background: #fff5f5; border-color: #f4d7dd; color: #a63143; }
.tf-notice-success { background: #eef9f3; border-color: #d4ecde; color: #267553; }
.tf-notice-warning { background: #fffbf1; border-color: #efe3c2; color: #82611e; }
.tf-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.tf-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 11px 18px; border: 1px solid transparent; border-radius: 9px; font-size: 13px !important; font-weight: 650 !important; text-align: center; text-decoration: none !important; line-height: 1.45; transition: background-color .15s; }
.tf-button .tf-icon { width: 18px; height: 18px; }
.tf-button-primary { background: var(--tf-button-bg); color: #fff !important; box-shadow: 0 3px 6px #1834520d; }
.tf-button-primary:hover { background: var(--tf-button-bg); filter: brightness(.92); }
.tf-button-secondary { background: #fff; color: #40536d !important; border-color: #d7e0eb; }
.tf-button-secondary:hover { background: #f4f7fb; }
.tf-button-danger { background: #be3549; color: #fff !important; }
.tf-button-danger:hover { background: #9f2336; }
.tf-button-soft-danger { background: #fff; color: #b33849 !important; border-color: #f1d9df; }
.tf-button-wide { width: 100%; }
.tf-text-link { font-size: 13px; font-weight: 600; }
.tf-cancel { margin-left: auto; }
.tf-login .tf-actions .tf-button-primary { flex: 1; }
.tf-divider { margin: 26px 0 20px; border-top: 1px solid var(--tf-line); }
.tf-secondary-copy { color: var(--tf-muted); font-size: 12px; margin-bottom: 12px; }
.tf-alternatives { display: grid; gap: 10px; margin-top: 24px; }
.tf-alternatives p { margin-bottom: 0; }
.tf-step-progress { display: flex; align-items: center; gap: 15px; margin-bottom: 26px; color: var(--tf-muted); font-size: 11px; font-weight: 600; }
.tf-step-progress progress { flex: 1; min-width: 0; height: 4px; border: none; border-radius: 6px; overflow: hidden; background: #e9eef5; accent-color: var(--tf-blue); }
.tf-step-progress progress::-webkit-progress-bar { background: #e9eef5; }
.tf-step-progress progress::-webkit-progress-value { background: var(--tf-blue); border-radius: 6px; }
.tf-step-progress progress::-moz-progress-bar { background: var(--tf-blue); }
.tf-checklist { margin: 0 0 26px; padding: 0; list-style: none; display: grid; gap: 18px; }
.tf-checklist li { display: flex; gap: 14px; align-items: flex-start; }
.tf-checklist-number { display: grid; place-items: center; width: 28px; height: 28px; background: #f0f5fd; color: #3466b2; border-radius: 8px; font-size: 12px; font-weight: 650; flex-shrink: 0; }
.tf-checklist strong { font-size: 13px; }
.tf-checklist p { margin: 2px 0 0; color: var(--tf-muted); font-size: 12px; }
.tf-qr-panel { display: flex; align-items: center; gap: 22px; padding: 18px; margin-bottom: 18px; border: 1px solid var(--tf-line); border-radius: 12px; background: #f8fafc; }
.tf-qr-code { display: block; width: 168px; height: 168px; flex-shrink: 0; padding: 6px; border: 1px solid #e5eaf1; border-radius: 8px; background: #fff; color-scheme: light; object-fit: contain; }
.tf-qr-panel h2 { font-size: 14px; margin-bottom: 8px; }
.tf-qr-panel p { font-size: 12px; color: var(--tf-muted); margin-bottom: 0; }
.tf-manual-key { margin-bottom: 24px; font-size: 12px; }
.tf-manual-key summary { cursor: pointer; color: #3d67a5; font-weight: 600; padding: 6px 0; }
.tf-manual-key p { margin: 12px 0; color: var(--tf-muted); }
.tf-secret { display: block; border: 1px dashed #c9d7e8; border-radius: 8px; padding: 12px; background: #f8fafd; font: 13px/1.8 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.tf-mini-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; }
.tf-copy-button { border: 0; background: transparent; color: var(--tf-blue); padding: 2px 0; font-size: 12px !important; font-weight: 600 !important; }
.tf-copy-status { display: block; margin-top: 8px; font-size: 12px; color: #4b687e; }
.tf-copy-status:empty { display: none; }
.tf-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 6px; background: #eaf8f1; color: #247955; font-size: 10px; font-weight: 750; letter-spacing: .3px; }
.tf-status .tf-icon { width: 14px; height: 14px; }
.tf-status-off { background: #fff5de; color: #87631e; }
.tf-section-card { border: 1px solid var(--tf-line); border-radius: 12px; padding: 20px; margin-top: 16px; }
.tf-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tf-section-heading h2 { margin: 0; font-size: 15px; }
.tf-section-heading > .tf-icon { color: #5981b8; }
.tf-section-card p { font-size: 13px; color: var(--tf-muted); margin-bottom: 14px; }
.tf-section-card .tf-button { min-height: 40px; padding: 9px 13px; font-size: 12px !important; }
.tf-danger-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--tf-line); }
.tf-danger-section h2 { margin-bottom: 7px; font-size: 14px; }
.tf-danger-section p { color: var(--tf-muted); font-size: 12px; margin-bottom: 12px; }
.tf-code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 18px; margin: 22px 0; list-style: none; border: 1px dashed #cdd8e7; border-radius: 12px; background: #f8fafc; }
.tf-code-grid li { padding: 7px 10px; background: #fff; border: 1px solid #e5ebf3; border-radius: 6px; text-align: center; }
.tf-code-grid code { font: 14px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .05em; overflow-wrap: anywhere; }
.tf-empty { padding: 25px 20px; margin: 22px 0; text-align: center; border: 1px dashed #ced9e8; border-radius: 12px; background: #f9fbfd; color: var(--tf-muted); font-size: 13px; }
.tf-empty > .tf-icon { display: block; margin: 0 auto 12px; width: 28px; height: 28px; color: #7995bc; }
.tf-phone-list { padding-left: 20px; }
.tf-phone-list li { margin-bottom: 15px; font-size: 13px; }
.tf-phone-list form { margin-top: 8px; }
.tf-footer { min-height: 84px; padding: 20px 0; color: #738196; font-size: 11px; }
.tf-footer span:first-child { display: flex; gap: 6px; align-items: center; }
.tf-footer .tf-icon { width: 14px; height: 14px; }
.tf-skip { position: fixed; left: 20px; top: -80px; z-index: 1100; background: #fff; border: 1px solid var(--tf-blue); border-radius: 8px; padding: 12px; }
.tf-skip:focus { top: 12px; }
/* Keep authentication inside the existing panel and its theme/navigation. */
.tf-page.tf-panel { position: relative; min-height: 0; background: transparent; }
.tf-panel .tf-shell { width: 100%; margin: 0 auto; grid-template-columns: 280px minmax(0, 1fr); }
.tf-panel .tf-main { padding: 36px 40px; }
.tf-panel .tf-aside { padding: 28px; }
.tf-panel .tf-aside h2 { color: var(--tf-ink); font-size: 25px; }
.tf-panel .tf-illustration { height: 180px; }
.tf-panel .tf-orbit { width: 166px; height: 166px; }
.tf-panel .tf-orbit-inner { width: 130px; height: 130px; }
.tf-panel .tf-footer { width: 100%; max-width: 1120px; min-height: 64px; }
[data-bs-theme=dark] .tf-panel { --tf-ink: #e3e8f1; --tf-muted: #a3b1c5; --tf-line: #354054; --tf-blue: #91b9ff; --tf-button-bg: var(--bs-primary, #006ae6); --tf-aside-bg: #1c293b; --tf-illustration-line: #35485f; --tf-surface: #202e43; }
[data-bs-theme=dark] .tf-panel .tf-shell { background: #1b2535; }
[data-bs-theme=dark] .tf-panel h1, [data-bs-theme=dark] .tf-panel h2, [data-bs-theme=dark] .tf-panel h3 { color: var(--tf-ink); }
[data-bs-theme=dark] .tf-panel .tf-fields input:not([type=checkbox]):not([type=radio]), [data-bs-theme=dark] .tf-panel .tf-fields select { background: #141d2b; color: var(--tf-ink); border-color: #465269; }
[data-bs-theme=dark] .tf-panel .tf-qr-panel, [data-bs-theme=dark] .tf-panel .tf-secret, [data-bs-theme=dark] .tf-panel .tf-empty, [data-bs-theme=dark] .tf-panel .tf-code-grid { background: #151f2e; }
[data-bs-theme=dark] .tf-panel .tf-code-grid li { background: #1b2535; border-color: var(--tf-line); }
[data-bs-theme=dark] .tf-panel .tf-button-secondary { background: #202e43; color: #d4e1f7 !important; border-color: #40516b; }
[data-bs-theme=dark] .tf-panel .tf-button-soft-danger { background: #34212c; color: #ffadb9 !important; border-color: #684451; }
[data-bs-theme=dark] .tf-panel .tf-checkbox-label { color: #b8c8dc; }
[data-bs-theme=dark] .tf-panel .tf-field-errors { color: #ff9baa; }
[data-bs-theme=dark] .tf-panel .tf-field-invalid input:not([type=checkbox]) { background: #35212c !important; }
[data-bs-theme=dark] .tf-panel .tf-eyebrow, [data-bs-theme=dark] .tf-panel .tf-text-link, [data-bs-theme=dark] .tf-panel .tf-copy-button, [data-bs-theme=dark] .tf-panel .tf-manual-key summary, [data-bs-theme=dark] .tf-panel .tf-mini-actions a { color: #91b9ff; }
@media (max-width: 1184px) {
  .tf-shell { margin: 0 32px; grid-template-columns: 310px minmax(0, 1fr); }
  .tf-aside { padding: 32px 28px; }
  .tf-main { padding: 40px 36px; }
}
@media (max-width: 900px) {
  .tf-panel .tf-shell { grid-template-columns: 230px minmax(0, 1fr); }
  .tf-panel .tf-main { padding: 28px; }
  .tf-panel .tf-aside { padding: 22px; }
  .tf-shell { grid-template-columns: 260px minmax(0, 1fr); }
  .tf-aside { padding: 28px 22px; }
  .tf-aside h2 { font-size: 25px; }
  .tf-main { padding: 34px 28px; }
  .tf-qr-panel { flex-direction: column; text-align: center; gap: 14px; }
}
@media (max-width: 720px) {
  .tf-panel .tf-shell { margin: 0; }
  .tf-panel .tf-main { padding: 28px 24px; }
  .tf-footer { width: calc(100% - 40px); }
  .tf-shell { display: block; margin: 0 20px; border-radius: 16px; }
  .tf-aside { display: none; }
  .tf-main { padding: 30px 24px; }
  .tf-page h1 { font-size: 26px; }
  .tf-fields input:not([type=checkbox]):not([type=radio]), .tf-fields select { font-size: 16px; }
  .tf-description { margin-bottom: 24px; }
  .tf-footer { align-items: flex-start; flex-direction: column; gap: 8px; padding: 22px 5px 28px; }
  .tf-qr-panel { flex-direction: row; text-align: left; gap: 14px; padding: 12px; }
  .tf-qr-code { width: 132px; height: 132px; }
  .tf-actions .tf-button-primary, .tf-actions .tf-button-danger { width: 100%; }
  .tf-code-grid { gap: 8px; padding: 12px; }
  .tf-code-grid li { padding: 7px 4px; }
  .tf-code-grid code { font-size: 13px; }
}
@media (max-width: 400px) {
  .tf-panel .tf-main { padding: 24px 18px; }
  .tf-footer { width: calc(100% - 28px); }
  .tf-shell { margin: 0 14px; }
  .tf-main { padding: 26px 20px; }
  .tf-qr-panel { flex-direction: column; text-align: center; padding: 16px; }
  .tf-qr-code { width: 164px; height: 164px; }
}
@media (prefers-reduced-motion: reduce) { .tf-page * { transition: none !important; } }
@media print {
  .tf-page { background: #fff; }
  .tf-aside, .tf-footer, .tf-actions, .tf-mini-actions, .tf-copy-status { display: none !important; }
  .tf-shell { display: block; margin: 0; border: 0; box-shadow: none; }
  .tf-main { padding: 20px; }
  .tf-code-grid { break-inside: avoid; }
}
