/* ============================================================================
   Spillard Live — Identity / MFA styling
   Single-pane brand layout (logo-sl-background watermark card).
   Animation language: "Spillard Ripple & Lift".
   Component-class architecture preserved so per-page markup stays stable.
   ========================================================================== */

/* Design tokens
   The component library references these custom-property names throughout;
   the values are the Spillard brand palette. */

:root {
  /* Surface / neutral scale (white → near-black) */
  --color-surface-50:  #ffffff;
  --color-surface-100: #f4f5f7;
  --color-surface-200: #e6e6e6;
  --color-surface-300: #d4d6db;
  --color-surface-400: #b5b8bf;
  --color-surface-500: #666666;
  --color-surface-600: #555555;
  --color-surface-700: #3a3d44;
  --color-surface-800: #222222;
  --color-surface-900: #14202c;

  /* Primary = Spillard red */
  --color-primary-50:  #ffe3e8;
  --color-primary-100: #ff6884;
  --color-primary-200: #fa1d41;
  --color-primary-300: #d6173a;
  --color-primary-400: #b21130;

  /* Microsoft dark (legacy "cms" slot — repurposed to brand-dark / danger accents) */
  --color-cms-50:  #fbe9ec;
  --color-cms-100: #f5536f;
  --color-cms-200: #e21d40;
  --color-cms-300: #d6173a;
  --color-cms-400: #b21130;

  /* Microsoft button surface */
  --color-microsoft: #2f2f2f;
  --color-microsoft-hover: #1f1f1f;

  /* Status: success (Spillard green) */
  --color-hover-bg:    #f4f5f7;
  --color-success-50:  #e6f8f2;
  --color-success-100: #c5efe2;
  --color-success-200: #8fe0c8;
  --color-success-300: #01bc86;

  /* Status: danger (red family) */
  --color-danger-50:  #fdecef;
  --color-danger-100: #f8c2cc;
  --color-danger-300: #d6173a;

  /* Status: warning (amber, from the mock's codes-banner) */
  --color-warning-50:  #fff8e6;
  --color-warning-100: #ffd57a;
  --color-warning-300: #8a6500;

  /* Page background image */
  --color-page-bg: #f4f5f7;

  /* Spacing scale */
  --spacing-xxxs: 0.4rem;
  --spacing-xxs:  0.8rem;
  --spacing-xs:   1rem;
  --spacing-sm:   1.2rem;
  --spacing-md:   1.6rem;
  --spacing-lg:   2rem;
  --spacing-xl:   2.4rem;
  --spacing-xxl:  3.2rem;
  --spacing-xxxl: 4.8rem;

  /* Font weight */
  --font-weight-light:    400;
  --font-weight-regular:  400;
  --font-weight-medium:   600;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;

  /* Font size */
  --font-size-xxxs: 1rem;
  --font-size-xxs:  1.2rem;
  --font-size-xs:   1.4rem;
  --font-size-sm:   1.6rem;
  --font-size-md:   1.8rem;
  --font-size-lg:   2.4rem;
  --font-size-xl:   3rem;
  --font-size-xxl:  4.8rem;
  --font-size-xxxl: 6rem;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
}

/* Fonts — self-hosted Open Sans (variable; covers 400-700) */

@font-face {
  font-family: 'Open Sans';
  src: url('/fonts/OpenSans-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Open Sans';
  src: url('/fonts/OpenSans-latin-ext.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
html {
  margin: 0;
  padding: 0;
}

input,
button,
select,
textarea {
  font-family: inherit;
}

html {
  font-size: 62.5%;
  font-family: 'Open Sans', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
  min-height: 100vh;
  color: var(--color-surface-800);
  background: var(--color-page-bg) url('../img/login-sl-background.png') no-repeat center;
  background-size: cover;
}

@media (max-height: 600px) {
  :root {
    --font-size-md: 1.4rem;
    --font-size-xl: 2.4rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.6rem;
  }
}

/* ============================================================================
   Single-pane layout
   ========================================================================== */

.wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 5.3vh 2vw;
}

.main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Brand mark fixed top-left over the background (logo-sl-alt) */
.brand-mark {
  position: fixed;
  top: 20px;
  left: 40px;
  height: 92px;
  width: auto;
  z-index: 1;
}

@media (max-width: 600px) {
  .brand-mark {
    top: 16px;
    left: 16px;
    height: 56px;
  }
}

/* Logo + Card column */

.logo-card-wrapper {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 610px;
  z-index: 2;
}

/* White card — Spillard formWrapper look: branding watermark + soft shadow.
   Original Spillard geometry: near-full-height card (~82vh of content + 80px
   top padding), square-ish corners, simple grey shadow, watermark anchored
   bottom-left, content flowing from the top. Uses min-height so content-heavy
   shared pages (Security, Manage, LoginHistory) grow and scroll rather than
   clip on short viewports. */
.card-container {
  width: 100%;
  min-height: calc(82vh + 8rem);
  background: var(--color-surface-50) url('../img/login-sl-branding.svg') no-repeat bottom left;
  border-radius: 3px;
  box-shadow: 0 3px 6px gray;
  padding: 8rem 4rem 6rem;
  position: relative;
  animation: card-enter 0.25s ease-out both;
}

/* In-card logo (logo-sl-black). Spans the full card content width like the
   original Spillard .logo. Keeps the .logo-img hook main.js reads for the
   recovery-code print sheet. */
.logo-img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0 auto;
  padding-bottom: 6rem;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .card-container {
    min-height: 0;
    padding: 5.6rem 2.4rem 5rem;
  }
}

/* ============================================================================
   Form
   ========================================================================== */

.form {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.form .title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-surface-800);
  margin-top: 0;
  margin-bottom: var(--spacing-xl);
  text-align: left;
}

.form .text-muted,
.form .text-muted--sm {
  margin-top: 0;
}

/* Inputs (static label above the field) */

.input-container {
  position: relative;
  margin-bottom: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  width: 100%;
}

.input-container input {
  width: 100%;
  height: 3.8rem;
  border: 1px solid var(--color-surface-200);
  border-radius: 3px;
  padding: 0 var(--spacing-sm);
  background: var(--color-surface-50);
  outline: none;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  color: var(--color-surface-800);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-container input:hover {
  border-color: var(--color-surface-300);
}

.input-container input:focus {
  border-color: var(--color-surface-900);
  box-shadow: 0 0 0 1px var(--color-surface-900);
}

.input-container input::placeholder {
  color: var(--color-surface-400);
  opacity: 1;
}

.input--invalid {
  border-color: var(--color-primary-200) !important;
  box-shadow: 0 0 0 1px var(--color-primary-200) !important;
  animation: micro-shake 0.3s ease;
}

/* "Spillard Ripple & Lift": invalid = 2px micro-shake + red border flash */
@keyframes micro-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-2px); }
}

.input-container .password-toggle {
  position: absolute;
  right: var(--spacing-sm);
  bottom: 0;
  height: 3.8rem;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-surface-400);
  font-size: var(--font-size-xs);
  padding: 0 var(--spacing-xxxs);
  transition: color 0.2s ease;
}

.input-container .password-toggle:hover {
  color: var(--color-surface-700);
}

.forgot-password-link {
  text-align: right;
  margin-top: calc(-1 * var(--spacing-sm));
  margin-bottom: var(--spacing-xl);
}

.forgot-password-link a {
  font-size: var(--font-size-xs);
  color: var(--color-surface-600);
  text-decoration: none;
}

.forgot-password-link a:hover {
  color: var(--color-primary-200);
  text-decoration: underline;
}

.input-container .label {
  order: -1;
  margin-bottom: var(--spacing-xxs);
  color: var(--color-surface-600);
  font-size: 1.3rem;
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
}

.input-container .bar {
  display: none;
}

/* Monospace recovery-code entry (mock recovery-entry idiom) */
.input--mono {
  font-family: ui-monospace, SFMono-Regular, 'Courier New', monospace;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
}

.input--mono::placeholder {
  letter-spacing: normal;
  text-transform: none;
}

/* Error state */
.input-container.error input {
  border-color: var(--color-primary-200);
}

.input-container.error input:focus {
  border-color: var(--color-primary-200);
  box-shadow: 0 0 0 1px var(--color-primary-200);
}

.input-container.error .label {
  color: var(--color-primary-200);
}

.input-container input:-webkit-autofill,
.input-container input:-webkit-autofill:hover,
.input-container input:-webkit-autofill:focus,
.input-container input:autofill,
.input-container input:autofill:hover,
.input-container input:autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #222222 !important;
  transition: background-color 5000s ease-in-out 0s;
  background-color: #ffffff !important;
  caret-color: #222222;
}

/* ============================================================================
   Buttons — "Ripple & Lift"
   ========================================================================== */

.btn {
  display: flex;
  height: 4.6rem;
  gap: var(--spacing-xs);
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  background-position: center;
  transition: background 0.6s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn--fullWidth {
  flex: 1 1 0;
}

/* Red ripple from the mock (radial-gradient center/15000%) */
.btn--filled {
  padding: 0 var(--spacing-lg);
  background-color: var(--color-primary-200);
  color: var(--color-surface-50);
}

.btn--filled:hover {
  background: var(--color-primary-200) radial-gradient(circle, transparent 1%, var(--color-primary-200) 1%) center/15000%;
}

.btn--filled:active {
  background-color: rgba(250, 29, 65, 0.35);
  background-size: 100%;
  transition: background 0s;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary-200);
  outline-offset: 2px;
}

.btn--text {
  background: transparent;
  color: var(--color-surface-600);
  text-transform: none;
  letter-spacing: normal;
  font-weight: var(--font-weight-regular);
}

.btn--text:hover {
  color: var(--color-primary-200);
}

.btn--border {
  padding: var(--spacing-sm) var(--spacing-lg);
  border-color: var(--color-primary-200);
  color: var(--color-primary-200);
  background: var(--color-surface-50);
}

.btn--border:hover {
  background-color: var(--color-primary-200);
  color: var(--color-surface-50);
}

.btn--underline {
  text-decoration: underline;
  text-transform: none;
  letter-spacing: normal;
  font-weight: var(--font-weight-regular);
}

.btn--danger {
  padding: var(--spacing-sm) var(--spacing-lg);
  background-color: var(--color-cms-300);
  color: var(--color-surface-50);
}

.btn--danger:hover {
  background-color: var(--color-cms-400);
}

/* Microsoft sign-in button — dark, full-width */
.btn--microsoft {
  padding: 0 var(--spacing-lg);
  background-color: var(--color-microsoft);
  color: var(--color-surface-50);
  border: 1px solid var(--color-microsoft);
  width: 100%;
  text-transform: none;
  letter-spacing: normal;
  font-weight: var(--font-weight-medium);
}

.btn--microsoft:hover {
  background-color: var(--color-microsoft-hover);
  border-color: var(--color-microsoft-hover);
}

.btn--microsoft .btn-icon {
  height: 18px;
  width: 18px;
}

.divider-or {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  margin: var(--spacing-xl) 0;
  padding: 0 12%;
  color: var(--color-surface-400);
  font-size: var(--font-size-xxs);
  font-weight: var(--font-weight-light);
  text-transform: lowercase;
}

.divider-or::before,
.divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-surface-200);
}

.btn--outline {
  padding: var(--spacing-sm) var(--spacing-lg);
  background-color: var(--color-surface-50);
  border-color: var(--color-surface-200);
  color: var(--color-surface-700);
  text-transform: none;
  letter-spacing: normal;
  font-weight: var(--font-weight-medium);
}

.btn--outline:hover {
  background-color: var(--color-hover-bg);
  border-color: var(--color-surface-400);
  color: var(--color-surface-800);
}

.expandable-section {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
  margin-top: 0;
}

.expandable-section > * {
  overflow: hidden;
}

.expandable-section.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: var(--spacing-sm);
}

.expandable-section.is-open > * {
  overflow: visible;
}

.btn-icon {
  height: 24px;
  width: 24px;
}

.btn-icon--sm {
  height: 18px;
  width: 18px;
}

.btn-icon--fa {
  font-size: var(--font-size-xs);
}

.back-link {
  text-align: left;
  margin-top: var(--spacing-xl);
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xxxs);
  font-size: var(--font-size-xs);
  color: var(--color-surface-600);
  text-decoration: none;
}

.back-link a:hover {
  color: var(--color-primary-200);
  text-decoration: underline;
}

.buttons-wrapper {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-xxs);
}

.buttons-wrapper .btn {
  flex: 1;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .buttons-wrapper {
    flex-direction: column;
  }

  .buttons-wrapper .btn {
    flex: 0 0 auto;
    width: 100%;
    min-height: 4.6rem;
  }
}

/* ============================================================================
   Language selector
   ========================================================================== */

.lang-wrapper {
  z-index: 10;
  position: relative;
  width: 100%;
  max-width: 610px;
  margin-top: var(--spacing-lg);
  display: flex;
  justify-content: flex-end;
}

.lang-button {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--spacing-xxs);
  padding: var(--spacing-xxs) var(--spacing-xs);
  font-size: var(--font-size-xxs);
  color: var(--color-surface-600);
  transition: all 0.2s ease;
}

.lang-button:hover {
  border-color: var(--color-surface-300);
  color: var(--color-surface-800);
  background: var(--color-surface-50);
}

.lang-list {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: var(--spacing-xxxs);
  width: 200px;
  background: var(--color-surface-50);
  border: 1px solid var(--color-surface-300);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  list-style: none;
  padding: 0;
  z-index: 10;
}

.lang-list li {
  padding: var(--spacing-sm);
  cursor: pointer;
  font-size: var(--font-size-xs);
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.lang-list li a {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  text-decoration: none;
  color: inherit;
  width: 100%;
}

.lang-list li:hover {
  background: var(--color-hover-bg);
}

.lang-list.hidden {
  display: none;
}

.img {
  border: 1px solid var(--color-surface-300);
  border-radius: 2px;
  height: 15px;
  width: 20px;
  object-fit: cover;
  filter: saturate(0.8);
  transition: filter 0.2s ease;
}

.lang-button:hover .img {
  filter: saturate(1);
}

.lang-list .img {
  filter: saturate(1);
}

.img-arrow {
  position: relative;
  height: 14px;
}

/* ============================================================================
   Footers / links
   ========================================================================== */

.page-footer {
  text-align: center;
  margin-top: var(--spacing-xl);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-xxs);
}

.page-footer a,
.page-footer button {
  font-size: var(--font-size-xxs);
  color: var(--color-surface-500);
  text-decoration: none;
}

.page-footer a:hover,
.page-footer button:hover {
  color: var(--color-primary-200);
  text-decoration: underline;
}

.page-footer .footer-primary {
  color: var(--color-primary-200);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: var(--font-size-xxs);
}

.page-footer .footer-separator {
  display: inline-block;
  margin: 0 var(--spacing-xs);
  color: var(--color-surface-400);
  font-size: var(--font-size-xxs);
}

.recovery-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xl);
}

.recovery-links a,
.recovery-links button {
  font-size: var(--font-size-xxs);
  color: var(--color-surface-600);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.recovery-links a:hover,
.recovery-links button:hover {
  color: var(--color-primary-200);
}

.link-with-icon {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xxxs);
}

/* ============================================================================
   Section labels
   ========================================================================== */

.section-label {
  display: block;
  font-size: var(--font-size-xxxs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-surface-500);
  margin-bottom: var(--spacing-xxs);
}

.method-card + .section-label,
.method-card + form + .section-label,
.expandable-section + .section-label,
.recovery-codes-grid + .section-label,
.recovery-actions + .section-label {
  margin-top: var(--spacing-md);
}

/* ============================================================================
   MFA method cards — border + shadow lift on hover
   ========================================================================== */

.method-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  cursor: default;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  border: 1px solid transparent;
  margin-bottom: var(--spacing-sm);
}

.method-card--active {
  background-color: var(--color-success-50);
  border-color: var(--color-success-200);
  border-style: solid;
}

.method-card--inactive {
  border-color: var(--color-surface-300);
  border-style: dashed;
}

.method-card--selectable {
  border-color: var(--color-surface-200);
  border-style: solid;
  background-color: var(--color-surface-50);
  cursor: pointer;
}

.method-card--selectable:hover {
  border-color: var(--color-primary-200);
  box-shadow: 0 0 0 1px var(--color-primary-200);
}

.method-card--selectable:hover .method-card__icon {
  background-color: var(--color-primary-50);
  color: var(--color-primary-200);
}

/* ----------------------------------------------------------------------------
   Account-settings hub — cards-by-section ("karty-sekcje")
   Scoped refinement layered on top of .method-card--selectable so the shared
   selectable rules are untouched. Subtle white surface, hairline border,
   softly-tinted rounded icon square, 500-weight title, muted description,
   chevron on the right; gentle border + lift on hover.
   ---------------------------------------------------------------------------- */
.method-card--section {
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  border-color: var(--color-surface-200);
  box-shadow: 0 1px 2px rgba(20, 32, 44, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
              transform 0.18s ease, background-color 0.18s ease;
}

.method-card--section:hover {
  border-color: var(--color-surface-300);
  box-shadow: 0 4px 12px rgba(20, 32, 44, 0.08);
  transform: translateY(-1px);
}

.method-card--section .method-card__icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--color-surface-100);
  color: var(--color-surface-700);
}

.method-card--section:hover .method-card__icon {
  background-color: var(--color-primary-50);
  color: var(--color-primary-200);
}

.method-card--section .method-card__title {
  font-weight: var(--font-weight-medium);
}

.method-card--section .method-card__badge--muted {
  align-self: center;
  font-size: var(--font-size-xs);
  color: var(--color-surface-400);
  opacity: 1;
  transition: color 0.18s ease, transform 0.18s ease;
}

.method-card--section:hover .method-card__badge--muted {
  color: var(--color-primary-200);
  transform: translateX(2px);
}

.method-card .method-card__icon--plain {
  background-color: transparent;
}

.method-card:hover .method-card__icon--plain {
  background-color: transparent;
}

.method-card--dashed {
  border: 1px dashed var(--color-surface-300);
  background-color: var(--color-surface-50);
  cursor: pointer;
}

.method-card--dashed:hover {
  border-color: var(--color-primary-200);
  box-shadow: 0 0 0 1px var(--color-primary-200);
}

.method-card__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  background-color: var(--color-surface-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  color: var(--color-microsoft);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.method-card--active .method-card__icon {
  background-color: var(--color-success-100);
  color: var(--color-success-300);
}

.method-card--active .method-card__icon--plain {
  background-color: transparent;
}

.method-card__icon--success {
  background-color: var(--color-success-100);
  color: var(--color-success-300);
}

.method-card__icon--danger {
  background-color: var(--color-danger-50);
  color: var(--color-danger-300);
}

.method-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.method-card__title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-surface-800);
  line-height: 1.3;
  margin: 0;
}

[data-utc]:not([data-converted]) {
  color: transparent;
}

.method-card__subtitle {
  font-size: var(--font-size-xxs);
  color: var(--color-surface-500);
  line-height: 1.3;
  margin: 0;
}

.method-card__badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-xxs);
  font-weight: var(--font-weight-semibold);
  padding: var(--spacing-xxxs) var(--spacing-xs);
  border-radius: 999px;
  background-color: var(--color-success-100);
  color: var(--color-success-300);
  white-space: nowrap;
}

.method-card__badge--recommended {
  background-color: var(--color-success-100);
  color: var(--color-success-300);
}

.method-card__badge--muted {
  opacity: 0.5;
}

.method-card__action {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-md);
  color: var(--color-surface-400);
}

.method-card__set-default {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--color-surface-300);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: var(--font-size-xxs);
  color: var(--color-surface-600);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.method-card__set-default:hover {
  border-color: var(--color-primary-200);
  color: var(--color-primary-200);
}

/* ============================================================================
   Recovery card + codes grid
   ========================================================================== */

.recovery-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface-100);
  border: 1px solid var(--color-surface-200);
}

.recovery-card__body {
  flex: 1 1 auto;
  min-width: 0;
}

.recovery-card__meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  min-width: 0;
  min-height: 2.8rem;
}

.recovery-card__count {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-xxs);
  color: var(--color-surface-500);
  line-height: 1;
  white-space: nowrap;
}

.recovery-card__action {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--color-surface-500);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  margin-left: auto;
}

.recovery-card__action:hover {
  background-color: var(--color-surface-200);
  color: var(--color-surface-700);
}

.recovery-card__text-action {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-primary-200);
  font-size: var(--font-size-xxs);
  font-weight: var(--font-weight-medium);
  font-family: inherit;
  display: flex;
  align-items: center;
  align-self: center;
  justify-content: center;
  gap: var(--spacing-xxxs);
  height: 2.8rem;
  padding: 0 var(--spacing-xxs);
  border-radius: 6px;
  transition: background-color 0.2s, color 0.2s;
  line-height: 1;
  margin-left: auto;
  white-space: nowrap;
}

.recovery-card__text-action:hover {
  background: var(--color-surface-100);
  color: var(--color-primary-300);
}

@media (max-width: 480px) {
  .recovery-card {
    align-items: flex-start;
  }

  .recovery-card__meta {
    flex-wrap: wrap;
  }

  .recovery-card__text-action {
    margin-left: 0;
  }
}

.recovery-codes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-xxs) var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--color-surface-100);
  border: 1px solid var(--color-surface-200);
  border-radius: var(--radius-sm);
}

.recovery-code {
  font-family: ui-monospace, SFMono-Regular, 'Courier New', monospace;
  font-size: var(--font-size-xs);
  letter-spacing: 0.05em;
  padding: var(--spacing-xxs) var(--spacing-xs);
  color: var(--color-surface-800);
  text-align: center;
}

.recovery-section-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-surface-800);
  margin-bottom: var(--spacing-sm);
  margin-top: 0;
}

.recovery-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.recovery-action {
  display: flex;
  align-items: center;
  gap: var(--spacing-xxxs);
  background: none;
  border: 1px solid var(--color-surface-200);
  border-radius: 6px;
  padding: var(--spacing-xxs) var(--spacing-sm);
  font-size: var(--font-size-xxs);
  color: var(--color-surface-600);
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.recovery-action:hover {
  background: var(--color-surface-100);
  border-color: var(--color-primary-200);
  color: var(--color-primary-200);
}

/* ============================================================================
   Danger zone + method switcher
   ========================================================================== */

.danger-zone {
  border-top: 1px solid var(--color-surface-200);
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  text-align: center;
}

.danger-zone a,
.danger-zone button {
  font-size: var(--font-size-xs);
  color: var(--color-cms-300);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}

.danger-zone a:hover,
.danger-zone button:hover {
  color: var(--color-cms-400);
  text-decoration: underline;
}

.method-switcher {
  border-top: 1px solid var(--color-surface-200);
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
}

.method-switcher__option {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface-100);
  cursor: pointer;
  text-decoration: none;
  color: var(--color-surface-700);
  transition: background-color 0.2s ease, color 0.2s ease;
  margin-bottom: var(--spacing-xxs);
}

.method-switcher__option:hover {
  background-color: var(--color-surface-200);
  color: var(--color-surface-900);
}

/* ============================================================================
   Validation / utilities
   ========================================================================== */

.validation-errors {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: var(--spacing-xs);
  row-gap: var(--spacing-xxxs);
  background: var(--color-danger-50);
  border: 1px solid var(--color-danger-100);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  font-size: var(--font-size-xxs);
  color: var(--color-cms-400);
  line-height: 1.5;
}

.validation-errors::before {
  content: '';
  display: inline-block;
  width: 1.4rem;
  height: 1.4rem;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  margin-top: 0.1rem;
}

.validation-errors p {
  margin: 0;
  grid-column: 2;
}

.text-muted {
  color: var(--color-surface-600);
  font-size: var(--font-size-xs);
  line-height: 1.5;
}

.text-muted--with-icon {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: var(--spacing-xxs);
}

.text-muted--sm {
  color: var(--color-surface-600);
  font-size: var(--font-size-xxs);
  line-height: 1.5;
}

.mb-xs  { margin-bottom: var(--spacing-xs); }
.mb-sm  { margin-bottom: var(--spacing-sm); }
.mb-md  { margin-bottom: var(--spacing-md); }
.mb-lg  { margin-bottom: var(--spacing-lg); }
.mb-xl  { margin-bottom: var(--spacing-xl); }
.mt-xs  { margin-top: var(--spacing-xs); }
.mt-sm  { margin-top: var(--spacing-sm); }
.mt-md  { margin-top: var(--spacing-md); }
.mt-lg  { margin-top: var(--spacing-lg); }

.text-center { text-align: center; }
.text-left   { text-align: left; }

.text-center .title {
  text-align: center;
}

.status-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.status-panel .title {
  margin-bottom: var(--spacing-sm);
  text-align: center;
}

.status-panel .text-muted,
.status-panel .text-muted--sm {
  margin-top: 0;
  max-width: 52ch;
}

.text-mono {
  font-family: ui-monospace, SFMono-Regular, 'Courier New', monospace;
  font-size: var(--font-size-sm);
  color: var(--color-surface-600);
  word-break: break-all;
  user-select: all;
}

.icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--spacing-xxs);
  vertical-align: middle;
}

.text-muted--with-icon .icon-inline {
  margin-right: 0;
}

.qr-code {
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
}

.inline-form {
  display: inline;
}

.unstyled-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.unstyled-button.method-card {
  border: 1px solid transparent;
  padding: var(--spacing-sm) var(--spacing-md);
  width: 100%;
  text-align: left;
}

.unstyled-button.method-card--dashed {
  border: 1px dashed var(--color-surface-300);
  background-color: var(--color-surface-50);
}

.unstyled-button.method-card--dashed:hover {
  border-color: var(--color-primary-200);
  box-shadow: 0 0 0 1px var(--color-primary-200);
}

.typo-wrapper {
  text-align: center;
  font-size: var(--font-size-lg);
}

.status-illustration,
.img-mail-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
  margin-bottom: var(--spacing-xxxl);
}

.status-panel .status-illustration,
.status-panel .img-mail-wrapper {
  margin-bottom: var(--spacing-xl);
}

.status-illustration img,
.img-mail-wrapper img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

/* Success illustration — green circle (mock .success-icon idiom) */
.status-illustration--success {
  height: auto;
}

.error-details {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background-color: var(--color-surface-100);
  border-radius: var(--radius-md);
  text-align: left;
}

.error-details__code {
  color: var(--color-cms-400);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  margin: 0;
}

.error-details__description {
  color: var(--color-surface-600);
  margin-top: var(--spacing-sm);
  font-size: var(--font-size-sm);
}

.error-details__request-id {
  color: var(--color-surface-500);
  margin-top: var(--spacing-md);
  font-size: var(--font-size-xs);
}

.form-instruction {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  color: var(--color-surface-600);
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  line-height: 1.5;
}

/* ============================================================================
   Password complexity rules
   ========================================================================== */

.password-rules {
  list-style: none;
  padding: 0;
  margin: calc(-1 * var(--spacing-md)) 0 var(--spacing-lg) 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xxxs) var(--spacing-lg);
}

.password-rules li {
  font-size: var(--font-size-xxs);
  color: var(--color-surface-400);
  display: flex;
  align-items: center;
  gap: var(--spacing-xxs);
  transition: color 0.2s ease;
}

.password-rules li.is-valid {
  color: var(--color-success-300);
}

.password-rules li.is-invalid {
  color: var(--color-cms-300);
}

.password-rules .rule-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  background: transparent;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c-9.4 9.4-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c-9.4 9.4-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0z'/%3E%3C/svg%3E");
  transition: all 0.2s ease;
}

.password-rules li.is-valid .rule-icon {
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369.2 174.1L227.8 337c-4.6 5.5-11.3 8.6-18.4 8.6h-.5c-7.2 0-14-3.2-18.6-8.8l-48-58.5c-9.8-12-8.1-29.7 3.8-39.6s29.7-8.1 39.6 3.8l29 35.4 122.8-145.9c9.6-11.4 26.6-12.9 38-3.3s12.9 26.6 3.3 38z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369.2 174.1L227.8 337c-4.6 5.5-11.3 8.6-18.4 8.6h-.5c-7.2 0-14-3.2-18.6-8.8l-48-58.5c-9.8-12-8.1-29.7 3.8-39.6s29.7-8.1 39.6 3.8l29 35.4 122.8-145.9c9.6-11.4 26.6-12.9 38-3.3s12.9 26.6 3.3 38z'/%3E%3C/svg%3E");
}

@media (max-width: 480px) {
  .password-rules {
    grid-template-columns: 1fr;
  }
}

.method-card .password-rules {
  margin: 0;
  padding: 0;
}

/* ============================================================================
   Password strength meter ("A: miernik siły")
   4-segment bar above the compact rule hints. Colour escalates with the
   number of satisfied complexity rules; submit validation is unaffected.
   ========================================================================== */

.pw-strength {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xxs);
  margin-bottom: var(--spacing-sm);
}

.pw-strength__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--spacing-sm);
}

.pw-strength__caption {
  font-size: var(--font-size-xxs);
  font-weight: var(--font-weight-medium);
  color: var(--color-surface-500);
}

.pw-strength__track {
  display: flex;
  gap: var(--spacing-xxxs);
}

.pw-strength__seg {
  flex: 1 1 0;
  height: 5px;
  border-radius: 999px;
  background: var(--color-surface-200);
  transition: background-color 0.25s ease, transform 0.25s ease;
  transform-origin: left center;
}

/* Lit segments take the colour of the current level (set on container) */
.pw-strength.is-weak   .pw-strength__seg.is-on { background: var(--color-danger-300); }
.pw-strength.is-fair   .pw-strength__seg.is-on { background: var(--color-warning-100); }
.pw-strength.is-good   .pw-strength__seg.is-on { background: var(--color-success-200); }
.pw-strength.is-strong .pw-strength__seg.is-on { background: var(--color-success-300); }

/* "Ripple & Lift": each newly lit segment gives a brief horizontal expand */
.pw-strength__seg.is-on {
  animation: pw-seg-fill 0.3s ease-out both;
}

@keyframes pw-seg-fill {
  from { transform: scaleX(0.4); }
  to   { transform: scaleX(1); }
}

.pw-strength__label {
  font-size: var(--font-size-xxs);
  font-weight: var(--font-weight-medium);
  color: var(--color-surface-400);
  min-height: 1.4em;
  transition: color 0.25s ease;
}

.pw-strength.is-weak   .pw-strength__label { color: var(--color-danger-300); }
.pw-strength.is-fair   .pw-strength__label { color: var(--color-warning-300); }
.pw-strength.is-good   .pw-strength__label { color: var(--color-success-300); }
.pw-strength.is-strong .pw-strength__label { color: var(--color-success-300); }

/* Compact muted hint list sitting under the meter */
.password-rules--hint {
  margin: 0;
  gap: var(--spacing-xxxs) var(--spacing-md);
}

.password-rules--hint li {
  font-size: var(--font-size-xxxs);
  color: var(--color-surface-400);
}

@media (prefers-reduced-motion: reduce) {
  .pw-strength__seg.is-on {
    animation: none;
  }
}

/* ============================================================================
   Code input boxes (TOTP / email / recovery)
   ========================================================================== */

.code-input-group {
  --code-box-size: 4.8rem;
  --code-box-gap: var(--spacing-xs);
  display: flex;
  gap: var(--code-box-gap);
  align-items: center;
  flex-wrap: nowrap;
  margin-bottom: var(--spacing-xxl);
  width: 100%;
  max-width: 100%;
}

/* 3 + 3 split grouping for 6-digit codes */
.code-input-group--split {
  justify-content: center;
}

.code-separator {
  color: var(--color-surface-300);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-light);
  flex: 0 0 auto;
  padding: 0;
}

.code-box {
  flex: 1 1 0;
  min-width: 0;
  width: calc((100% - (5 * var(--code-box-gap))) / 6);
  height: var(--code-box-size);
  text-align: center;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  font-family: ui-monospace, SFMono-Regular, 'Courier New', monospace;
  letter-spacing: 1px;
  border: 1px solid var(--color-surface-200);
  border-radius: var(--radius-sm);
  background: var(--color-surface-50);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  caret-color: var(--color-primary-200);
}

.code-box:focus {
  border-color: var(--color-surface-900);
  box-shadow: 0 0 0 1px var(--color-surface-900);
}

@media (max-width: 480px) {
  .code-input-group {
    --code-box-size: 4rem;
    --code-box-gap: var(--spacing-xxs);
  }

  .code-separator {
    font-size: var(--font-size-md);
    padding: 0;
  }

  .code-box {
    font-size: var(--font-size-md);
  }
}

@media (max-width: 360px) {
  .code-input-group {
    --code-box-size: 3.6rem;
    --code-box-gap: 0.6rem;
  }
}

/* ============================================================================
   MFA enrollment wizard step indicator
   ========================================================================== */

.mfa-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xxs);
  margin-bottom: var(--spacing-xl);
}

.mfa-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xxxs);
  flex: 0 0 auto;
}

.mfa-step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  border: 2px solid var(--color-surface-300);
  background: var(--color-surface-50);
  color: var(--color-surface-400);
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.mfa-step__label {
  font-size: var(--font-size-xxs);
  color: var(--color-surface-400);
  white-space: nowrap;
  transition: color 0.3s ease;
}

.mfa-step.is-idle .mfa-step__num {
  border-color: var(--color-surface-300);
  background: var(--color-surface-50);
  color: var(--color-surface-400);
}

.mfa-step.is-active .mfa-step__num {
  border-color: var(--color-primary-200);
  background: var(--color-primary-200);
  color: var(--color-surface-50);
  transform: scale(1.05);
  animation: mfa-step-pop 0.35s ease-out both;
}

.mfa-step.is-active .mfa-step__label {
  color: var(--color-surface-800);
  font-weight: var(--font-weight-semibold);
}

.mfa-step.is-done .mfa-step__num {
  border-color: var(--color-success-300);
  background: var(--color-success-300);
  color: var(--color-surface-50);
}

.mfa-step.is-done .mfa-step__label {
  color: var(--color-surface-700);
}

.mfa-step__bar {
  flex: 1 1 auto;
  min-width: 1.6rem;
  max-width: 6rem;
  height: 2px;
  margin-bottom: 2rem;
  border-radius: 1px;
  background: var(--color-surface-300);
  transition: background-color 0.3s ease;
}

.mfa-step__bar.is-done {
  background: var(--color-success-300);
}

@keyframes mfa-step-pop {
  0% {
    transform: scale(0.7);
    opacity: 0.4;
  }
  60% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@media (max-width: 600px) {
  .mfa-step__label {
    font-size: var(--font-size-xxxs);
  }

  .mfa-step__num {
    width: 2.8rem;
    height: 2.8rem;
  }

  .mfa-step__bar {
    min-width: 0.8rem;
  }
}

/* ============================================================================
   QR panel + secret key
   ========================================================================== */

.qr-panel {
  background: var(--color-surface-50);
  border: 1px solid var(--color-surface-200);
  border-radius: var(--radius-sm);
  padding: var(--spacing-xl);
  display: flex;
  justify-content: center;
}

.qr-frame {
  position: relative;
  display: flex;
}

.qr-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20%;
  height: auto;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 0.15rem;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.secret-key {
  font-family: ui-monospace, SFMono-Regular, 'Courier New', monospace;
  font-size: var(--font-size-xs);
  letter-spacing: 0.1em;
  background: var(--color-surface-100);
  border: 1px dashed var(--color-surface-300);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  word-break: break-all;
}

.secret-key code {
  flex: 1;
  font-family: inherit;
}

.secret-key__copy {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-surface-400);
  font-size: var(--font-size-sm);
  padding: var(--spacing-xxxs);
  transition: color 0.2s;
  flex-shrink: 0;
}

.secret-key__copy:hover {
  color: var(--color-primary-200);
}

/* Inline field error */

.input-container.error {
  margin-bottom: 0;
}

.field-error {
  font-size: var(--font-size-xxs);
  color: var(--color-cms-400);
  margin: 4px 0 var(--spacing-lg);
  padding: 0;
}

/* ============================================================================
   Info box
   ========================================================================== */

.info-box {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--radius-sm);
  border: 1px solid;
  margin-bottom: var(--spacing-md);
  font-size: var(--font-size-xs);
  line-height: 1.5;
  cursor: default;
}

.info-box i {
  flex-shrink: 0;
  font-size: var(--font-size-sm);
}

.info-box p {
  margin: 0;
}

.info-box--success {
  background-color: var(--color-success-50);
  border-color: var(--color-success-200);
  color: var(--color-surface-700);
}

.info-box--success i {
  color: var(--color-success-300);
}

.info-box--warning {
  background-color: var(--color-warning-50);
  border-color: var(--color-warning-100);
  color: var(--color-warning-300);
}

.info-box--warning i {
  color: var(--color-warning-300);
}

.info-box--info {
  background-color: var(--color-surface-100);
  border-color: var(--color-surface-300);
  color: var(--color-surface-700);
}

.info-box--info i {
  color: var(--color-primary-200);
}

.info-box--error {
  background-color: var(--color-danger-50);
  border-color: var(--color-danger-100);
  color: var(--color-cms-400);
}

.info-box--error i {
  color: var(--color-danger-300);
}

/* ============================================================================
   Login history
   ========================================================================== */

/* Filters — segmented control */
.filter-tabs {
  display: inline-flex;
  gap: 2px;
  margin-bottom: var(--spacing-md);
  padding: 3px;
  background: var(--color-surface-100);
  border-radius: 10px;
}

.filter-tab {
  border: none;
  background: transparent;
  color: var(--color-surface-600);
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: 7px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.filter-tab:hover {
  color: var(--color-surface-900);
  text-decoration: none;
}

.filter-tab--active,
.filter-tab--active:hover {
  background-color: var(--color-surface-900);
  color: #fff;
  text-decoration: none;
}

.login-history-list {
  padding-right: 2px;
  padding-bottom: var(--spacing-sm);
  transition: max-height 0.3s ease;
}

.login-history-list--scrollable {
  overflow-y: auto;
}

.login-history-list--scrollable::-webkit-scrollbar {
  width: 4px;
}

.login-history-list--scrollable::-webkit-scrollbar-thumb {
  background: var(--color-surface-300);
  border-radius: 4px;
}

/* Login history — timeline (status dot on a connecting line) */
.lh-entry {
  position: relative;
  padding-left: 26px;
  padding-bottom: var(--spacing-md);
}

.lh-entry::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--color-surface-200);
}

.lh-entry:last-child::before {
  display: none;
}

.lh-dot {
  position: absolute;
  left: 0;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.lh-entry--success .lh-dot {
  background: var(--color-success-300);
  box-shadow: 0 0 0 3px var(--color-success-50);
}

.lh-entry--danger .lh-dot {
  background: var(--color-danger-300);
  box-shadow: 0 0 0 3px var(--color-danger-50);
}

.lh-entry__date {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-surface-800);
  line-height: 1.4;
}

.lh-entry__meta {
  font-size: var(--font-size-xxs);
  color: var(--color-surface-500);
  line-height: 1.4;
  margin-top: 1px;
}

.lh-entry__fail {
  color: var(--color-danger-300);
}

/* Stagger animation for new history items — fade + slide (Ripple & Lift idiom) */
.login-history-item-enter {
  opacity: 0;
  transform: translateY(8px);
}

.login-history-item-enter.login-history-item-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}

.method-card__badge--success {
  background-color: var(--color-success-100);
  color: var(--color-success-300);
}

.method-card__badge--danger {
  background-color: var(--color-danger-50);
  color: var(--color-danger-300);
  white-space: nowrap;
}

/* Narrow mobile — condense columns gracefully */
@media (max-width: 420px) {
  .lh-head,
  .lh-row {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--spacing-xs);
  }

  .lh-head span:nth-child(2),
  .lh-where {
    grid-column: 1 / 2;
    grid-row: 2;
  }

  .lh-head span:last-child,
  .lh-status {
    grid-row: 1;
  }

  .lh-when {
    grid-column: 1 / 2;
    grid-row: 1;
  }
}

.text-success {
  color: var(--color-success-300);
}

.text-danger {
  color: var(--color-danger-300);
}

.unstyled-link {
  color: inherit;
  text-decoration: none;
}

.unstyled-link:hover {
  text-decoration: none;
}

/* Passkey register area (Verify page) */

.passkey-register-area {
  text-align: center;
  padding: var(--spacing-md);
  border: 1px dashed var(--color-surface-300);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface-50);
}

/* Inline status indicator with icon */

.status-inline {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
}

.status-inline--loading {
  background-color: var(--color-surface-100);
  color: var(--color-surface-600);
}

.status-inline--success {
  background-color: var(--color-success-50);
  color: var(--color-success-300);
  border: 1px solid var(--color-success-200);
}

.status-inline--error {
  background-color: var(--color-danger-50);
  color: var(--color-danger-300);
  border: 1px solid var(--color-danger-100);
}

/* ============================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .card-container,
  .input--invalid,
  .login-history-item-enter,
  .login-history-item-enter.login-history-item-visible,
  .mfa-step.is-active .mfa-step__num {
    animation: none;
    transition: none;
  }

  .mfa-step.is-active .mfa-step__num {
    transform: none;
  }

  .method-card--section,
  .method-card--section:hover,
  .method-card--section:hover .method-card__badge--muted {
    transform: none;
  }

  .btn {
    transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
  }
}
