/* ==========================================================================
   Sign-in pages (CODE-1): the style blocks that lived in the two sign-in layouts and their pages, moved here.
   Four parts, each scoped by a class on its <html> element so nothing leaks between them:
     A. html.login-shell  - the Bootstrap sign-in shell (Pages/Shared/_LoginLayout: invitation, forgot / reset
                            password, pending, partner consent, the old EnhancedLogin page);
     B. .enhanced-login   - Pages/Account/EnhancedLogin on that shell;
     C. html.signin-shell - the Tailwind sign-in shell (Pages/Shared/_MetronicLoginLayout: /account/login, 2FA);
     D. html.logout-page  - the sign-out page (Pages/Account/Logout, no layout).
   :where() keeps every selector at the specificity it had in the page's own block, so the cascade is unchanged.
   ========================================================================== */

/* ── A. Bootstrap sign-in shell ──────────────────────────────────────────
   This shell loads Bootstrap and site.css, not css/styles.css, so the brand tokens are declared here with the
   light canvas values of wwwroot/css/input.css. [SANNE-1] */
html.login-shell {
    --ic-red: #FA1740;
    --ic-red-rgb: 250, 23, 64;
    --ic-red-hover: #D10F33;
    --charcoal-950: #07080B;
    --shell-text: #FFFFFF;
    --surface: #FFFFFF;
    --border-strong: rgba(7, 8, 11, 0.16);
    --text: #0B0D12;
    --text-2: #3E4554;
    --text-muted: #646C7C;
}

/* [COLOR-1] Red is for the one primary action: .text-primary reads as ink, as in the portal (styles.css). */
:where(.login-shell) .text-primary { color: var(--text) !important; }

/* The canvas is Bootstrap's own light grey (--bs-light), the colour of the pages' .bg-light form column. */
:where(.login-shell) body {
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    color: var(--text);
    background: var(--bs-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

html:where(.login-shell) { height: 100%; }

/* [TYPE-1, BTN-1, FORM-1] The portal's sizes on Bootstrap: the page title 24/700, buttons and fields 36 high
   (30 for .btn-sm), labels 13/500 in sentence case, helper text 12 muted. */
:where(.login-shell) .login-title { font-size: 1.5rem; line-height: 2rem; font-weight: 700; color: var(--text); margin: 1rem 0 0.5rem; }
:where(.login-shell) .btn { min-height: 2.25rem; padding: 0.4375rem 0.875rem; font-size: 0.875rem; line-height: 1.25rem; font-weight: 600; border-radius: 0.5rem; }
:where(.login-shell) .btn-sm { min-height: 1.875rem; padding: 0.3125rem 0.625rem; font-size: 0.8125rem; line-height: 1.125rem; }
:where(.login-shell) .form-control:not(textarea), :where(.login-shell) .form-select { height: 2.25rem; padding: 0.375rem 0.75rem; font-size: 0.875rem; border-radius: 0.5rem; }
:where(.login-shell) .form-label { font-size: 0.8125rem; font-weight: 500; color: var(--text-2); margin-bottom: 0.375rem; }
:where(.login-shell) .form-text { font-size: 0.75rem; color: var(--text-muted); }
:where(.login-shell) .login-container a:not(.btn) { color: var(--text); font-weight: 500; }
:where(.login-shell) .login-container a:not(.btn):hover { color: var(--text); text-decoration: underline; }

/* The parts the pages share: the logo, the form column, a narrow message column and the state icon. */
:where(.login-shell) .login-logo { max-height: 60px; }
:where(.login-shell) .login-form { width: 100%; max-width: 400px; }
:where(.login-shell) .login-narrow { max-width: 560px; }
:where(.login-shell) .login-state-icon { font-size: 2.5rem; line-height: 1; color: var(--text-muted); }

/* The brand panel beside the forms: charcoal with the red blooms, as the sign-in page's (dark is the brand). */
:where(.login-shell) .login-brand { position: relative; overflow: hidden; background: var(--charcoal-950); color: var(--shell-text); }
:where(.login-shell) .login-brand::before, :where(.login-shell) .login-brand::after { content: ''; position: absolute; pointer-events: none; }
:where(.login-shell) .login-brand::before { top: -20%; right: -15%; width: 75%; height: 60%; background: radial-gradient(closest-side, rgba(var(--ic-red-rgb), 0.20) 0%, rgba(var(--ic-red-rgb), 0.05) 50%, transparent 78%); }
:where(.login-shell) .login-brand::after { bottom: -25%; left: -15%; width: 65%; height: 55%; background: radial-gradient(closest-side, rgba(var(--ic-red-rgb), 0.10) 0%, rgba(var(--ic-red-rgb), 0.02) 55%, transparent 80%); }
:where(.login-shell) .login-brand > * { position: relative; z-index: 1; }
:where(.login-shell) .login-brand h3 { font-size: 1.5rem; font-weight: 700; color: var(--shell-text); }
:where(.login-shell) .login-brand .lead { font-size: 1rem; color: rgba(255, 255, 255, 0.8); }
:where(.login-shell) .login-brand li { color: rgba(255, 255, 255, 0.9); }
:where(.login-shell) .login-brand li i { color: var(--ic-red); }
:where(.login-shell) .login-brand-icon { display: inline-flex; align-items: center; justify-content: center; width: 4.5rem; height: 4.5rem; margin-bottom: 1.5rem; border-radius: 1rem; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); }
:where(.login-shell) .login-brand-icon i { font-size: 2rem; color: var(--ic-red); }

/* The live password checklist (reset password, accept invitation). [MAX1-410] */
:where(.login-shell) .password-rules { margin-top: 5px; font-size: 0.875rem; }
:where(.login-shell) .password-rules li { display: flex; align-items: baseline; gap: 0.5rem; padding: 1px 0; }
:where(.login-shell) .password-rules .password-rule-icon { flex: 0 0 1em; text-align: center; }

:where(.login-shell) .login-container {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: calc(100vh - 32px); /* Account for bottom toolbar */
}

:where(.login-shell) .login-box {
    max-width: 550px;
    width: 100%;
    background: var(--surface);
    border-radius: 12px;
    padding: 3rem 2.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 10;
    position: relative;
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

:where(.login-shell) .login-header {
    text-align: center;
    margin-bottom: 2.5rem;
    flex-shrink: 0;
}

/* [TYPE-1] The page title 24/700, as .login-title on the other pages of this shell. */
:where(.login-shell) .login-header h2 {
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 700;
    color: var(--text);
}

:where(.login-shell) .login-header p {
    margin-bottom: 0;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--text-muted);
}

:where(.login-shell) .login-form-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* ── B. EnhancedLogin (Pages/Account/EnhancedLogin, on the shell above) ───
   [COLOR-2] Neutral hover and selected states (they were Bootstrap blue). */
.enhanced-login .user-type-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    height: 100%;
}

.enhanced-login .user-type-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 4px 8px rgba(7, 8, 11, 0.08);
    transform: translateY(-2px);
}

.enhanced-login .user-type-card.selected {
    border-color: var(--text);
    background-color: var(--bs-light);
    box-shadow: 0 4px 12px rgba(7, 8, 11, 0.12);
}

.enhanced-login .login-box {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.enhanced-login .form-check-label strong {
    display: block;
    margin-bottom: 0.25rem;
}

.enhanced-login .user-type-card .btn {
    pointer-events: none;
}

/* ── C. Tailwind sign-in shell (_MetronicLoginLayout) ───────────────────
   [CODE-1, COLOR-2] The brand panel and the language links on the brand tokens (styles.css). The panel stays charcoal
   in both themes: dark is the brand. */
:where(.signin-shell) .login-brand { background: var(--charcoal-950); }
:where(.signin-shell) .login-brand h1 { color: var(--shell-text); }
:where(.signin-shell) .login-bloom { position: absolute; pointer-events: none; }
:where(.signin-shell) .login-bloom-a { top: -20%; right: -15%; width: 75%; height: 60%; background: radial-gradient(closest-side, rgba(var(--ic-red-rgb), 0.20) 0%, rgba(var(--ic-red-rgb), 0.05) 50%, transparent 78%); }
:where(.signin-shell) .login-bloom-b { bottom: -25%; left: -15%; width: 65%; height: 55%; background: radial-gradient(closest-side, rgba(var(--ic-red-rgb), 0.10) 0%, rgba(var(--ic-red-rgb), 0.02) 55%, transparent 80%); }
:where(.signin-shell) .login-pattern { opacity: 0.05; }
:where(.signin-shell) .login-edge { top: 0; bottom: 0; right: 0; width: 1px; background: linear-gradient(to bottom, transparent 0%, rgba(var(--ic-red-rgb), 0.45) 50%, transparent 100%); }
:where(.signin-shell) .login-feature-plate { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); }
:where(.signin-shell) .login-feature-plate i { color: var(--ic-red); }
:where(.signin-shell) .login-canvas { background: var(--surface-page); }
:where(.signin-shell) .login-lang, :where(.signin-shell) .login-lang a { color: var(--text-muted); }
:where(.signin-shell) .login-lang a[aria-current="true"] { color: var(--text); font-weight: 600; }

/* The sign-in page's two door cards (Pages/Account/Login): equal height, and the titles (whole sentences from the
   visitor's side) and descriptions start at the same height in both. [TIM1-14] */
:where(.signin-shell) .user-type-card { display: flex; }
:where(.signin-shell) .user-type-card .card { display: flex; flex-direction: column; width: 100%; }
:where(.signin-shell) .user-type-card .card-title { min-height: 3rem; max-width: 100%; display: flex; align-items: center; justify-content: center; text-align: center; margin: 0 auto 0.5rem auto; }
:where(.signin-shell) .user-type-card .card-description { min-height: 5rem; flex-grow: 1; margin-bottom: 1rem; display: flex; align-items: flex-start; justify-content: center; }

/* ── D. Sign-out page (Pages/Account/Logout, no layout) ──────────────────
   It loads Bootstrap from its CDN only, not css/styles.css, so the brand tokens are declared here: without them
   var(--ic-red) resolved to nothing and "Opnieuw inloggen" was white text on a transparent button. [SANNE-101] */
html.logout-page {
    --ic-red: #FA1740;
    --ic-red-rgb: 250, 23, 64;
    --ic-red-hover: #D10F33;
    --shell-text: #FFFFFF;
    --surface: #FFFFFF;
    --text: #0B0D12;
    --text-2: #3E4554;
    --text-muted: #646C7C;
}

/* The light background of the other sign-in pages (_LoginLayout), no longer the off-brand purple gradient. [SANNE-101] */
:where(.logout-page) body {
    background: var(--bs-light);
    min-height: 100vh;
    margin: 0;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    color: var(--text);
}

/* [TYPE-1] The page title 24/700, as on the sign-in pages. */
:where(.logout-page) .logout-container h2 {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 700;
}

:where(.logout-page) .logout-container {
    background: var(--surface);
    border-radius: 12px;
    border-top: 4px solid var(--ic-red);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 3rem 2.5rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    animation: logout-fade-in 0.5s ease-in;
}

@media (max-width: 575.98px) {
    :where(.logout-page) .logout-container { padding: 2rem 1.25rem; }
}

@keyframes logout-fade-in {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

:where(.logout-page) .logout-logo {
    max-height: 48px;
    max-width: 100%;
    margin-bottom: 1.5rem;
}

/* [COLOR-1] The icon is muted: red is for the one primary action ("Opnieuw inloggen"). */
:where(.logout-page) .logout-icon {
    font-size: 2.5rem;
    line-height: 1;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* Bootstrap 5.3 paints .btn from these variables in every state (normal, hover, focus, active), so setting them
   keeps the button red with a white label in all of them - also on a touch screen that never hovers. */
:where(.logout-page) .btn-primary {
    --bs-btn-color: var(--shell-text);
    --bs-btn-bg: var(--ic-red);
    --bs-btn-border-color: var(--ic-red);
    --bs-btn-hover-color: var(--shell-text);
    --bs-btn-hover-bg: var(--ic-red-hover);
    --bs-btn-hover-border-color: var(--ic-red-hover);
    --bs-btn-focus-shadow-rgb: var(--ic-red-rgb);
    --bs-btn-active-color: var(--shell-text);
    --bs-btn-active-bg: var(--ic-red-hover);
    --bs-btn-active-border-color: var(--ic-red-hover);
    color: var(--shell-text);
    background-color: var(--ic-red);
    border-color: var(--ic-red);
    /* [BTN-1] 36 high, 14/600, radius 8: the portal's one button size. */
    min-height: 2.25rem;
    padding: 0.4375rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    border-radius: 0.5rem;
}

:where(.logout-page) .btn-primary:hover,
:where(.logout-page) .btn-primary:focus-visible {
    color: var(--shell-text);
    background-color: var(--ic-red-hover);
    border-color: var(--ic-red-hover);
}

/* The way out of the portal is a quiet text link that names where it goes, under the red sign-in button. */
:where(.logout-page) .logout-website-link {
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
}

:where(.logout-page) .logout-website-link:hover,
:where(.logout-page) .logout-website-link:focus-visible {
    color: var(--text-2);
    text-decoration: underline;
}

/* "Het onthouden e-mailadres vergeten" sits inside a sentence, so it is underlined to read as a link. [RW-8-6] */
:where(.logout-page) .logout-forget-link {
    color: var(--text-2);
    font-weight: 500;
    text-decoration: underline;
}

:where(.logout-page) .logout-forget-link:hover,
:where(.logout-page) .logout-forget-link:focus-visible {
    color: var(--ic-red-hover);
}
