/*
  Vaultwarden compatibility stylesheet for Bitwarden Web Vault.

  Design goals:
  - Only perform UI hiding/patching needed for "lightweight self-use" projects to avoid confusion from unsupported features.
  - Not dynamically generated during Worker runtime (saves Cloudflare Worker CPU/request quotas).

  Usage:
  - After CI/CD or local download of bw_web_builds and extraction, keep `public/web-vault/` as the static resource root directory.
  - Run: `bash scripts/apply-web-vault-overrides.sh public/web-vault`
    which will copy this file (public/css/vaultwarden.css) to `public/web-vault/css/vaultwarden.css`.
*/

/* Hide unsupported UI elements */
.vw-hide,
bit-nav-item[route="settings/subscription"],
a[href$="/settings/sponsored-families"],

/* SSO UI (newer builds, if present) */
.vw-email-sso,
.vw-sso-login,
.vw-or-text,
.vw-other-login,

/* Passkey/WebAuthn login UI (newer builds, if present) */
.vw-passkey-login,

/* Legacy selectors for older web vault builds (< 2025.5.1) */
app-root ng-component > form > div:nth-child(1) > div > button[buttontype="secondary"].\!tw-text-primary-600:nth-child(4),
app-root ng-component > form > div:nth-child(1) > div > button[buttontype="secondary"].\!tw-text-primary-600:nth-child(3),
app-root ng-component > form > div:nth-child(1) > div:nth-child(3) > div:nth-child(2),

/* Org-related / enterprise UI */
app-organization-plans > form > bit-section:nth-child(2),
app-org-account form.ng-untouched:nth-child(5),
app-org-reports-home > app-report-list > div.tw-inline-grid > div:nth-child(6),
bit-dialog div.tw-ml-4:has(bit-form-control input),
bit-dialog div.tw-col-span-4:has(input[formcontrolname*="access"], input[formcontrolname*="manage"]),

/* Device verification / protection UI (not supported) */
app-security > app-two-factor-setup > form,
app-user-layout app-danger-zone button:nth-child(1),

/* Two-factor providers (hide unsupported ones; keep authenticator/TOTP visible) */
/* Email */
.providers-2fa-1,

/* Duo */
.providers-2fa-2,

/* YubiKey */
.providers-2fa-3,

/* WebAuthn */
.providers-2fa-7,

/* Emergency access & Sends (not supported) */
bit-nav-item[route="settings/emergency-access"],
bit-nav-item[route="sends"],

/* Passkey settings (not supported) */
app-user-layout app-password-settings app-webauthn-login-settings {
  display: none !important;
}

/* Change collapsed menu icon to Vaultwarden */
bit-nav-logo bit-nav-item a:before {
  content: "";
  background-image: url("../images/icon-white.svg");
  background-repeat: no-repeat;
  background-position: center center;
  height: 32px;
  display: block;
}

bit-nav-logo bit-nav-item .bwi-shield {
  display: none !important;
}
