/* Sign-in pieces shared by the sign-in screens and the portal / CRM Security pages:
   password show/hide eye, recovery codes, secret key, passkey list. Tokens from tokens.css,
   with fallbacks for pages that have not linked it yet. */

/* Password field with an eye button. The button sits inside the field on the inline end, so the
   layout never moves when it toggles. Password text stays left-to-right in Arabic too. */
.pw { position: relative; display: block; }
.pw > input { width: 100%; padding-right: 54px !important; }
html[dir=rtl] .pw > input { padding-right: 14px !important; padding-left: 54px !important; }
.pw-toggle {
  position: absolute; top: 50%; right: 3px; transform: translateY(-50%);
  width: 44px; height: 44px; padding: 0; margin: 0; border: 0; border-radius: 10px; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--text-2, rgba(245,240,232,.72));
  transition: color var(--dur, 180ms) var(--ease, ease), background-color var(--dur, 180ms) var(--ease, ease);
  -webkit-tap-highlight-color: transparent;
}
html[dir=rtl] .pw-toggle { right: auto; left: 3px; }
.pw-toggle:hover { color: var(--text, #F5F0E8); background: rgba(255,255,255,.06); }
.pw-toggle:focus-visible { outline: none; box-shadow: var(--focus, 0 0 0 3px rgba(154,102,232,.55)); }
.pw-toggle svg { width: 22px; height: 22px; pointer-events: none; }
.pw-toggle .eye-off { display: none; }
.pw-toggle[aria-pressed=true] .eye { display: none; }
.pw-toggle[aria-pressed=true] .eye-off { display: block; }
.pw > input::-ms-reveal, .pw > input::-ms-clear { display: none; }

/* Secret key and recovery codes */
.secret-key { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 15px; letter-spacing: .08em; background: var(--surface, #110A1A); border: 1px solid var(--line, rgba(255,255,255,.08)); padding: 10px 12px; border-radius: 12px; direction: ltr; }
.secret-key code { flex: 1 1 200px; min-width: 0; word-break: break-all; }
.recovery-codes { list-style: none; margin: 0 0 16px; padding: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; background: var(--surface, #110A1A); border: 1px solid var(--line, rgba(255,255,255,.08)); border-radius: var(--radius, 14px); direction: ltr; }
.recovery-codes li { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 16px; letter-spacing: .06em; text-align: center; padding: 6px 0; }

/* Passkeys and trusted devices on the Security page */
.key-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.key-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius, 14px); background: var(--surface-2, #1A1126); border: 1px solid var(--line, rgba(255,255,255,.08)); }
.key-item .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft, rgba(123,63,208,.16)); color: var(--accent-hi, #9A66E8); }
.key-item .ico svg { width: 20px; height: 20px; }
.key-item .name { font-weight: 600; overflow-wrap: anywhere; }
.key-item .meta { font-size: 14px; color: var(--text-2, rgba(245,240,232,.72)); }
.key-item details > summary { list-style: none; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 10px; color: var(--accent-hi, #9A66E8); font-weight: 600; font-size: 14px; }
.key-item details > summary::-webkit-details-marker { display: none; }
.key-item details[open] { grid-column: 1 / -1; }
.key-edit { display: grid; gap: 10px; margin-top: 8px; }
.key-edit .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.key-edit .row input { flex: 1 1 180px; }
.sec-block + .sec-block { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line, rgba(255,255,255,.08)); }
.sec-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.sec-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3, rgba(245,240,232,.56)); }
.sec-status.on::before { background: var(--ok, #3FBF7F); }
[data-passkey-unsupported] { color: var(--text-2, rgba(245,240,232,.72)); }
.field-error { margin-top: 8px; font-size: 14px; color: #F49A95; }
.key-item .sr-only, .sec-block .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
