/* =============================================================================
 * OMS SSO - Compass Enterprise Theme
 * CAS 7.3.7 Custom Stylesheet
 * =============================================================================
 * APPROACH: Minimal intervention. Override CAS :root variables for branding.
 * Do NOT override MDC component structure (notched outlines, input groups, etc.)
 * as that breaks layout and JS functionality.
 *
 * Load order:
 *   1. normalize, bootstrap-grid, material-components, mdi-font, dataTables
 *   2. CAS core /static/css/cas.css
 *   3. THIS FILE
 *   4. /css/custom.css
 * =========================================================================== */

/* ==========================================================================
   1. CAS CORE VARIABLE OVERRIDES — This is the primary branding mechanism
   ========================================================================== */
:root {
    --cas-theme-primary: #003366;
    --cas-theme-primary-bg: rgba(0, 51, 102, 0.06);
    --cas-theme-primary-light: #004488;
    --cas-theme-button-bg: #003366;
    --cas-theme-button-bg-hover: #004488;
    --cas-theme-button-bg-lite: #0066aa;
    --cas-theme-secondary: #E87722;
    --cas-theme-success: #28a745;
    --cas-theme-danger: #dc3545;
    --cas-theme-danger-bg: #f8d7da;
    --cas-theme-warning: #856404;
    --cas-theme-warning-bg: #fff3cd;
    --cas-theme-border-light: 1px solid rgba(0, 0, 0, 0.10);
    --mdc-theme-primary: #003366;
    --mdc-theme-body: #eef1f5;
    --mdc-typography-font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;

    /* Compass tokens for our custom additions only */
    --compass-primary: #003366;
    --compass-primary-light: #004488;
    --compass-accent: #E87722;
    --compass-white: #ffffff;
    --compass-gray-50: #f8f9fa;
    --compass-gray-100: #f1f3f5;
    --compass-gray-200: #e9ecef;
    --compass-gray-300: #dee2e6;
    --compass-gray-400: #ced4da;
    --compass-gray-500: #adb5bd;
    --compass-gray-600: #6c757d;
    --compass-gray-700: #495057;
    --compass-gray-800: #343a40;
    --compass-gray-900: #212529;
    --compass-border-radius: 10px;
    --compass-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   2. BODY & PAGE LAYOUT
   ========================================================================== */

body {
    font-family: var(--mdc-typography-font-family);
    background: linear-gradient(135deg, #001a33 0%, #003366 40%, #004a7f 70%, #1a5c8a 100%);
    background-attachment: fixed;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Background — content area is transparent, body owns the gradient */
.mdc-drawer-app-content,
.bgimage {
    background: transparent !important;
    background-image: none !important;
    position: relative;
}

/* When a theme provides a background image, suppress the geometric overlay */
body.has-bg-image .mdc-drawer-app-content::before {
    display: none;
}

/* Subtle geometric overlay */
.mdc-drawer-app-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        /* Diagonal thin lines */
        repeating-linear-gradient(
            135deg,
            transparent,
            transparent 60px,
            rgba(255, 255, 255, 0.04) 60px,
            rgba(255, 255, 255, 0.04) 61px
        ),
        /* Crossing diagonal lines */
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 90px,
            rgba(255, 255, 255, 0.03) 90px,
            rgba(255, 255, 255, 0.03) 91px
        ),
        /* Soft radial highlights */
        radial-gradient(ellipse at 10% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(232, 119, 34, 0.06) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.mdc-drawer-app-content {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-top: 0 !important;
    padding-top: 2rem;
    padding-bottom: 3rem; /* space for fixed footer */
}

/* For short pages (login, logout, MFA), center vertically */
body.login .mdc-drawer-app-content,
body:has(.logout-card) .mdc-drawer-app-content,
body:has(.mfa-card) .mdc-drawer-app-content,
body:has(.mfa-code-card) .mdc-drawer-app-content,
body:has(.mfa-device-card) .mdc-drawer-app-content,
body:has(.error-card) .mdc-drawer-app-content {
    align-items: center;
    padding-top: 0;
}

/* On mobile, don't vertically center — let content start at top and scroll naturally */
@media (max-width: 576px) {
    body.login .mdc-drawer-app-content,
    body:has(.logout-card) .mdc-drawer-app-content,
    body:has(.mfa-card) .mdc-drawer-app-content,
    body:has(.mfa-code-card) .mdc-drawer-app-content,
    body:has(.mfa-device-card) .mdc-drawer-app-content,
    body:has(.error-card) .mdc-drawer-app-content {
        align-items: flex-start;
        padding-top: 1rem;
    }
}

/* Ensure content sits above the gradient overlay */
.mdc-drawer-app-content > * {
    position: relative;
    z-index: 1;
}

/* Footer fixed to bottom of viewport */
.cas-footer,
#casFooter {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
}

/* ==========================================================================
   3. HEADER — Hidden globally. All pages use headerless centered-card design.
      The header template still exists for CAS framework compatibility but is
      visually suppressed. Brand identity comes from in-card logos and the
      enterprise card gradient bar.
   ========================================================================== */

#app-bar,
header.mdc-top-app-bar {
    display: none !important;
}

/* Since header is hidden, remove the fixed-adjust top padding that MDC adds */
.mdc-top-app-bar--fixed-adjust {
    padding-top: 0 !important;
}

/* ==========================================================================
   4. MAIN CONTENT / LOGIN CARD
   ========================================================================== */

#main-content {
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

div#content {
    box-shadow: var(--compass-card-shadow);
    border-radius: var(--compass-border-radius);
    background-color: var(--compass-white);
}

/* When enterprise-card is the direct content, strip the parent wrapper styling
   so the enterprise card controls its own chrome */
div#content:has(> .enterprise-card),
div#content:has(.enterprise-card),
.mdc-card:has(.enterprise-card),
.mdc-card:has(.pwd-card) {
    box-shadow: none;
    border-radius: 0;
    background-color: transparent;
    border: none;
    padding: 0 !important;
}

main:has(.d-flex > section:only-of-type) {
    max-width: 460px;
}

/* Enterprise pages need more width than login */
main:has(.enterprise-card) {
    max-width: 580px;
}

/* Login card has its own narrower max-width */
main:has(.login-card) {
    max-width: 480px;
}

/* Wide enterprise cards (attribute tables, etc.) */
main:has(.success-card--wide) {
    max-width: 720px;
}

/* Login page — additional specificity not needed, global centering handles it */

/* ==========================================================================
   5. LOGIN CARD — Custom enterprise login
   ========================================================================== */

.login-card {
    max-width: 420px;
    padding: 3rem 2.75rem 2.5rem;
}

.login-card .form-wrapper {
    width: 100%;
}

/* Logo */
.login-logo {
    text-align: center;
    margin-bottom: 2.25rem;
}

.login-logo-img {
    height: 72px;
    max-width: 320px;
    object-fit: contain;
}

/* Error panel */
.login-error-panel {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    background: rgba(220, 53, 69, 0.06);
    border: 1px solid rgba(220, 53, 69, 0.15);
    color: #991b1b;
    font-size: 0.82rem;
    line-height: 1.5;
}

.login-error-panel[hidden] {
    display: none;
}

.login-error-panel i {
    color: #dc3545;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.login-error-panel p {
    margin: 0;
}

/* Forgot password link */
.login-forgot {
    text-align: right;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    padding-right: 0.25rem;
}

.login-forgot a {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--compass-primary);
    text-decoration: none;
}

.login-forgot a:hover {
    color: var(--compass-primary-light);
    text-decoration: underline;
}

/* Submit button */
.login-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background-color: var(--compass-primary);
    color: var(--compass-white);
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.2);
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    min-height: 44px;
    margin-top: 0.5rem;
}

.login-submit-btn:hover:not(:disabled) {
    background-color: var(--compass-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.3);
}

.login-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-submit-btn:disabled {
    background-color: var(--compass-gray-500);
    color: var(--compass-white);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-submit-btn:focus-visible {
    outline: 2px solid var(--compass-accent);
    outline-offset: 2px;
}

/* Divider */
.login-divider {
    border: none;
    border-top: 1px solid var(--compass-gray-200);
    margin: 1.5rem 0 1.25rem;
}

/* Help & locale footer section */
.login-footer-section {
    text-align: center;
}

.login-help {
    font-size: 0.72rem;
    color: var(--compass-gray-500);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.login-locale {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.login-locale a {
    font-size: 0.78rem;
    color: var(--compass-gray-600);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.login-locale a:hover {
    color: var(--compass-primary);
    background-color: rgba(0, 51, 102, 0.04);
}

.login-locale a.active {
    color: var(--compass-primary);
    font-weight: 600;
}

.login-locale-sep {
    color: var(--compass-gray-300);
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 576px) {
    .login-card {
        padding: 2rem 1.5rem 1.5rem;
        max-width: 100%;
        margin: 0 0.75rem;
    }

    .login-logo-img {
        height: 45px;
    }

    .login-submit-btn {
        font-size: 0.88rem;
    }
}

/* ==========================================================================
   6. FORM FIELDS
   MDC TextField JS is not initialized (cas.js/material.js are not loaded as
   standalone scripts). The <label> wrapper structure also prevents MDC's
   CSS sibling selectors (input ~ .mdc-floating-label) from working.
   We replicate the float behavior here using :focus-within and :has().
   ========================================================================== */

.mdc-text-field {
    width: 100%;
}

/* Float label on focus */
.mdc-text-field--outlined:focus-within .mdc-floating-label {
    transform: translateY(-34.75px) scale(0.75);
    color: var(--compass-primary);
}

/* Open the notch on focus */
.mdc-text-field--outlined:focus-within .mdc-notched-outline__notch {
    border-top: none;
}

/* Float label when input has a pre-filled value (e.g. after failed login) */
.mdc-text-field--outlined:has(input:not(:placeholder-shown)) .mdc-floating-label,
.mdc-text-field--outlined:has(input[value]:not([value=''])) .mdc-floating-label {
    transform: translateY(-34.75px) scale(0.75);
}

.mdc-text-field--outlined:has(input:not(:placeholder-shown)) .mdc-notched-outline__notch,
.mdc-text-field--outlined:has(input[value]:not([value=''])) .mdc-notched-outline__notch {
    border-top: none;
}

/* Outline border color on focus */
.mdc-text-field--outlined:focus-within .mdc-notched-outline__leading,
.mdc-text-field--outlined:focus-within .mdc-notched-outline__notch,
.mdc-text-field--outlined:focus-within .mdc-notched-outline__trailing {
    border-color: var(--compass-primary);
    border-width: 2px;
}

/* ==========================================================================
   7. PASSWORD REVEAL BUTTON
      Our custom loginform.html uses FA-only icon: "fa-solid fa-eye"
      No MDI conflict. Just style the button appearance.
   ========================================================================== */

button.reveal-password,
.reveal-password.mdc-button,
.reveal-password.btn-primary {
    background-color: var(--compass-gray-100) !important;
    background: var(--compass-gray-100) !important;
    border: 1px solid var(--compass-gray-300) !important;
    filter: none !important;
    box-shadow: none !important;
    color: var(--compass-gray-700) !important;
    border-radius: 0 6px 6px 0 !important;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    /* Match the MDC outlined text field height exactly */
    height: auto;
    align-self: stretch;
    margin: 0;
    position: relative;
    top: 0;
}

/* Ensure the input group uses stretch alignment so button fills full height */
#passwordSection .mdc-input-group-field-append {
    display: flex;
    align-items: stretch;
    width: 100%;
}

#passwordSection .mdc-input-group-field-append > label {
    flex: 1 1 100%;
    display: flex;
    align-items: stretch;
    width: 100%;
}

/* The MDC text field with trailing icon — make it flex so button stretches */
#passwordSection .mdc-text-field--with-trailing-icon {
    display: flex !important;
    align-items: stretch !important;
    width: 100% !important;
}

#passwordSection .mdc-text-field--with-trailing-icon .mdc-notched-outline {
    flex: 1;
}

#passwordSection .mdc-text-field--with-trailing-icon button.reveal-password {
    border-left: none !important;
    margin-left: -1px;
}

button.reveal-password:hover {
    background-color: var(--compass-gray-200) !important;
    color: var(--compass-primary) !important;
}

button.reveal-password:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--compass-accent);
}

.reveal-password-icon {
    font-size: 0.95rem;
}

/* ==========================================================================
   8. CAPSLOCK WARNING
   Shown/hidden via inline style from initCapsLockWarning() in cas.js.
   Default hidden state is set here; inline style overrides it on keydown.
   ========================================================================== */

.caps-warn {
    display: none;
}

.caps-warn .mdc-text-field-helper-text {
    font-size: 0.8rem;
    color: var(--compass-accent);
}

/* ==========================================================================
   9. SUBMIT BUTTON
   ========================================================================== */

.mdc-button--raised:not(:disabled):not(.reveal-password) {
    background-color: var(--compass-primary);
    border-radius: 6px;
    filter: none;
    padding: 12px 32px;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: none;
    letter-spacing: 0.3px;
    width: 100%;
    margin-top: 0.5rem;
}

.mdc-button--raised:not(:disabled):not(.reveal-password):hover,
.mdc-button--raised:not(:disabled):not(.reveal-password):focus-visible {
    background-color: var(--compass-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 51, 102, 0.3);
}

/* Outline/cancel buttons */
.mdc-button--outline:not(:disabled):not(.reveal-password) {
    background-color: transparent;
    border: 2px solid var(--compass-primary);
    color: var(--compass-primary);
    border-radius: 6px;
    filter: none;
    text-transform: none;
}

.button-cancel {
    background-color: transparent !important;
    color: var(--compass-gray-600) !important;
    border: 1px solid var(--compass-gray-400) !important;
    filter: none !important;
}

/* ==========================================================================
   10. LINKS
   ========================================================================== */

a {
    color: var(--compass-primary);
}

a:hover, a:active {
    color: var(--compass-primary-light);
}

/* ==========================================================================
   11. PM LINKS & SIDEBAR
   ========================================================================== */

#pmlinks {
    margin-top: 0.5rem;
}

#pmlinks a {
    font-size: 0.9rem;
    font-weight: 500;
}

/* PM links icons — these come from CAS default pmlinks fragment using MDI */
#pmlinks .mdi {
    margin-right: 0.25rem;
}

#sidebar {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--compass-gray-200);
}

#sidebar #securityNotice {
    font-size: 0.78rem;
    color: var(--compass-gray-500);
    line-height: 1.5;
    margin: 0;
}

/* ==========================================================================
   12. FOOTER — visual styling (position/layout is in section 2)
   ========================================================================== */

.cas-footer,
#casFooter {
    background-color: #001020;
    color: var(--compass-gray-400);
    font-size: 0.82rem;
    padding: 0.75rem 1.5rem;
    width: 100%;
    flex-shrink: 0;
}

.cas-footer a {
    color: var(--compass-gray-300);
}

.cas-footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.cas-footer-links {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.cas-footer-links a {
    color: var(--compass-gray-400);
    font-size: 0.75rem;
    text-decoration: none;
    transition: color 0.15s ease;
}

.cas-footer-links a:hover {
    color: var(--compass-white);
    text-decoration: underline;
}

#copyright {
    font-size: 0.72rem;
    color: var(--compass-gray-500);
}

/* ==========================================================================
   13. LANGUAGE SELECTOR (our custom addition)
   ========================================================================== */

.locale-selector {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--compass-gray-200);
}

.locale-selector a {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.82rem;
    text-decoration: none;
    color: var(--compass-gray-600);
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.locale-selector a:hover {
    color: var(--compass-primary);
    border-color: var(--compass-gray-300);
    background-color: var(--compass-gray-50);
    text-decoration: none;
}

.locale-selector a.active {
    color: var(--compass-primary);
    border-color: var(--compass-primary);
    background-color: rgba(0, 51, 102, 0.06);
    font-weight: 600;
}

/* ==========================================================================
   14. MFA PROVIDER SELECTION
   ========================================================================== */

.mfa-card {
    max-width: 480px;
}

/* Ensure breathing room when inside CAS layout content area */
#main-content:has(.enterprise-card) {
    padding: 2.5rem 1rem;
}

/* Mobile: reduce top padding for enterprise card pages to prevent icon cutoff */
@media (max-width: 576px) {
    #main-content:has(.enterprise-card) {
        padding: 0.75rem 0.5rem;
    }

    .enterprise-card {
        margin-top: 0;
    }

    .status-icon {
        width: 52px;
        height: 52px;
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }

    .status-header {
        margin-bottom: 1.25rem;
    }

    .status-header .status-title {
        font-size: 1.1rem;
    }

    .status-header .status-subtitle {
        font-size: 0.8rem;
    }
}

/* Icon */
.status-icon.mfa-icon {
    background: linear-gradient(135deg, var(--compass-primary) 0%, var(--compass-primary-light) 100%);
    box-shadow: 0 4px 16px rgba(0, 51, 102, 0.25);
}

/* Providers container */
.mfa-providers {
    margin-bottom: 1rem;
}

/* Individual provider card */
.mfa-provider {
    border: 1px solid var(--compass-gray-200);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    background-color: var(--compass-white);
}

.mfa-provider:hover {
    border-color: var(--compass-primary);
    box-shadow: 0 4px 16px rgba(0, 51, 102, 0.1);
    transform: translateY(-2px);
}

.mfa-provider--primary {
    border-color: rgba(0, 51, 102, 0.15);
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.015) 0%, rgba(0, 68, 136, 0.015) 100%);
}

/* Provider layout (icon + text side by side) */
.mfa-provider-layout {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.mfa-provider-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--compass-white);
    font-size: 1rem;
    flex-shrink: 0;
}

.mfa-provider-icon--email {
    background: linear-gradient(135deg, var(--compass-primary) 0%, var(--compass-primary-light) 100%);
}

.mfa-provider-icon--sms {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.mfa-provider-content {
    flex: 1;
    min-width: 0;
}

.mfa-provider-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--compass-gray-900);
    margin: 0 0 0.25rem 0;
}

.mfa-provider-desc {
    font-size: 0.82rem;
    color: var(--compass-gray-600);
    line-height: 1.5;
    margin: 0;
}

.mfa-provider-btn {
    width: 100%;
}

/* Skip section */
.mfa-skip-divider {
    border: none;
    border-top: 1px solid var(--compass-gray-200);
    margin: 1.5rem 0;
    height: 0;
}

.mfa-skip-btn {
    width: 100%;
    margin-top: 0.75rem;
}

/* Cancel */
.mfa-cancel {
    text-align: center;
    margin-top: 0.75rem;
}

.mfa-cancel-btn {
    min-width: 120px;
}

/* Responsive */
@media (max-width: 576px) {
    .mfa-provider-layout {
        gap: 0.75rem;
    }

    .mfa-provider-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .mfa-provider-title {
        font-size: 0.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mfa-provider {
        transition: none;
    }
}

/* ==========================================================================
   15. MFA CODE ENTRY (Email & SMS verification)
   ========================================================================== */

.mfa-code-card {
    max-width: 440px;
}

/* Icon variants */
.status-icon.mfa-code-icon {
    background: linear-gradient(135deg, var(--compass-primary) 0%, var(--compass-primary-light) 100%);
    box-shadow: 0 4px 16px rgba(0, 51, 102, 0.25);
}

.status-icon.mfa-code-icon--sms {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.25);
}

/* Alert messages */
.mfa-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.mfa-alert i {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.mfa-alert p {
    margin: 0;
}

.mfa-alert--error {
    background: rgba(220, 53, 69, 0.06);
    border: 1px solid rgba(220, 53, 69, 0.15);
    color: #991b1b;
}

.mfa-alert--error i {
    color: #dc3545;
}

.mfa-alert--info {
    background: rgba(0, 51, 102, 0.04);
    border: 1px solid rgba(0, 51, 102, 0.1);
    color: var(--compass-gray-700);
}

.mfa-alert--info i {
    color: var(--compass-primary);
}

.mfa-alert--warning {
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.2);
    color: #92400e;
}

.mfa-alert--warning i {
    color: #d97706;
}

/* Token input field */
.mfa-code-field {
    margin-bottom: 1.5rem;
}

/* Security warning callout */
.mfa-security-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    background: rgba(232, 119, 34, 0.08);
    border: 1px solid rgba(232, 119, 34, 0.25);
}

.mfa-security-warning i {
    color: #d97706;
    flex-shrink: 0;
    margin-top: 0.15rem;
    font-size: 0.9rem;
}

.mfa-security-warning p {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--compass-gray-800);
    line-height: 1.5;
}

/* Code expiry notice */
.mfa-code-expiry {
    font-size: 0.72rem;
    color: var(--compass-gray-500);
    margin: 0.5rem 0 0 0;
    text-align: center;
    transition: color 0.3s ease;
}

/* Countdown timer states */
.mfa-countdown-active {
    font-variant-numeric: tabular-nums;
}

.mfa-countdown-warning {
    color: #d97706;
    font-weight: 600;
}

.mfa-countdown-expired {
    color: #dc2626;
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .mfa-code-expiry {
        transition: none;
    }
}

/* Help section (below buttons) */
.mfa-help-section {
    margin-top: 0.5rem;
}

.mfa-help-divider {
    border: none;
    border-top: 1px solid var(--compass-gray-200);
    margin: 1.25rem 0;
}

.mfa-help-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--compass-gray-700);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.mfa-help-title i {
    color: var(--compass-gray-500);
    font-size: 0.85rem;
}

.mfa-help-text {
    font-size: 0.75rem;
    color: var(--compass-gray-500);
    line-height: 1.6;
    margin: 0;
}

.mfa-code-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--compass-gray-800);
    margin-bottom: 0.5rem;
}

.mfa-code-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.35em;
    text-align: center;
    border: 2px solid var(--compass-gray-300);
    border-radius: 8px;
    background-color: var(--compass-white);
    color: var(--compass-gray-900);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: 'Segoe UI', monospace;
}

.mfa-code-input::placeholder {
    color: var(--compass-gray-400);
    letter-spacing: 0.5em;
    font-weight: 400;
}

.mfa-code-input:focus {
    outline: none;
    border-color: var(--compass-primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.25);
}

.mfa-code-input:focus-visible {
    outline: none;
}

.mfa-code-help {
    font-size: 0.75rem;
    color: var(--compass-gray-500);
    margin: 0.5rem 0 0 0;
    text-align: center;
}

/* Action buttons */
.mfa-code-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.mfa-code-submit {
    flex: 1;
}

.mfa-code-resend {
    flex: 0 0 auto;
}

/* Responsive */
@media (max-width: 576px) {
    .mfa-code-input {
        font-size: 1.25rem;
        letter-spacing: 0.25em;
        padding: 0.75rem;
    }

    .mfa-code-actions {
        flex-direction: column;
    }

    .mfa-code-resend {
        width: 100%;
    }
}

/* Cancel / back link */
.mfa-cancel-section {
    text-align: center;
    margin-top: 1rem;
}

.mfa-cancel-link {
    font-size: 0.75rem;
    color: var(--compass-gray-500);
    text-decoration: none;
    transition: color 0.15s ease;
}

.mfa-cancel-link:hover {
    color: var(--compass-primary);
    text-decoration: underline;
}

/* ==========================================================================
   16. MFA DEVICE REGISTRATION (Trust this device)
   ========================================================================== */

.mfa-device-card {
    max-width: 460px;
}

.status-icon.mfa-device-icon {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.25);
}

/* Form fields */
.mfa-device-field {
    margin-bottom: 1.25rem;
}

.mfa-device-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--compass-gray-800);
    margin-bottom: 0.5rem;
}

.mfa-device-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border: 2px solid var(--compass-gray-300);
    border-radius: 6px;
    background-color: var(--compass-white);
    color: var(--compass-gray-900);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.mfa-device-input:focus {
    outline: none;
    border-color: var(--compass-primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.mfa-device-input:focus-visible {
    outline: 2px solid var(--compass-accent);
    outline-offset: 2px;
}

.mfa-device-input--small {
    width: 100px;
}

.mfa-device-help {
    font-size: 0.72rem;
    color: var(--compass-gray-500);
    margin: 0.375rem 0 0 0;
}

/* Duration row */
.mfa-device-duration {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.mfa-device-expiration {
    flex: 0 0 auto;
}

.mfa-device-select {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border: 2px solid var(--compass-gray-300);
    border-radius: 6px;
    background-color: var(--compass-white);
    color: var(--compass-gray-900);
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease;
    appearance: auto;
}

.mfa-device-select:focus {
    outline: none;
    border-color: var(--compass-primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

/* Action buttons */
.mfa-device-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.mfa-device-register {
    flex: 1;
}

.mfa-device-skip {
    flex: 0 0 auto;
}

/* Responsive */
@media (max-width: 576px) {
    .mfa-device-actions {
        flex-direction: column;
    }

    .mfa-device-skip {
        width: 100%;
    }

    .mfa-device-duration {
        flex-direction: column;
    }

    .mfa-device-input--small {
        width: 100%;
    }
}

/* ==========================================================================
   17. LOGOUT PAGE
   ========================================================================== */

.logout-card {
    max-width: 400px;
    text-align: center;
}

.logout-confirmation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.logout-check {
    color: #059669;
    font-size: 1.35rem;
}

.logout-message {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--compass-gray-900);
}

.logout-hint {
    font-size: 0.82rem;
    color: var(--compass-gray-500);
    margin: 0 0 1.75rem 0;
    line-height: 1.5;
}

.logout-action {
    margin-top: 0;
}

.logout-btn {
    min-width: 160px;
}

/* ==========================================================================
   17.2 CLOSE BROWSER PAGE
   ========================================================================== */

.close-browser-card {
    max-width: 420px;
    text-align: center;
}

.status-icon.close-browser-icon {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.25);
}

.close-browser-card .info-section {
    text-align: left;
}

.close-browser-card .security-note {
    justify-content: center;
    text-align: left;
}

.close-browser-card .button-group {
    justify-content: center;
}

/* Centering for close browser — same as logout */
body:has(.close-browser-card) .mdc-drawer-app-content {
    align-items: center;
    padding-top: 0;
}

/* ==========================================================================
   17.3 FBA MYORDERS PAGE
   ========================================================================== */

.fba-card {
    max-width: 520px;
}

body:has(.fba-card) .mdc-drawer-app-content {
    align-items: center;
    padding-top: 0;
}

.status-icon.fba-denied-icon {
    background: linear-gradient(135deg, #dc3545 0%, #b91c1c 100%);
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.25);
}

.status-icon.fba-info-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

/* Organization selection list */
.fba-org-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.fba-org-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border: 1px solid var(--compass-gray-200);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    background-color: var(--compass-white);
}

.fba-org-card:hover {
    border-color: var(--compass-primary);
    box-shadow: 0 4px 16px rgba(0, 51, 102, 0.1);
    transform: translateY(-2px);
}

.fba-org-card:focus-visible {
    outline: 2px solid var(--compass-accent);
    outline-offset: 2px;
}

.fba-org-card-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.fba-org-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
}

.fba-org-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--compass-gray-900);
}

.fba-org-arrow {
    color: var(--compass-gray-400);
    font-size: 0.82rem;
    transition: color 0.2s ease;
}

.fba-org-card:hover .fba-org-arrow {
    color: var(--compass-primary);
}

@media (max-width: 576px) {
    .fba-org-logo {
        width: 36px;
        height: 36px;
    }

    .fba-org-name {
        font-size: 0.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fba-org-card {
        transition: none;
    }
}

/* ==========================================================================
   17.5 ACCOUNT LOCKED / DISABLED PAGES
   ========================================================================== */

.acct-card {
    max-width: 520px;
}

.status-icon.acct-locked-icon {
    background: linear-gradient(135deg, #dc3545 0%, #b91c1c 100%);
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.25);
}

.status-icon.acct-warning-icon {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.25);
}

.status-icon.acct-disabled-icon {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 4px 16px rgba(71, 85, 105, 0.3);
}

/* ==========================================================================
   17.6 SUPPORT METHOD CARDS
   Used by: casLoginMessageView, casAccountLockedView, casAccountDisabledView,
            casExpiredPassView (EntraID/Admin variants)
   ========================================================================== */

.support-method {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem;
    border-radius: 8px;
    background: var(--compass-white, #ffffff);
    border: 1px solid rgba(0, 51, 102, 0.08);
    margin-top: 0.75rem;
    transition: border-color 0.15s ease-out;
}

.support-method:first-of-type {
    margin-top: 0.5rem;
}

.support-method:hover {
    border-color: rgba(0, 51, 102, 0.15);
}

.method-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    background: rgba(0, 51, 102, 0.06);
    color: var(--compass-primary, #003366);
    font-size: 0.875rem;
}

.method-content {
    flex: 1;
    min-width: 0;
}

.method-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--compass-gray-800, #343a40);
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
}

.method-description {
    font-size: 0.8125rem;
    color: var(--compass-gray-600, #6c757d);
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}

.detail-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(0, 51, 102, 0.06);
    color: var(--compass-primary, #003366);
    margin-right: 0.375rem;
    margin-bottom: 0.375rem;
    line-height: 1.3;
}

.method-button {
    display: inline-flex;
    margin-top: 0.5rem;
    padding: 0.4rem 0.875rem;
    font-size: 0.75rem;
    min-height: 32px;
}

.method-phone {
    font-size: 0.75rem;
    color: var(--compass-gray-600, #6c757d);
    margin: 0.375rem 0 0 0;
    line-height: 1.5;
}

.method-phone strong {
    color: var(--compass-gray-800, #343a40);
    font-weight: 600;
}

/* Responsive support methods */
@media (max-width: 768px) {
    .support-method {
        padding: 0.75rem;
    }
}

@media (max-width: 576px) {
    .support-method {
        flex-direction: column;
        gap: 0.5rem;
    }

    .method-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 0.82rem;
    }
}

.status-icon.interrupt-blocked-icon {
    background: linear-gradient(135deg, #dc3545 0%, #b91c1c 100%);
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.25);
}

.status-icon.interrupt-clock-icon {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.25);
}

.interrupt-blocked-card {
    max-width: 460px;
}

.interrupt-clock-card {
    max-width: 460px;
}

.status-icon.interrupt-disclaimer-icon {
    background: linear-gradient(135deg, var(--compass-primary, #003366) 0%, var(--compass-primary-light, #004488) 100%);
    box-shadow: 0 4px 16px rgba(0, 51, 102, 0.25);
}

.interrupt-disclaimer-card {
    max-width: 500px;
}

.status-icon.interrupt-survey-icon {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.25);
}

.interrupt-survey-card {
    max-width: 500px;
}

/* Survey form styles */
.survey-fieldset {
    border: none;
    padding: 0;
    margin: 0.75rem 0;
}

.survey-question {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--compass-gray-800, #343a40);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.survey-options {
    display: flex;
    gap: 1.25rem;
    padding: 0.25rem 0;
}

.survey-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--compass-gray-700, #495057);
    cursor: pointer;
}

.survey-option input[type="radio"],
.survey-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--compass-primary, #003366);
    cursor: pointer;
}

.survey-option input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.survey-option input:disabled + span {
    opacity: 0.4;
}

.survey-no-response {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--compass-gray-200, #e9ecef);
}

/* ==========================================================================
   17.6 PASSWORD UPDATE SUCCESS
   ========================================================================== */

.pwd-success-card {
    max-width: 440px;
}

.status-icon.pwd-success-icon {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.25);
}

/* Confirmation checklist */
.pwd-success-card .confirmation-list {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.pwd-success-card .confirmation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(5, 150, 105, 0.04);
    border: 1px solid rgba(5, 150, 105, 0.12);
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--compass-gray-800, #343a40);
    font-weight: 500;
}

.pwd-success-card .confirmation-item i {
    color: #059669;
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* ==========================================================================
   18. SERVICE ERROR PAGE
   ========================================================================== */

.error-card {
    max-width: 480px;
}

.status-icon.error-icon {
    background: linear-gradient(135deg, #dc3545 0%, #b91c1c 100%);
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.25);
}

.status-icon.error-icon--auth {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.25);
}

/* Error reference ID section (prominent, with copy button) */
.error-reference-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 51, 102, 0.04);
    border: 1px solid rgba(0, 51, 102, 0.1);
    border-radius: 6px;
    margin-bottom: 1rem;
}

.error-reference-section .error-reference-label {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
}

.error-reference-section .error-reference-id {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.06em;
    background: rgba(0, 51, 102, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.error-reference-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: auto;
    padding: 0;
    border: 1px solid rgba(0, 51, 102, 0.15);
    border-radius: 4px;
    background: var(--compass-white, #ffffff);
    color: var(--compass-primary, #003366);
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.15s ease-out, border-color 0.15s ease-out;
}

.error-reference-copy:hover {
    background-color: rgba(0, 51, 102, 0.06);
    border-color: var(--compass-primary, #003366);
}

.error-reference-copy:focus-visible {
    outline: 2px solid var(--compass-accent, #E87722);
    outline-offset: 2px;
}

.error-reference-copy.copied {
    background-color: rgba(5, 150, 105, 0.1);
    border-color: #059669;
    color: #059669;
}

.error-reference-copy.copied i::before {
    content: "\f00c"; /* fa-check */
    font-family: 'Font Awesome 6 Pro';
    font-weight: 900;
}

/* ==========================================================================
   19. PASSWORD EXPIRED / MUST CHANGE
   ========================================================================== */

.pwd-card {
    max-width: 460px;
}

.status-icon.pwd-icon {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.25);
}

/* Requirements checklist */
.pwd-requirements {
    background: rgba(0, 51, 102, 0.03);
    border: 1px solid rgba(0, 51, 102, 0.08);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.pwd-requirements-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--compass-gray-700);
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pwd-requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.4rem;
}

.pwd-requirements-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--compass-gray-500);
    transition: color 0.15s ease;
}

.pwd-requirements-list li.pwd-req-met {
    color: #059669;
}

.pwd-req-icon {
    width: 14px;
    text-align: center;
    font-size: 0.7rem;
    transition: color 0.15s ease;
}

.pwd-req-met .pwd-req-icon {
    color: #059669;
}

.pwd-req-fail .pwd-req-icon {
    color: var(--compass-gray-400);
}

/* Password fields */
.pwd-field {
    margin-bottom: 1rem;
}

.pwd-field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--compass-gray-700);
    margin-bottom: 0.4rem;
}

.pwd-input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.pwd-input {
    flex: 1;
    padding: 0.7rem 2.75rem 0.7rem 0.875rem;
    font-size: 0.875rem;
    border: 2px solid var(--compass-gray-300);
    border-radius: 6px;
    background-color: var(--compass-white);
    color: var(--compass-gray-900);
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pwd-input:focus {
    outline: none;
    border-color: var(--compass-primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.pwd-input:focus-visible {
    outline: none;
}

.pwd-reveal-btn {
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--compass-gray-500);
    cursor: pointer;
    padding: 0.4rem;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.pwd-reveal-btn:hover {
    color: var(--compass-primary);
}

.pwd-reveal-btn:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--compass-accent);
}

/* Strength meter */
.pwd-strength {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    margin-top: 0.25rem;
}

.pwd-strength-bar {
    flex: 1;
    height: 6px;
    background: var(--compass-gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.pwd-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.pwd-strength-label {
    font-size: 0.72rem;
    font-weight: 600;
    min-width: 70px;
    text-align: right;
    color: var(--compass-gray-500);
    transition: color 0.3s ease;
}

/* Actions */
.pwd-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.pwd-submit {
    flex: 1;
}

.pwd-cancel {
    flex: 0 0 auto;
}

/* Help */
.pwd-help {
    text-align: center;
    font-size: 0.72rem;
    color: var(--compass-gray-500);
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--compass-gray-200);
}

/* Responsive */
@media (max-width: 576px) {
    .pwd-actions {
        flex-direction: column;
    }

    .pwd-input {
        font-size: 16px; /* prevent iOS zoom */
    }
}

/* Caps Lock Warning */
.pwd-caps-warn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    background: rgba(232, 119, 34, 0.08);
    border: 1px solid rgba(232, 119, 34, 0.25);
    font-size: 0.78rem;
    font-weight: 500;
    color: #92400e;
    animation: pwd-caps-fadein 0.2s ease-out;
}

.pwd-caps-warn[hidden] {
    display: none;
}

.pwd-caps-warn i {
    color: #d97706;
    flex-shrink: 0;
    font-size: 0.85rem;
}

@keyframes pwd-caps-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .pwd-caps-warn {
        animation: none;
    }
}

/* ==========================================================================
   20. GENERIC SUCCESS PAGE
   ========================================================================== */

.success-card {
    max-width: 440px;
}

/* --- Redirect Card (production mode) --- */

.redirect-card {
    text-align: center;
    padding: 4rem 2.5rem 3rem;
}

.redirect-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.redirect-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08) 0%, rgba(16, 185, 129, 0.12) 100%);
    margin-bottom: 0.25rem;
}

.redirect-check {
    font-size: 2.25rem;
    color: #059669;
    animation: redirect-check-in 0.5s ease-out both;
}

.redirect-spinner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.75rem 0;
}

.redirect-spinner {
    font-size: 3.5rem;
    color: var(--compass-primary, #003366);
    opacity: 0.3;
}

@keyframes redirect-check-in {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.redirect-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--compass-gray-900, #212529);
    margin: 0.25rem 0 0 0;
}

.redirect-subtitle {
    font-size: 0.875rem;
    color: var(--compass-gray-600, #6c757d);
    margin: 0.35rem 0 0 0;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.redirect-fallback {
    margin-top: 2rem;
}

.redirect-fallback--hidden {
    display: none;
}

/* Reduced motion: stop spinner, skip check-in animation */
@media (prefers-reduced-motion: reduce) {
    .redirect-spinner {
        animation: none;
    }

    .redirect-check {
        animation: none;
    }
}

/* --- End Redirect Card --- */

.success-card--wide {
    max-width: 680px;
}

.status-icon.success-icon {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.25);
}

/* Attribute sections */
.attr-section {
    margin-bottom: 1.5rem;
}

.attr-section-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--compass-gray-800);
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.attr-section-title i {
    color: var(--compass-primary);
}

.attr-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--compass-gray-200);
    border-radius: 6px;
}

.attr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.attr-table thead {
    background: var(--compass-gray-50);
}

.attr-table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--compass-gray-700);
    border-bottom: 1px solid var(--compass-gray-200);
}

.attr-table td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--compass-gray-100);
    vertical-align: top;
}

.attr-table tbody tr:last-child td {
    border-bottom: none;
}

.attr-table tbody tr:hover {
    background: var(--compass-gray-50);
}

.attr-key {
    font-weight: 500;
    color: var(--compass-gray-800);
    white-space: nowrap;
    font-family: 'Consolas', 'Monaco', monospace;
}

.attr-value {
    color: var(--compass-gray-600);
    word-break: break-all;
    font-family: 'Consolas', 'Monaco', monospace;
}

@media (max-width: 576px) {
    .success-card--wide {
        max-width: 100%;
    }

    .attr-table {
        font-size: 0.7rem;
    }
}

/* ==========================================================================
   15. ACCESSIBILITY
   ========================================================================== */

/* Default focus indicator — applies to elements without their own focus style.
   Our custom inputs, buttons, and links define their own :focus/:focus-visible
   rules which override this via specificity. */
*:focus-visible {
    outline: 2px solid var(--compass-primary);
    outline-offset: 2px;
}

/* Suppress orange/outline on elements that have their own focus treatment */
.enterprise-btn:focus-visible,
.login-submit-btn:focus-visible,
.mfa-code-input:focus-visible,
.pwd-input:focus-visible,
.pwd-reveal-btn:focus-visible,
button.reveal-password:focus-visible,
.login-locale a:focus-visible,
.login-forgot a:focus-visible {
    outline: none;
}

/* Visible focus for locale and forgot-password links (keyboard navigation) */
.login-locale a:focus-visible {
    color: var(--compass-primary);
    background-color: rgba(0, 51, 102, 0.08);
    box-shadow: 0 0 0 2px var(--compass-primary);
    border-radius: 3px;
}

.login-forgot a:focus-visible {
    color: var(--compass-primary-light);
    text-decoration: underline;
    box-shadow: 0 0 0 2px var(--compass-primary);
    border-radius: 3px;
}

.hrd-back-link a:focus-visible {
    color: var(--compass-primary);
    box-shadow: 0 0 0 2px var(--compass-primary);
    border-radius: 3px;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   16. RESPONSIVE
   ========================================================================== */

@media (max-width: 767.99px) {
    .login-section {
        padding: 1.75rem 1.5rem;
        border-right: none;
    }

    .cas-brand { height: 48px; }
    .cas-logo { max-height: 44px; }

    main:has(.d-flex > section:only-of-type) {
        max-width: 100%;
    }

    #main-content {
        padding: 1.5rem 0.75rem;
    }
}

@media (max-width: 576px) {
    .login-section { padding: 1.5rem 1.25rem; }
    .mdc-top-app-bar__row { padding: 0.5rem 0.75rem; }
    .cas-brand { height: 40px; }
    .cas-logo { max-height: 36px; }
    #main-content { padding: 1rem 0.5rem; }
    div#content { border-radius: 6px; }
}

/* CAS core hides #casFooter below 960px — override since ours is position:fixed */
@media (max-width: 960px) {
    #casFooter {
        display: flex !important;
    }
}

/* ==========================================================================
   17. ANIMATIONS — @keyframes appear is defined in CAS core cas.css
   ========================================================================== */

/* ==========================================================================
   18. HOME REALM DISCOVERY (HRD) — Two-Step Login Flow
   ========================================================================== */

/* Step transitions */
.hrd-step {
    /* Smooth appearance */
}

.hrd-step[hidden] {
    display: none;
}

/* Field validation errors */
.hrd-field-error {
    font-size: 0.78rem;
    color: var(--cas-theme-danger);
    margin-top: 0.375rem;
    padding-left: 0.25rem;
}

.hrd-field-error[hidden] {
    display: none;
}

/* Back link (step 2 → step 1) */
.hrd-back-link {
    text-align: center;
    margin-top: 1rem;
}

.hrd-back-link a {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--compass-gray-600);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.15s ease;
}

.hrd-back-link a:hover {
    color: var(--compass-primary);
}

.hrd-back-link a i {
    font-size: 0.72rem;
}

/* Spinner overlay */
.hrd-spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hrd-spinner-overlay[hidden] {
    display: none;
}

.hrd-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--compass-white);
    border-radius: 50%;
    animation: hrd-spin 0.7s linear infinite;
}

@keyframes hrd-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   19. SYSTEM ISSUE MESSAGE BANNER
   ========================================================================== */

.system-issue-banner {
    margin-bottom: 1.5rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    background: rgba(232, 119, 34, 0.08);
    border: 1px solid rgba(232, 119, 34, 0.3);
}

.system-issue-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.system-issue-icon {
    color: #d97706;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.system-issue-header {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--compass-gray-900);
    margin-bottom: 0.25rem;
}

.system-issue-message {
    font-size: 0.78rem;
    color: var(--compass-gray-700);
    line-height: 1.5;
    margin: 0;
}

.login-disabled-content {
    text-align: center;
    padding-top: 1rem;
}

.login-disabled-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--compass-gray-700);
    margin: 1.5rem 0;
    line-height: 1.5;
}

/* Bottom informational banner (different from top warning) */
.system-info-banner {
    margin-top: 1.25rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    background: rgba(0, 51, 102, 0.04);
    border: 1px solid rgba(0, 51, 102, 0.12);
}

.system-info-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.system-info-icon {
    color: var(--compass-primary);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.system-info-header {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--compass-gray-900);
    margin-bottom: 0.2rem;
}

.system-info-message {
    font-size: 0.78rem;
    color: var(--compass-gray-600);
    line-height: 1.5;
    margin: 0;
}

/* ==========================================================================
   20. ADMIN PAGES
   ========================================================================== */

.admin-card {
    max-width: 920px;
    width: 100%;
}

.admin-card--wide {
    max-width: 920px;
}

.admin-card--extra-wide {
    max-width: 920px;
}

body:has(.admin-card) .mdc-drawer-app-content {
    align-items: flex-start;
    padding-top: 3rem;
}

body:has(.admin-card--extra-wide) .mdc-drawer-app-content {
    align-items: flex-start;
    padding-top: 2rem;
}

.status-icon.admin-icon {
    background: linear-gradient(135deg, var(--compass-primary) 0%, var(--compass-primary-light) 100%);
    box-shadow: 0 4px 16px rgba(0, 51, 102, 0.25);
}

/* Status bar */
.admin-status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 6px;
    background: var(--compass-gray-50);
    border: 1px solid var(--compass-gray-200);
    margin-bottom: 1.5rem;
    font-size: 0.82rem;
    font-weight: 500;
}

.admin-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.admin-status-inactive { background-color: var(--compass-gray-400); }
.admin-status-active { background-color: #059669; }
.admin-status-blocked { background-color: #dc3545; }
.admin-status-error { background-color: #dc3545; }

/* Form */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.admin-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--compass-gray-800);
}

.admin-field-help {
    font-size: 0.72rem;
    color: var(--compass-gray-600);
    margin: 0;
}

.admin-input,
.admin-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.85rem;
    border: 2px solid var(--compass-gray-300);
    border-radius: 6px;
    background: var(--compass-white);
    color: var(--compass-gray-900);
    font-family: inherit;
    transition: border-color 0.15s ease;
}

.admin-input:focus,
.admin-textarea:focus {
    outline: none;
    border-color: var(--compass-primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.admin-textarea {
    resize: vertical;
    min-height: 80px;
}

.admin-divider {
    border: none;
    border-top: 1px solid var(--compass-gray-200);
    margin: 0.5rem 0;
}

/* Toggle switch */
.admin-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.admin-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.admin-toggle-switch {
    width: 40px;
    height: 22px;
    background: var(--compass-gray-300);
    border-radius: 11px;
    position: relative;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.admin-toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: var(--compass-white);
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.admin-toggle-input:checked + .admin-toggle-switch {
    background: #059669;
}

.admin-toggle-input:checked + .admin-toggle-switch::after {
    transform: translateX(18px);
}

.admin-toggle-input:focus-visible + .admin-toggle-switch {
    outline: 2px solid var(--compass-accent);
    outline-offset: 2px;
}

.admin-toggle-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--compass-gray-800);
}

/* Feedback */
.admin-feedback {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.admin-feedback-success {
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.3);
    color: #059669;
}

.admin-feedback-error {
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.admin-feedback-info {
    background: rgba(0, 51, 102, 0.04);
    border: 1px solid rgba(0, 51, 102, 0.15);
    color: var(--compass-primary);
}

/* Admin toolbar */
.admin-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

/* Message list */
.admin-messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-empty-state {
    text-align: center;
    color: var(--compass-gray-600);
    font-size: 0.85rem;
    padding: 2rem 0;
}

.admin-msg-card {
    border: 1px solid var(--compass-gray-200);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-msg-card:hover {
    border-color: var(--compass-primary);
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.08);
}

.admin-msg-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.admin-msg-name {
    font-size: 0.85rem;
    color: var(--compass-gray-900);
}

.admin-msg-meta {
    font-size: 0.72rem;
    color: var(--compass-gray-600);
    margin-left: auto;
}

.admin-msg-card-body {
    font-size: 0.78rem;
    color: var(--compass-gray-600);
    line-height: 1.4;
}

.admin-msg-header {
    font-weight: 600;
    color: var(--compass-gray-700);
}

.admin-msg-preview {
    color: var(--compass-gray-600);
}

/* Form layout helpers */
.admin-field-row {
    display: flex;
    gap: 1rem;
}

.admin-field-row .admin-field {
    flex: 1;
}

.admin-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--compass-gray-900);
    margin: 0 0 1.25rem 0;
}

@media (max-width: 576px) {
    .admin-field-row {
        flex-direction: column;
        gap: 0;
    }

    .admin-card--wide,
    .admin-card--extra-wide {
        max-width: 100%;
    }
}


/* ==========================================================================
   PALANTIR ADMIN DASHBOARD — Reset enterprise theme for Palantir pages.
   When #dashboard is present, undo all enterprise customizations and let
   Palantir's built-in MDC styling take over.
   ========================================================================== */

/* Kill the enterprise background, gradients, and overlays */
body:has(#dashboard) .mdc-drawer-app-content::before {
    display: none !important;
}
body:has(#dashboard) .bgimage {
    background-image: none !important;
    background: #fafafa !important;
}
body:has(#dashboard) .mdc-drawer-app-content {
    background: transparent !important;
    align-items: stretch !important;
    padding-top: 0 !important;
    min-height: auto !important;
}

/* Reset the main content container to full-width for Palantir */
body:has(#dashboard) #main-content {
    max-width: 100% !important;
    padding: 1rem !important;
}

/* Hide the enterprise header/footer if they look wrong on Palantir */
body:has(#dashboard) #app-bar {
    background: #1a237e !important;
}

/* Reset any enterprise font/color overrides */
body:has(#dashboard),
body:has(#dashboard) .mdc-card,
body:has(#dashboard) .mdc-data-table__table,
body:has(#dashboard) .mdc-button,
body:has(#dashboard) .mdc-tab,
body:has(#dashboard) .mdc-text-field {
    font-family: "Roboto", "Helvetica Neue", sans-serif !important;
}

/* Ensure Palantir sidebar nav displays correctly as a vertical icon strip */
body:has(#dashboard) nav.sidebar-navigation {
    position: fixed !important;
    left: 0 !important;
    top: 64px !important;
    bottom: 0 !important;
    width: 56px !important;
    height: auto !important;
    background: #263238 !important;
    z-index: 100 !important;
    overflow-y: auto !important;
    padding: 8px 0 !important;
}
body:has(#dashboard) nav.sidebar-navigation ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
body:has(#dashboard) nav.sidebar-navigation ul li {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 56px !important;
    height: 48px !important;
    cursor: pointer !important;
    color: #b0bec5 !important;
    position: relative !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
body:has(#dashboard) nav.sidebar-navigation ul li:hover {
    background: #37474f !important;
    color: #fff !important;
}
body:has(#dashboard) nav.sidebar-navigation ul li.active {
    background: #455a64 !important;
    color: #fff !important;
    border-left: 3px solid #00bcd4 !important;
}
body:has(#dashboard) nav.sidebar-navigation ul li i {
    font-size: 22px !important;
}
body:has(#dashboard) nav.sidebar-navigation ul li .tooltip {
    display: none !important;
    position: absolute !important;
    left: 60px !important;
    background: #333 !important;
    color: #fff !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    z-index: 200 !important;
}
body:has(#dashboard) nav.sidebar-navigation ul li:hover .tooltip {
    display: block !important;
}

/* Shift Palantir's main content card right of the sidebar */
body:has(#dashboard) #dashboard > .mdc-card {
    margin-left: 56px !important;
}

/* Ensure footer is simple on Palantir */
body:has(#dashboard) .cas-footer {
    margin-left: 56px;
}
