/* ============================================================
   RaTurka Account Center — Global Styles
   Dark, enterprise-grade. Matches raturka.com.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:ital,wght@0,400..900;1,400..900&display=swap');

/* --- Design Tokens --- */
:root {
  --bg:            #0E0E0F;
  --bg-grad-top:   #131316;
  --surface:       #141416;
  --surface-2:     #1A1A1D;
  --surface-3:     #202024;
  --sidebar:       #0B0B0C;
  --hover:         #1C1C20;

  --border:        #232326;
  --border-soft:   #1A1A1C;
  --border-strong: #303035;

  --text:          #FAFAFA;
  --text-2:        #C5C9CE;
  --muted:         #8C9298;
  --dim:           #5E646A;

  --accent:        #30C5D8;
  --accent-ink:    #062a30;
  --accent-soft:   rgba(48,197,216,0.12);
  --accent-line:   rgba(48,197,216,0.32);
  --emerald:       #10B981;
  --emerald-soft:  rgba(16,185,129,0.12);
  --violet:        #8B7CF6;
  --amber:         #E2B340;
  --amber-soft:    rgba(226,179,64,0.12);
  --danger:        #F26770;
  --danger-soft:   rgba(242,103,112,0.12);

  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --radius-pill:   999px;

  --row-h:         44px;
  --pad:           24px;
  --gap:           16px;

  --font-sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shadow-1:   0 1px 2px rgba(0,0,0,0.4);
  --shadow-2:   0 8px 30px rgba(0,0,0,0.5);
  --shadow-pop: 0 20px 60px rgba(0,0,0,0.6);

  /* backward-compat aliases for existing inline styles */
  --color-bg:           var(--bg);
  --color-surface:      var(--surface-2);
  --color-border:       var(--border);
  --color-text:         var(--text);
  --color-text-muted:   var(--muted);
  --color-primary:      var(--accent);
  --color-primary-fg:   var(--accent-ink);
  --color-success:      var(--emerald);
  --color-success-bg:   var(--emerald-soft);
  --color-error:        var(--danger);
  --color-error-bg:     var(--danger-soft);
  --color-sidebar-bg:   var(--sidebar);
  --color-sidebar-fg:   var(--muted);
  --color-sidebar-active: var(--text);
  --shadow-card:        var(--shadow-1);
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
::selection { background: var(--accent-soft); color: var(--text); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #2a2a2e transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #2a2a2e; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #3a3a40; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* helpers */
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--muted); }
.text-dim { color: var(--dim); }
.text-accent { color: var(--accent); }
.text-emerald { color: var(--emerald); }
.text-danger { color: var(--danger); }
.text-amber { color: var(--amber); }

/* animations */
@keyframes ra-rise    { from { transform: translateY(10px); } to { transform: none; } }
@keyframes ra-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ra-fade    { from { opacity: 0; } to { opacity: 1; } }
@keyframes ra-spin    { to { transform: rotate(360deg); } }
@keyframes ra-sheen   { 0% { transform: translateX(-100%) skewX(-20deg); } 100% { transform: translateX(350%) skewX(-20deg); } }

/* ============================================================
   AUTH LAYOUT — split brand / form grid
   ============================================================ */
.ra-auth-grid {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}

/* Brand panel */
.ra-auth-brand {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: radial-gradient(120% 80% at 20% 0%, #14181b 0%, #0b0b0c 55%);
  display: flex;
  flex-direction: column;
  padding: 44px 48px;
}
.ra-auth-brand-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(80% 80% at 30% 20%, #000, transparent);
  mask-image: radial-gradient(80% 80% at 30% 20%, #000, transparent);
}
.ra-auth-brand-glow {
  position: absolute;
  top: -120px; right: -120px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(48,197,216,0.16), transparent 65%);
  filter: blur(10px);
  pointer-events: none;
}

/* Brand logo row */
.ra-auth-brand-logo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ra-auth-brand-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.ra-auth-brand-logo-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ra-auth-brand-logo-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--dim);
  text-transform: uppercase;
  margin-top: 2px;
}

/* Brand middle content */
.ra-auth-brand-content {
  position: relative;
  margin-top: auto;
  margin-bottom: auto;
}
.ra-auth-brand-headline {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
  max-width: 460px;
}
.ra-auth-brand-headline .grad {
  background: linear-gradient(100deg, #3ad0e0, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ra-auth-brand-desc {
  font-size: 15px;
  color: var(--muted);
  max-width: 430px;
  margin-top: 16px;
  line-height: 1.6;
}
.ra-auth-brand-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 32px;
  max-width: 430px;
}
.ra-auth-brand-feature {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}
.ra-auth-brand-feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ra-auth-brand-feature-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.ra-auth-brand-feature-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.5;
}

/* Products grid */
.ra-auth-products {
  display: flex; flex-direction: column; gap: 14px;
  margin-top: 28px; max-width: 430px;
}
.ra-auth-product {
  display: flex; align-items: flex-start; gap: 14px;
}
.ra-auth-product-logo {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  object-fit: contain;
}
.ra-auth-product-name {
  font-size: 14px; font-weight: 700; letter-spacing: -0.01em;
}
.ra-auth-product-desc {
  font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.45;
}

/* Auth lang bar */
.ra-auth-lang-bar {
  position: absolute; top: 16px; right: 20px; z-index: 10;
}
.ra-auth-lang-btn {
  display: flex; align-items: center; gap: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 10px; height: 32px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  color: var(--muted); cursor: pointer; transition: background 0.12s;
  font-family: var(--font-mono);
}
.ra-auth-lang-btn:hover { background: var(--hover); color: var(--text); }

/* Brand stats */
.ra-auth-brand-stats {
  position: relative;
  display: flex;
  gap: 30px;
}
.ra-auth-brand-stat-num {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
}
.ra-auth-brand-stat-label {
  font-size: 11.5px;
  color: var(--dim);
  margin-top: 2px;
}

/* Form panel */
.ra-auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
  position: relative;
}
.ra-auth-form-inner {
  width: 100%;
  max-width: 392px;
  animation: ra-rise 0.42s cubic-bezier(0.22,1,0.36,1);
}

/* Mobile-only logo */
.ra-auth-logo-sm {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  justify-content: center;
}
.ra-auth-logo-sm img { width: 28px; height: 28px; object-fit: contain; }
.ra-auth-logo-sm-name { font-size: 17px; font-weight: 700; }

/* Auth form heading */
.ra-auth-head { margin-bottom: 26px; text-align: center; }
.ra-auth-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.ra-auth-head p  { font-size: 14.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* ============================================================
   PASSKEY BUTTON
   ============================================================ */
.ra-passkey-btn {
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 8px;
  cursor: pointer;
  background: linear-gradient(100deg, #34cfe0, #16b88f);
  border: none;
  border-radius: var(--radius);
  color: #04222a;
  position: relative;
  overflow: hidden;
  transition: filter 0.15s, transform 0.12s, box-shadow 0.2s;
  box-shadow: 0 10px 30px -10px rgba(48,197,216,0.6), inset 0 1px 0 rgba(255,255,255,0.25);
}
.ra-passkey-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: skewX(-20deg);
  animation: ra-sheen 3.5s ease-in-out 1s infinite;
}
.ra-passkey-btn:hover  { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 14px 36px -8px rgba(48,197,216,0.65), inset 0 1px 0 rgba(255,255,255,0.25); }
.ra-passkey-btn:active { transform: translateY(0); filter: brightness(0.97); }
.ra-passkey-btn:disabled { opacity: 0.75; cursor: default; }

.ra-passkey-btn-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: rgba(4,34,40,0.16);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ra-passkey-btn-text { flex: 1; text-align: left; line-height: 1.15; position: relative; }
.ra-passkey-btn-label { display: block; font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.ra-passkey-btn-sub   { display: block; font-size: 12px; font-weight: 500; opacity: 0.7; margin-top: 1px; }
.ra-passkey-btn-arrow {
  width: 30px; height: 30px;
  border-radius: 99px;
  background: rgba(4,34,40,0.14);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-right: 6px;
}
.ra-passkey-helper {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 12.5px; color: var(--muted);
  margin-top: 10px;
}
.ra-passkey-helper svg { color: var(--emerald); flex-shrink: 0; }

/* Auth divider */
.ra-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  font-size: 12px; color: var(--dim);
}
.ra-divider::before, .ra-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group { margin-bottom: 16px; }

.form-group > label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-group > label a { font-size: 12.5px; color: var(--accent); font-weight: 500; cursor: pointer; }

.input-wrapper { position: relative; }
.input-icon-left {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); display: flex; align-items: center; pointer-events: none;
  transition: color 0.15s;
}
.input-wrapper:focus-within .input-icon-left { color: var(--accent); }
.input-icon-right {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); display: flex; align-items: center;
  background: none; border: none; padding: 4px; cursor: pointer;
  transition: color 0.12s;
}
.input-icon-right:hover { color: var(--text); }

/* Suppress browser-native autofill/contact decoration buttons */
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
  visibility: hidden; display: none !important;
  pointer-events: none; width: 0; height: 0;
}

.ra-input {
  width: 100%;
  height: 40px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.ra-input.has-icon-left  { padding-left:  42px; }
.ra-input.has-icon-right { padding-right: 42px; }
.ra-input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.ra-input::placeholder { color: var(--dim); }
textarea.ra-input { height: auto; min-height: 96px; padding: 12px; line-height: 1.6; resize: vertical; }
select.ra-input  { -webkit-appearance: none; appearance: none; padding-right: 34px; }

/* prevent white flash on autofill */
input.ra-input:-webkit-autofill,
input.ra-input:-webkit-autofill:hover,
input.ra-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset !important;
  box-shadow: 0 0 0 1000px var(--surface-2) inset !important;
  caret-color: var(--text);
  border-color: var(--border);
  background-image: none !important;
}

.form-help  { font-size: 12px; color: var(--accent); text-align: right; display: block; margin-top: 4px; }
.form-hint  { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 16px; height: 40px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s, transform 0.1s, color 0.14s;
  font-family: var(--font-sans); line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { flex-shrink: 0; }
.btn:hover  { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled,
.btn[disabled] { opacity: 0.4; cursor: default; pointer-events: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn--primary {
  background: rgba(48,197,216,0.10);
  color: var(--accent);
  border-color: rgba(48,197,216,0.30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.btn--primary:hover {
  background: rgba(48,197,216,0.18);
  border-color: rgba(48,197,216,0.52);
  color: #62d9e9;
  box-shadow: 0 0 0 3px rgba(48,197,216,0.07), 0 4px 18px rgba(48,197,216,0.18);
  transform: translateY(-1px);
}
.btn--primary:active {
  transform: scale(0.97) translateY(0);
  background: rgba(48,197,216,0.13);
  box-shadow: 0 0 0 2px rgba(48,197,216,0.12);
}

.btn--outline {
  background: var(--surface-2); color: var(--text-2); border-color: var(--border);
}
.btn--outline:hover {
  background: var(--hover); color: var(--text); border-color: var(--border-strong);
}

.btn--danger {
  background: var(--danger-soft); color: var(--danger); border-color: rgba(242,103,112,0.22);
}
.btn--danger:hover {
  background: rgba(242,103,112,0.2); border-color: rgba(242,103,112,0.45);
}

.btn--ghost  { background: transparent; color: var(--muted); border-color: transparent; }
.btn--ghost:hover { background: var(--hover); color: var(--text); }

.btn--emerald {
  background: rgba(16,185,129,0.10);
  color: var(--emerald);
  border-color: rgba(16,185,129,0.30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.btn--emerald:hover {
  background: rgba(16,185,129,0.18);
  border-color: rgba(16,185,129,0.50);
  color: #34d39a;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.07), 0 4px 18px rgba(16,185,129,0.18);
  transform: translateY(-1px);
}

.btn--full { width: 100%; }
.btn--lg   { height: 48px; font-size: 15px; padding: 0 22px; border-radius: var(--radius); letter-spacing: -0.015em; }
.btn--sm   { height: 32px; font-size: 12.5px; padding: 0 12px; }
.btn--xs   { height: 26px; font-size: 11.5px; padding: 0 10px; border-radius: 6px; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 16px;
  border: 1px solid;
}
.alert--error   { background: var(--danger-soft);  color: var(--danger);  border-color: rgba(242,103,112,0.3); }
.alert--success { background: var(--emerald-soft); color: var(--emerald); border-color: rgba(16,185,129,0.3); }
.alert--warning { background: var(--amber-soft);   color: var(--amber);   border-color: rgba(226,179,64,0.3); }

/* ============================================================
   AUTH HELPERS
   ============================================================ */
.ra-auth-consent {
  text-align: center; font-size: 12px; color: var(--dim);
  margin-top: 16px; line-height: 1.55;
}
.ra-auth-consent a { color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.ra-auth-switch { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 18px; }
.ra-auth-switch a { color: var(--accent); cursor: pointer; font-weight: 600; }

.ra-2fa-badge { font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 5px; justify-content: flex-end; }
.ra-2fa-badge svg { color: var(--emerald); }

/* OTP input grid */
.ra-otp-grid { display: flex; gap: 10px; justify-content: center; }
.ra-otp-input {
  width: 48px; height: 56px;
  text-align: center; font-size: 22px; font-weight: 600;
  font-family: var(--font-mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  caret-color: var(--accent);
}
.ra-otp-input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Password requirements */
.ra-pw-requirements {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px;
  font-size: 12.5px; color: var(--muted);
  display: flex; flex-direction: column; gap: 6px;
}
.ra-pw-req-item { display: flex; align-items: center; gap: 8px; }
.ra-pw-req-item svg { color: var(--emerald); flex-shrink: 0; }

/* Verify icon box */
.ra-verify-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.ra-verify-icon--accent  { background: var(--accent-soft);  color: var(--accent); }
.ra-verify-icon--emerald { background: var(--emerald-soft); color: var(--emerald); }

/* ============================================================
   APP SHELL
   ============================================================ */
.ra-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.ra-sidebar {
  width: 264px; flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1);
  position: relative;
}
.ra-sidebar::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}
.ra-sidebar > * { position: relative; z-index: 1; }
.ra-sidebar-brand {
  height: 64px; flex-shrink: 0;
  display: flex; align-items: center; gap: 11px; padding: 0 18px;
  position: relative;
}
.ra-sidebar-brand::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-line) 40%, var(--accent-line) 60%, transparent 100%);
}
.ra-sidebar-brand img {
  width: 28px; height: 28px; object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(48,197,216,0.28));
}
.ra-sidebar-brand-names { line-height: 1.05; }
.ra-sidebar-brand-name  { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.ra-sidebar-brand-sub   { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }
.ra-sidebar-close {
  display: none; margin-left: auto;
  background: none; border: none; color: var(--muted); padding: 4px; cursor: pointer;
  align-items: center; justify-content: center;
}

.ra-sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.ra-sidebar-group { margin-bottom: 4px; }
.ra-sidebar-group-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--dim); font-weight: 500;
  padding: 14px 11px 7px; display: block;
}
.ra-nav-items { display: flex; flex-direction: column; gap: 2px; }

.ra-nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; height: var(--row-h); padding: 0 11px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--muted);
  background: transparent; border: 1px solid transparent;
  cursor: pointer; text-align: left; position: relative;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  text-decoration: none;
}
.ra-nav-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.ra-nav-item.active {
  background: linear-gradient(90deg, rgba(48,197,216,0.09) 0%, rgba(48,197,216,0.02) 100%);
  border-color: rgba(48,197,216,0.18);
  color: var(--text); font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.ra-nav-item.active::before {
  content: '';
  position: absolute; left: -1px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent), 0 0 4px var(--accent);
}
.ra-nav-icon  { color: var(--dim); display: flex; align-items: center; flex-shrink: 0; }
.ra-nav-label { flex: 1; }
.ra-nav-item.active .ra-nav-icon { color: var(--accent); }

.ra-nav-badge {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--surface-3); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.ra-nav-item.active .ra-nav-badge { background: var(--accent); color: #04222a; }


/* Content wrapper */
.ra-content-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Topbar */
.ra-topbar {
  height: 64px; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(11,11,12,0.72);
  backdrop-filter: blur(16px) saturate(1.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.8);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; z-index: 40;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03), 0 4px 24px rgba(0,0,0,0.35);
}
.ra-topbar-menu-btn {
  display: none;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); cursor: pointer;
  width: 38px; height: 38px; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ra-topbar-title {
  font-size: 17px; font-weight: 600; letter-spacing: -0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ra-topbar-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
  height: 36px; width: 220px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--dim); padding: 0 12px; font-size: 13px;
  font-family: var(--font-sans);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  text-decoration: none; cursor: pointer;
  flex-shrink: 0;
}
.ra-topbar-search:hover {
  border-color: var(--border-strong);
  background: var(--hover);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  color: var(--text-2);
}
.ra-topbar-search-kbd {
  margin-left: auto; font-family: var(--font-mono); font-size: 10px;
  padding: 1px 6px; border: 1px solid var(--border-soft); border-radius: 5px;
  color: var(--dim); background: rgba(0,0,0,0.15); white-space: nowrap; flex-shrink: 0;
}
.ra-topbar-btn {
  position: relative;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  text-decoration: none; transition: background 0.15s; flex-shrink: 0;
}
.ra-topbar-btn:hover { background: var(--hover); color: var(--text); text-decoration: none; }

/* Mobile icon-only search trigger (hidden on desktop) */
.ra-topbar-search-btn {
  display: none;
  width: 38px; height: 38px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.ra-topbar-search-btn:hover { background: var(--hover); color: var(--text); }

.ra-topbar-notif-dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px; border-radius: 99px;
  background: var(--accent); box-shadow: 0 0 6px var(--accent);
  border: 1.5px solid var(--bg);
}
.ra-topbar-user {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 9px 4px 5px; height: 38px; color: var(--text);
  text-decoration: none; transition: background 0.15s; flex-shrink: 0;
  position: relative;
}
.ra-topbar-user:hover { background: var(--hover); text-decoration: none; }
.ra-avatar {
  width: 28px; height: 28px; border-radius: 99px;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; text-transform: uppercase;
}
.ra-avatar--photo {
  object-fit: cover;
  background: none;
  padding: 0;
}
.ra-topbar-user-name {
  font-size: 13.5px; font-weight: 600; max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text);
}

/* Dropdown */
.ra-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  width: 210px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); padding: 6px; z-index: 100;
}
.ra-topbar-user.open .ra-dropdown,
.ra-lang-picker.open .ra-dropdown { display: block; }

.ra-dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: var(--radius-sm); font-size: 13.5px; color: var(--text-2);
  cursor: pointer; text-decoration: none; transition: background 0.12s;
  background: none; border: none; width: 100%; font-family: var(--font-sans);
  font-weight: 400; text-align: left;
}
.ra-dropdown-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.ra-dropdown-item--active { color: var(--accent) !important; font-weight: 600; }
.ra-dropdown-item--danger { color: var(--danger); }
.ra-dropdown-item--danger:hover { background: var(--danger-soft); }
.ra-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Language picker */
.ra-lang-picker { position: relative; flex-shrink: 0; }
.ra-lang-btn { display: flex; align-items: center; gap: 5px; cursor: pointer; padding-left: 10px; padding-right: 10px; width: auto; }
.ra-lang-dropdown { width: 80px; min-width: 80px; }

/* Main content */
.ra-main { flex: 1; overflow-y: auto; padding: var(--pad); }

/* Mobile overlay */
.ra-overlay {
  display: none; position: fixed; inset: 0; z-index: 49;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
}
.ra-overlay.open { display: block; }

/* ============================================================
   BADGES (inline)
   ============================================================ */
.ra-badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 99px; font-size: 11px; font-weight: 600;
  font-family: var(--font-mono); letter-spacing: 0.03em; border: 1px solid;
}
.ra-badge--cyan    { background: var(--accent-soft);  color: var(--accent);  border-color: var(--accent-line); }
.ra-badge--emerald { background: var(--emerald-soft); color: var(--emerald); border-color: rgba(16,185,129,0.3); }
.ra-badge--amber   { background: var(--amber-soft);   color: var(--amber);   border-color: rgba(226,179,64,0.3); }
.ra-badge--danger  { background: var(--danger-soft);  color: var(--danger);  border-color: rgba(242,103,112,0.3); }
.ra-badge--dim     { background: var(--surface-3);    color: var(--muted);   border-color: var(--border); }

/* ============================================================
   APP CARDS & LAYOUT
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), var(--shadow-1);
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(48,197,216,0.18) 50%, transparent 100%);
  pointer-events: none;
}
.card-title {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim);
  margin-bottom: 16px;
}
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }

/* Card inputs */
.card .form-group input,
.card .form-group textarea,
.card .form-group select {
  width: 100%; height: 40px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 12px; font-size: 14px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
/* Icon-offset overrides — must come AFTER the general padding rule above */
.card .form-group input.has-icon-left  { padding-left:  42px; }
.card .form-group input.has-icon-right { padding-right: 42px; }
.card .form-group input:focus,
.card .form-group textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.card .form-group input::placeholder { color: var(--dim); }
.card .form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.card .form-group textarea { height: auto; min-height: 80px; padding: 10px 12px; }
.card hr.divider,
hr.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.card .form-actions { margin-top: 20px; }
.card .form-hint { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }

/* Dashboard grid */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

/* Info list */
.info-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; }
.info-list dt { color: var(--muted); }
.info-list dd { color: var(--text-2); }

/* Empty state */
.empty-state { color: var(--muted); font-size: 13.5px; padding: 8px 0; }

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  padding: 8px 12px; text-align: left;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--dim); font-family: var(--font-mono); border-bottom: 1px solid var(--border);
}
.table td { padding: 12px; border-bottom: 1px solid var(--border-soft); color: var(--text-2); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--hover); }

/* Status badges (table) */
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; font-family: var(--font-mono); }
.badge--paid    { background: var(--emerald-soft); color: var(--emerald); }
.badge--pending { background: var(--amber-soft);   color: var(--amber); }
.badge--failed  { background: var(--danger-soft);  color: var(--danger); }

/* ============================================================
   MFA SPECIFIC
   ============================================================ */
.ra-backup-codes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px;
  font-family: var(--font-mono);
}
.ra-backup-code { text-align: center; letter-spacing: 2px; font-size: 14px; color: var(--text-2); }

.ra-qr-container { text-align: center; margin: 20px 0; }

/* TOTP manual key box */
.ra-totp-key-box {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 20px;
}
.ra-totp-key-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.ra-totp-key-label {
  font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em;
}
.ra-totp-key-groups {
  display: flex; flex-wrap: wrap; gap: 4px 8px;
}
.ra-totp-key-groups span {
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  color: var(--text); letter-spacing: 1.5px; white-space: nowrap;
}
.ra-totp-copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; cursor: pointer;
  font-size: 12px; font-weight: 500; font-family: var(--font-sans);
  color: var(--muted); transition: color 0.14s, border-color 0.14s, background 0.14s;
}
.ra-totp-copy-btn:hover { color: var(--text); border-color: var(--border-strong); }
.ra-totp-copy-btn--ok { color: var(--emerald) !important; border-color: rgba(16,185,129,0.4) !important; }
#qrcode { display: inline-block; padding: 12px; background: white; border-radius: var(--radius-sm); }

/* Session list items */
.ra-session-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.ra-session-item:last-child { border-bottom: none; }
.ra-session-name { font-weight: 600; font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.ra-session-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ============================================================
   SEARCH MODAL (COMMAND PALETTE)
   ============================================================ */
#ra-cmd-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease;
}
#ra-cmd-overlay.ra-cmd-open {
  opacity: 1; pointer-events: auto;
}
.ra-cmd-dialog {
  width: min(600px, 92vw);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
  overflow: hidden;
  transform: scale(0.95) translateY(-8px);
  transition: transform 0.22s cubic-bezier(0.22,1,0.36,1);
}
#ra-cmd-overlay.ra-cmd-open .ra-cmd-dialog {
  transform: scale(1) translateY(0);
}
.ra-cmd-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.ra-cmd-input-icon { flex-shrink: 0; display: flex; align-items: center; color: var(--dim); }
.ra-cmd-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 16px; color: var(--text);
  font-family: var(--font-sans);
  caret-color: var(--accent);
}
.ra-cmd-input::placeholder { color: var(--dim); }
.ra-cmd-esc-hint {
  font-size: 11px; color: var(--dim); font-family: var(--font-mono);
  border: 1px solid var(--border); padding: 2px 6px; border-radius: 5px;
  background: none; flex-shrink: 0;
}
.ra-cmd-list {
  list-style: none; margin: 0; padding: 8px;
  max-height: 360px; overflow-y: auto;
}
.ra-cmd-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background 0.12s, color 0.12s;
  border: 1px solid transparent;
}
.ra-cmd-item--active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.ra-cmd-item-icon {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--surface-3); border: 1px solid var(--border);
  color: var(--dim);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.ra-cmd-item--active .ra-cmd-item-icon {
  background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent-line);
}
.ra-cmd-item-label {
  font-size: 14px; color: var(--text-2); flex: 1;
  transition: color 0.12s;
}
.ra-cmd-item--active .ra-cmd-item-label { color: var(--text); }
.ra-cmd-item-arrow { display: flex; align-items: center; color: var(--dim); flex-shrink: 0; transition: color 0.12s; }
.ra-cmd-item--active .ra-cmd-item-arrow { color: var(--accent); }
.ra-cmd-footer {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--border-soft);
  background: rgba(0,0,0,0.15);
}
.ra-cmd-footer-hint {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--dim); font-family: var(--font-mono);
}
.ra-cmd-footer-hint kbd {
  font-size: 10px; color: var(--dim); font-family: var(--font-mono);
  border: 1px solid var(--border); padding: 1px 5px; border-radius: 4px;
  background: none;
}
.ra-cmd-empty {
  padding: 24px; text-align: center;
  color: var(--dim); font-size: 14px;
}

/* Mobile: top sheet */
@media (max-width: 768px) {
  #ra-cmd-overlay {
    align-items: flex-start;
    justify-content: stretch;
    padding-top: 0;
  }
  .ra-cmd-dialog {
    width: 100vw;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-top: none;
    transform: translateY(-100%);
  }
  #ra-cmd-overlay.ra-cmd-open .ra-cmd-dialog {
    transform: translateY(0);
  }
  .ra-cmd-footer { display: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .ra-topbar-search { width: 200px; }
}

@media (max-width: 768px) {
  /* Auth: hide brand panel */
  .ra-auth-grid { grid-template-columns: 1fr; }
  .ra-auth-brand { display: none; }
  .ra-auth-logo-sm { display: flex; }

  /* App shell: drawer sidebar */
  .ra-topbar-menu-btn { display: flex; }
  .ra-sidebar {
    position: fixed; left: 0; top: 0; height: 100%;
    z-index: 50; transform: translateX(-100%);
  }
  .ra-sidebar.open { transform: translateX(0); }
  .ra-sidebar-close { display: flex; }
  .ra-topbar-search { display: none; }
  .ra-topbar-search-btn { display: flex; align-items: center; justify-content: center; margin-left: auto; }
  .ra-topbar-btn { display: none; }
  .ra-topbar-user-name { display: none; }
  .form-row-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .ra-auth-form-panel { padding: 24px 16px; }
  .ra-main { padding: 16px; }
  .ra-passkey-btn { height: 52px; }
}

/* ============================================================
   SESSION ROW COMPONENT
   ============================================================ */
.ra-session-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
}
.ra-session-row:last-child { border-bottom: none; }

.ra-session-row--current {
  padding-left: 14px;
}
.ra-session-row--current::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.ra-session-row-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.ra-session-row-info { flex: 1; min-width: 0; }

.ra-session-row-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.ra-session-row-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.ra-session-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Detail modal info rows */
.ra-dm-row { display: flex; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.ra-dm-row:last-child { border-bottom: none; }
.ra-dm-dt  { width: 150px; flex-shrink: 0; font-size: 12px; color: var(--muted); }
.ra-dm-dd  { flex: 1; font-size: 13.5px; color: var(--text-2); font-family: var(--font-mono); }

/* Pagination */
.ra-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.ra-pagination-info {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.ra-pagination .btn--disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 640px) {
  .ra-session-row { flex-wrap: wrap; }
  .ra-session-row-actions { width: 100%; padding-left: 54px; }
}

/* ─── Critical MFA Modal ─────────────────────────────── */
#criticalMfaOverlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
#criticalMfaOverlay.cmfa-open {
    opacity: 1;
    pointer-events: auto;
}
#criticalMfaBox {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: min(92vw, 420px);
    box-shadow: 0 32px 64px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
    transform: scale(.93) translateY(20px);
    transition: transform .32s cubic-bezier(.34,1.4,.64,1);
    overflow: hidden;
}
#criticalMfaOverlay.cmfa-open #criticalMfaBox {
    transform: scale(1) translateY(0);
}
.cmfa-header {
    padding: 32px 28px 0;
    text-align: center;
}
.cmfa-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(99,102,241,0.4);
}
.cmfa-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px;
    letter-spacing: -.02em;
}
.cmfa-sub {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    line-height: 1.55;
}
.cmfa-tabs {
    display: flex;
    margin: 22px 28px 0;
    border-bottom: 1px solid var(--border);
    gap: 0;
}
.cmfa-tab {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 9px 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.cmfa-tab:hover { color: var(--text); }
.cmfa-tab.cmfa-tab-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}
.cmfa-body {
    padding: 22px 28px 4px;
}
.cmfa-panel { display: none; }
.cmfa-panel.cmfa-panel-active { display: block; }
/* OTP grid — overflow fix */
.cmfa-otp-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 4px;
}
.cmfa-otp-cell {
    min-width: 0;
    width: 100%;
    aspect-ratio: 1;
    box-sizing: border-box;
    padding: 0;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-mono, monospace);
    outline: none;
    caret-color: transparent;
    transition: border-color .15s, box-shadow .15s;
}
.cmfa-otp-cell:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    background: var(--surface-2);
}
/* Passkey panel */
.cmfa-passkey-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 4px 0 6px;
}
.cmfa-passkey-icon {
    width: 95px;
    height: 95px;
    border-radius: 20px;
    margin-bottom: 16px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.cmfa-passkey-desc {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    line-height: 1.55;
    margin: 0;
}
.cmfa-passkey-btn {
    width: 100%;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid var(--accent);
    border-radius: 10px;
    background: rgba(99,102,241,0.08);
    color: var(--accent);
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.cmfa-passkey-btn:hover:not(:disabled) {
    background: rgba(99,102,241,0.14);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.cmfa-passkey-btn:disabled { opacity: 0.55; cursor: not-allowed; }
/* Error */
.cmfa-error {
    font-size: 12px;
    color: var(--danger);
    margin: 10px 0 0;
    display: none;
    padding: 9px 12px;
    background: rgba(239,68,68,0.07);
    border-radius: 8px;
    border: 1px solid rgba(239,68,68,0.18);
    line-height: 1.4;
}
.cmfa-error.cmfa-error-visible { display: block; }
/* Footer */
.cmfa-footer {
    display: flex;
    gap: 10px;
    padding: 16px 28px 28px;
}

/* ============================================================
   TAB SYSTEM
   ============================================================ */
.ra-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.ra-tab-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 16px;
  font-size: 14px; font-weight: 500; color: var(--dim);
  background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -1px; cursor: pointer; white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  font-family: var(--font-sans);
}
.ra-tab-btn:hover { color: var(--muted); }
.ra-tab-btn.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.ra-tab-panel { display: none; }
.ra-tab-panel.active { display: block; }
.ra-tab-count {
  font-size: 11px; font-family: var(--font-mono); font-weight: 600;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--surface-3); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.ra-tab-btn.active .ra-tab-count { background: var(--accent); color: var(--accent-ink); }
.ra-sentinel-loader {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 20px; color: var(--dim); font-size: 13px;
}
.ra-sentinel-done { text-align: center; padding: 16px; font-size: 13px; color: var(--dim); }
.ra-spin { animation: ra-spin 1s linear infinite; }
.ra-activity-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border-soft);
}
.ra-activity-row:last-child { border-bottom: none; }
.ra-activity-icon {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.ra-activity-body { flex: 1; min-width: 0; }
.ra-activity-label { font-size: 13px; font-weight: 500; color: var(--text); }
.ra-activity-detail { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ra-activity-meta { text-align: right; flex-shrink: 0; }

@media (max-width: 640px) {
  .ra-tab-btn { padding: 10px 12px; font-size: 13px; }
}

/* ============================================================
   REGISTER — ACCOUNT TYPE TOGGLE
   ============================================================ */
.reg-type-toggle {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 20px;
}
.reg-type-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: transparent; border: none; color: var(--muted);
  font-size: 13.5px; font-weight: 500; padding: 9px 12px; border-radius: 7px;
  cursor: pointer; transition: background 0.15s, color 0.15s;
  font-family: var(--font-sans); line-height: 1;
}
.reg-type-btn:hover { color: var(--text); }
.reg-type-btn.active {
  background: var(--surface-3); color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.reg-hint {
  font-size: 11.5px; color: var(--dim); margin: 4px 0 0; line-height: 1.4;
  display: flex; align-items: center; gap: 5px;
}
.reg-providers-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--border); border-radius: 50%;
  width: 16px; height: 16px; padding: 0; cursor: pointer;
  color: var(--dim); flex-shrink: 0; transition: color 0.12s, border-color 0.12s;
}
.reg-providers-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.alert-providers-link {
  display: block;
  margin-top: 10px;
  background: none; border: none; padding: 0;
  font-size: 12.5px; font-weight: 600; font-family: var(--font-sans);
  color: var(--danger); opacity: 0.75;
  cursor: pointer; text-align: left;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-style: dashed;
  transition: opacity 0.12s;
}
.alert-providers-link:hover { opacity: 1; }

/* Providers modal */
.reg-modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.reg-modal {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 560px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5); max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.reg-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--text); flex-shrink: 0;
}
.reg-modal-close {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 4px; display: flex; align-items: center; border-radius: 4px;
  transition: color 0.12s;
}
.reg-modal-close:hover { color: var(--text); }
.reg-modal-body { overflow-y: auto; padding: 4px 0 8px; }
.reg-providers-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.reg-providers-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 8px 20px; border-bottom: 1px solid var(--border-soft);
}
.reg-providers-table td { padding: 10px 20px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.reg-providers-table tr:last-child td { border-bottom: none; }
.reg-provider-brand { font-weight: 600; color: var(--text); white-space: nowrap; width: 90px; }
.reg-provider-domains { display: flex; flex-wrap: wrap; gap: 4px; }
.reg-domain-tag {
  font-size: 11.5px; font-family: var(--font-mono);
  background: var(--surface-3); border: 1px solid var(--border);
  color: var(--text-2); padding: 2px 7px; border-radius: 4px;
}
.reg-declaration { margin-top: 4px; margin-bottom: 4px; }
.reg-check-label {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  font-size: 13px; color: var(--text-2); line-height: 1.45;
  padding: 12px 0; border-top: 1px solid var(--border-soft);
}
.reg-check-label input[type="checkbox"] {
  width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px;
  accent-color: var(--accent); cursor: pointer;
}

/* ============================================================
   GLOBAL LOADERS — page overlay + button spinner
   ============================================================ */

/* ── Full-page logo loader ──────────────────── */
.ra-loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px;
  background: radial-gradient(120% 120% at 50% 40%, var(--bg-grad-top) 0%, var(--bg) 70%);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .28s ease, visibility 0s linear .28s;
}
.ra-loader.is-active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity .2s ease;
}

.ra-loader-mark {
  position: relative; width: 86px; height: 86px;
  display: flex; align-items: center; justify-content: center;
}
/* rotating accent ring */
.ra-loader-mark::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-right-color: var(--accent-line);
  animation: ra-spin .85s cubic-bezier(.5,.15,.5,.85) infinite;
}
/* soft glow */
.ra-loader-mark::after {
  content: ''; position: absolute; inset: 14px; border-radius: 50%;
  background: var(--accent); opacity: .12; filter: blur(14px);
  animation: ra-loader-pulse 1.6s ease-in-out infinite;
}
.ra-loader-logo {
  width: 42px; height: 42px; position: relative; z-index: 1;
  animation: ra-loader-pulse 1.6s ease-in-out infinite;
}
.ra-loader-text {
  font-size: 12.5px; font-weight: 500; letter-spacing: .04em;
  color: var(--muted); text-transform: uppercase;
}
.ra-loader-text b { color: var(--text-2); font-weight: 600; }

@keyframes ra-loader-pulse {
  0%, 100% { transform: scale(1);    opacity: .92; }
  50%      { transform: scale(1.08); opacity: 1; }
}

/* ── Inline button spinner ──────────────────── */
.btn { --ra-spin-color: var(--text); --ra-spin-track: rgba(255,255,255,0.22); }
.btn--primary { --ra-spin-color: var(--accent);  --ra-spin-track: rgba(48,197,216,0.28); }
.btn--emerald { --ra-spin-color: var(--emerald); --ra-spin-track: rgba(16,185,129,0.28); }
.btn--danger  { --ra-spin-color: var(--danger);  --ra-spin-track: rgba(242,103,112,0.28); }
.btn--outline,
.btn--ghost   { --ra-spin-color: var(--text-2); --ra-spin-track: var(--border-strong); }

.btn.is-loading {
  color: transparent !important;
  pointer-events: none; position: relative;
  opacity: 1 !important; transform: none !important;
}
.btn.is-loading > * { opacity: 0; }
.btn.is-loading::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid var(--ra-spin-track);
  border-top-color: var(--ra-spin-color);
  animation: ra-spin .6s linear infinite;
}
.btn--lg.is-loading::after { width: 18px; height: 18px; margin: -9px 0 0 -9px; }

/* ============================================================
   ACCESSIBILITY — REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .ra-topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--sidebar); }
  #ra-cmd-overlay { transition: none; }
  .ra-cmd-dialog { transition: none; }
  .ra-nav-item { transition: none; }
  .ra-topbar-search, .ra-topbar-btn, .ra-topbar-search-btn { transition: none; }
  .ra-passkey-btn::before { animation: none; }
  @keyframes ra-sheen { 0%, 100% { transform: translateX(-100%) skewX(-20deg); } }
  .ra-loader-logo, .ra-loader-mark::after { animation: none; }
  .ra-loader-mark::before { animation-duration: 1.6s; }
}
