html[data-app-theme="dark"] body.app-auth-page,
html[data-app-theme="dark"] .app-session-lock-surface,
html[data-app-theme="dark"] .app-session-locked {
    background: #17232e;
    background: var(--app-dark-page);
    color: #e6eef5;
    color: var(--app-dark-text);
}

html[data-app-theme="dark"] .app-auth-surface::before,
html[data-app-theme="dark"] .app-session-lock-surface::before {
    background: rgba(103, 166, 201, .06);
}

html[data-app-theme="dark"] .app-auth-surface::after,
html[data-app-theme="dark"] .app-session-lock-surface::after {
    background: rgba(103, 166, 201, .05);
}

html[data-app-theme="dark"] .app-auth-shell,
html[data-app-theme="dark"] .app-auth-panel {
    background: #22313e;
    background: var(--app-dark-surface);
    border-color: #3a4e5e;
    border-color: var(--app-dark-border);
}

html[data-app-theme="dark"] .app-auth-shell {
    box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
}

html[data-app-theme="dark"] .app-auth-visual {
    background: linear-gradient(145deg, #22313e 0%, #243440 58%, #263743 100%);
    background: linear-gradient(145deg, var(--app-dark-surface) 0%, #243440 58%, var(--app-dark-raised) 100%);
    border-color: #3a4e5e;
    border-color: var(--app-dark-border);
    color: #e6eef5;
    color: var(--app-dark-text);
}

html[data-app-theme="dark"] .app-auth-visual::after {
    border-color: rgba(143, 200, 232, .09);
}

html[data-app-theme="dark"] .app-auth-illustration {
    opacity: .16;
}

html[data-app-theme="dark"] .app-auth-ring-outer {
    border-color: rgba(143, 200, 232, .55);
}

html[data-app-theme="dark"] .app-auth-icon {
    background: rgba(143, 200, 232, .1);
    border-color: rgba(143, 200, 232, .55);
    color: #8fc8e8;
    color: var(--app-dark-accent);
}

html[data-app-theme="dark"] .app-auth-brand,
html[data-app-theme="dark"] .app-auth-header h1,
html[data-app-theme="dark"] .app-auth-account strong {
    color: #e6eef5;
    color: var(--app-dark-text);
}

html[data-app-theme="dark"] .app-auth-brand img {
    background: transparent;
    box-shadow: none;
    filter: none;
}

html[data-app-theme="dark"] .app-auth-logo-backdrop-surface {
    background: rgba(180, 198, 214, .5);
    border-radius: 6px;
    pointer-events: none;
    position: absolute;
    z-index: -1;
}

html[data-app-theme="dark"] .app-auth-header p,
html[data-app-theme="dark"] .app-auth-checkbox,
html[data-app-theme="dark"] .app-auth-language .public-language-toggle,
html[data-app-theme="dark"] .app-auth-account-label,
html[data-app-theme="dark"] .app-auth-form.form-master .form-group > label,
html[data-app-theme="dark"] .app-auth-form.form-master .form-group:not(.placeholder-disabled) > label {
    color: #b4c6d6;
    color: var(--app-dark-secondary);
}

/* Override the legacy alert palette within authentication screens. */
html[data-app-theme="dark"] .app-auth-notices .alert-success,
html[data-app-theme="dark"] .app-auth-status.is-success {
    background-color: #203e34 !important;
    background-color: var(--app-dark-success-background) !important;
    border-color: #446e59;
    border-color: var(--app-dark-success-border);
    color: #b8e4c8 !important;
    color: var(--app-dark-success-text) !important;
}

html[data-app-theme="dark"] .app-auth-notices .alert-warning,
html[data-app-theme="dark"] .app-auth-notices .callout-warning {
    background-color: #443a27 !important;
    background-color: var(--app-dark-warning-background) !important;
    border-color: #766344;
    border-color: var(--app-dark-warning-border);
    color: #eed7a6 !important;
    color: var(--app-dark-warning-text) !important;
}

html[data-app-theme="dark"] .app-auth-notices .alert-danger,
html[data-app-theme="dark"] .app-auth-notices .alert-error,
html[data-app-theme="dark"] .app-auth-status.is-error {
    background-color: #432d34 !important;
    background-color: var(--app-dark-danger-background) !important;
    border-color: #85505a;
    border-color: var(--app-dark-danger-border);
    color: #f5b9bd !important;
    color: var(--app-dark-danger-text) !important;
}

html[data-app-theme="dark"] .app-auth-notices .alert-info {
    background-color: #20394c !important;
    background-color: var(--app-dark-info-background) !important;
    border-color: #416982;
    border-color: var(--app-dark-info-border);
    color: #b6daf0 !important;
    color: var(--app-dark-info-text) !important;
}

html[data-app-theme="dark"] .app-auth-notices .alert a,
html[data-app-theme="dark"] .app-auth-notices .callout-warning a,
html[data-app-theme="dark"] .app-auth-status a {
    color: inherit;
    text-decoration: underline;
}

html[data-app-theme="dark"] .app-auth-form.form-master .form-control,
html[data-app-theme="dark"] .app-auth-account {
    background: #1c2b37;
    background: var(--app-dark-inset);
    border-color: #3a4e5e;
    border-color: var(--app-dark-border);
    color: #e6eef5;
    color: var(--app-dark-text);
}

html[data-app-theme="dark"] .app-auth-form.form-master .form-control:hover {
    border-color: #65839a;
    border-color: var(--app-dark-border-hover);
}

html[data-app-theme="dark"] .app-auth-form.form-master .form-control:focus {
    background: #17232e;
    background: var(--app-dark-page);
    border-color: #5ea6ce;
    border-color: var(--app-dark-focus);
    box-shadow: 0 0 0 3px rgba(94, 166, 206, .2);
}

html[data-app-theme="dark"] .app-auth-form.form-master .has-error .form-control {
    border-color: #e58a84;
}

html[data-app-theme="dark"] .app-auth-form .help-block {
    color: #f4a7a2;
}

html[data-app-theme="dark"] .app-auth-field-icon,
html[data-app-theme="dark"] .app-auth-field-action {
    color: #93a9bb;
    color: var(--app-dark-muted);
}

html[data-app-theme="dark"] .app-auth-field-action:hover,
html[data-app-theme="dark"] .app-auth-field-action:focus {
    background: #304657;
    background: var(--app-dark-hover);
    color: #8fc8e8;
    color: var(--app-dark-accent);
}

html[data-app-theme="dark"] .app-auth-links a,
html[data-app-theme="dark"] .app-auth-secondary-action {
    color: #82bee0;
    color: var(--app-dark-link);
}

html[data-app-theme="dark"] .app-auth-preferences .app-theme-toggle {
    background: transparent;
    color: #b4c6d6;
    color: var(--app-dark-secondary);
}

html[data-app-theme="dark"] .app-auth-preferences .app-theme-toggle:hover,
html[data-app-theme="dark"] .app-auth-preferences .app-theme-toggle[aria-expanded="true"] {
    background: rgba(173, 203, 222, .08);
    color: #b9dff3;
    color: var(--app-dark-link-hover);
}

html[data-app-theme="dark"] .app-auth-preferences .app-theme-menu {
    background: #22313e;
    background: var(--app-dark-surface);
    border-color: #3a4e5e;
    border-color: var(--app-dark-border);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .3);
}

html[data-app-theme="dark"] .app-auth-preferences .app-theme-menu-label {
    border-color: #3a4e5e;
    border-color: var(--app-dark-border);
    color: #b4c6d6;
    color: var(--app-dark-secondary);
}

html[data-app-theme="dark"] .app-auth-preferences .app-theme-menu-options button {
    color: #e6eef5;
    color: var(--app-dark-text);
}

html[data-app-theme="dark"] .app-auth-preferences .app-theme-menu-options button:hover,
html[data-app-theme="dark"] .app-auth-preferences .app-theme-menu-options button:focus,
html[data-app-theme="dark"] .app-auth-preferences .app-theme-menu-options button[aria-checked="true"] {
    background: #304657;
    background: var(--app-dark-hover);
    color: #b9dff3;
    color: var(--app-dark-link-hover);
}

html[data-app-theme="dark"] .app-auth-preferences .public-language-toggle:hover,
html[data-app-theme="dark"] .app-auth-preferences .public-language-toggle:focus,
html[data-app-theme="dark"] .app-auth-preferences .public-language[open] > .public-language-toggle {
    background: rgba(173, 203, 222, .08);
    color: #b9dff3;
    color: var(--app-dark-link-hover);
}

html[data-app-theme="dark"] .app-auth-links a:hover,
html[data-app-theme="dark"] .app-auth-secondary-action:hover,
html[data-app-theme="dark"] .app-auth-language .public-language-toggle:hover {
    color: #b9dff3;
    color: var(--app-dark-link-hover);
}

html[data-app-theme="dark"] .app-auth-form input:-webkit-autofill,
html[data-app-theme="dark"] .app-auth-form input:-webkit-autofill:hover,
html[data-app-theme="dark"] .app-auth-form input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 100px #1c2b37 inset;
    -webkit-box-shadow: 0 0 0 100px var(--app-dark-inset) inset;
    -webkit-text-fill-color: #e6eef5;
    -webkit-text-fill-color: var(--app-dark-text);
    caret-color: #e6eef5;
    caret-color: var(--app-dark-text);
}

html[data-app-theme="dark"] .app-auth-language .public-language-menu {
    background: #22313e;
    background: var(--app-dark-surface);
    border-color: #3a4e5e;
    border-color: var(--app-dark-border);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .3);
}

html[data-app-theme="dark"] .app-auth-language .public-language-label {
    border-color: #3a4e5e;
    border-color: var(--app-dark-border);
    color: #b4c6d6;
    color: var(--app-dark-secondary);
}

html[data-app-theme="dark"] .app-auth-language .public-language-options a {
    color: #e6eef5;
    color: var(--app-dark-text);
}

html[data-app-theme="dark"] .app-auth-language .public-language-options a:hover,
html[data-app-theme="dark"] .app-auth-language .public-language-options a:focus,
html[data-app-theme="dark"] .app-auth-language .public-language-options a[aria-current] {
    background: #304657;
    background: var(--app-dark-hover);
    color: #b9dff3;
    color: var(--app-dark-link-hover);
}

html[data-app-theme="dark"] .app-password-strength {
    background: #3a4e5e;
    background: var(--app-dark-border);
}

html[data-app-theme="dark"] .app-auth-mode-compact .app-auth-surface {
    background: #17232e;
    background: var(--app-dark-page);
}

html[data-app-theme="dark"] .app-auth-mode-compact .app-auth-shell,
html[data-app-theme="dark"] .app-auth-mode-compact .app-auth-panel {
    background: transparent;
}
