﻿/* AuthCore Portal — App-level CSS
   Design tokens and theme colors are provided by BlazorUI.Radzen CSS (loaded in App.razor).
   This file contains only app-specific overrides and defaults. */

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--aspire-font-family-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --auth-portal-glow: 0 0 0 1px color-mix(in srgb, var(--auth-accent, #98131B), transparent 65%), 0 0 24px color-mix(in srgb, var(--auth-accent, #98131B), transparent 78%);
}

/* ── AuthCore design tokens ──────────────────────────────────────────
   Single source of truth for every page that lives inside AuthLayout.
   Page-level scoped stylesheets must consume these via var(--auth-*).
   Mirrors Aspire.Bootstrap/specs/shared/design/DESIGN.md. */
.auth-layout {
    --auth-bg: #0a0a0c;
    --auth-card: #161618;
    --auth-card-border: #26262a;
    --auth-card-shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
    --auth-text: #f4f4f5;
    --auth-text-muted: #a1a1aa;
    --auth-text-faint: #71717a;
    --auth-on-accent: #ffffff;
    --auth-accent: #98131B;
    --auth-accent-hover: #b21923;
    --auth-accent-soft-bg: rgba(152, 19, 27, 0.18);
    --auth-accent-soft-border: rgba(152, 19, 27, 0.6);
    --auth-accent-focus-ring: rgba(152, 19, 27, 0.2);
    --auth-error-border: var(--auth-accent-soft-border);
    --auth-error-bg: var(--auth-accent-soft-bg);
    --auth-error-text: var(--auth-text);
    --auth-error-inline-border: #8f3138;
    --auth-error-inline-bg: rgba(143, 49, 56, 0.07);
    --auth-error-inline-text: #d8d2d4;
    --auth-input-bg: #1f1f23;
    --auth-input-border: #2e2e33;
    --auth-input-border-hover: #3f3f45;
    --auth-input-border-focus: var(--auth-accent);
    --auth-divider: #222226;
    --auth-tag-bg: #26262a;
    --auth-tag-text: #a1a1aa;
    --auth-success-bg: rgba(34, 197, 94, 0.16);
    --auth-success-border: rgba(34, 197, 94, 0.4);
    --auth-success-text: #bbf7d0;
    --auth-footer-bg: #000;
    --auth-footer-border: #1a1a1d;
}

html {
    background: var(--aspire-surface);
}

body {
    min-height: 100vh;
    background: var(--aspire-surface);
    color: var(--aspire-text-primary);
}

html[data-bs-theme="light"],
body[data-bs-theme="light"] {
    background: var(--aspire-surface) !important;
    background-color: var(--aspire-surface) !important;
}

html[data-bs-theme="dark"],
body[data-bs-theme="dark"] {
    background: var(--aspire-surface) !important;
    background-color: var(--aspire-surface) !important;
}

html[data-bs-theme="brand"],
body[data-bs-theme="brand"] {
    background: var(--aspire-surface) !important;
    background-color: var(--aspire-surface) !important;
}

input::placeholder,
textarea::placeholder {
     color: var(--aspire-text-muted);
     opacity: 1;
}

/* Suppress focus outline on heading focus targets (FocusOnNavigate) */
h1:focus {
    outline: none;
}

a {
    color: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.8rem;
    padding: 0.7rem 1.1rem;
    border: 2px solid transparent;
    border-radius: 2px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--auth-portal-glow);
}

.btn:disabled {
    opacity: 0.66;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--auth-accent, var(--aspire-primary));
    border-color: var(--auth-accent, var(--aspire-primary));
    color: var(--auth-on-accent, var(--aspire-primary-foreground));
    box-shadow: 0 0 18px color-mix(in srgb, var(--auth-accent, var(--aspire-primary)), transparent 78%);
}

.btn-primary:hover:not(:disabled) {
    background: var(--auth-accent-hover, var(--aspire-primary-light));
    border-color: var(--auth-accent-hover, var(--aspire-primary-light));
    color: var(--auth-on-accent, var(--aspire-primary-foreground));
}

.btn-outline,
.btn-link {
    background: var(--aspire-button-outline-bg, transparent);
    border-color: var(--aspire-button-outline-border, var(--auth-accent, var(--aspire-primary)));
    color: var(--aspire-button-outline-fg, var(--auth-accent, var(--aspire-primary)));
    box-shadow: none;
}

.btn-outline:hover:not(:disabled),
.btn-link:hover:not(:disabled) {
    background: var(--aspire-button-outline-bg, transparent);
    border-color: var(--aspire-button-outline-border, var(--auth-accent, var(--aspire-primary)));
    color: var(--aspire-button-outline-fg, var(--auth-accent, var(--aspire-primary)));
    box-shadow: 0 0 20px var(--aspire-button-outline-glow, rgba(37, 99, 235, 0.35));
}

/* ── Auth base components (Plan 337 Tier B) ─────────────────────────
   Shared chrome for every auth page card / input / primary button.
   Page-scoped subclasses (.login-page-card, .setup-page-card,
   .forgot-page-card, .reset-page-card, etc.) MUST be layout/spacing
   /variant modifiers only — they MUST NOT restate the chrome below.
   Tokens come from .auth-layout above; this file is non-scoped, so
   these selectors compile as plain class selectors and lose any
   specificity tie to a page-scoped [b-xxx] selector. */

.auth-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 2.25rem 2rem 1.5rem;
    border: 1px solid var(--auth-card-border);
    border-radius: 8px;
    background: var(--auth-card);
    box-shadow: var(--auth-card-shadow);
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--auth-accent);
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    min-height: 2.85rem;
    padding: 0.7rem 0.95rem;
    border: 1px solid var(--auth-input-border);
    border-radius: 6px;
    background: var(--auth-input-bg);
    color: var(--auth-text);
    font-size: 0.95rem;
    line-height: 1.4;
    outline: none;
    -webkit-text-fill-color: var(--auth-text);
    caret-color: var(--auth-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder {
    color: var(--auth-text-faint);
    opacity: 1;
}

.auth-input:hover {
    border-color: var(--auth-input-border-hover);
}

.auth-input:focus,
.auth-input:focus-visible {
    border-color: var(--auth-input-border-focus);
    box-shadow: 0 0 0 3px var(--auth-accent-focus-ring);
}

.auth-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus,
.auth-input:-webkit-autofill:active {
    border: 1px solid var(--auth-input-border);
    -webkit-text-fill-color: var(--auth-text);
    caret-color: var(--auth-text);
    -webkit-box-shadow: 0 0 0 1000px var(--auth-input-bg) inset;
    box-shadow: 0 0 0 1000px var(--auth-input-bg) inset;
    transition: background-color 9999s ease-out 0s;
}

.auth-button-primary {
    width: 100%;
    min-height: 2.85rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--auth-accent);
    border-radius: 6px;
    background: var(--auth-accent);
    color: var(--auth-on-accent);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-button-primary:hover:not(:disabled),
.auth-button-primary:focus-visible {
    background: var(--auth-accent-hover);
    border-color: var(--auth-accent-hover);
    color: var(--auth-on-accent);
    box-shadow: 0 0 0 3px var(--auth-accent-focus-ring);
    outline: none;
}

.auth-button-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Shared message-card surface for ancillary auth pages (logout, lockout,
   access-denied, invalid-user, error, not-found). Matches the login card
   from DESIGN.md so the auth surface is visually consistent. */
.public-auth-card {
    display: grid;
    gap: 1.25rem;
}

.public-auth-card-header {
    display: grid;
    gap: 0.65rem;
    justify-items: center;
    text-align: center;
}

.public-auth-card-title {
    margin: 0;
    color: var(--auth-text, #f4f4f5);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.public-auth-card-subtitle {
    margin: 0;
    max-width: 30rem;
    color: var(--auth-text-muted, #a1a1aa);
    font-size: 0.92rem;
    line-height: 1.55;
}

.public-auth-card-body,
.public-auth-card-footer {
    display: grid;
    gap: 1rem;
}

.portal-message-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

.portal-message-page-letter {
    align-items: stretch;
    text-align: left;
}

.portal-message-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto;
    border: 1px solid var(--aspire-border);
    background: color-mix(in srgb, var(--aspire-surface), transparent 8%);
    box-shadow: 0 0 24px color-mix(in srgb, var(--aspire-primary), transparent 88%);
}

.portal-message-copy {
    margin: 0;
    color: var(--aspire-text-secondary);
    line-height: 1.7;
}

.portal-message-page-letter .portal-message-copy {
    max-width: none;
}

.portal-message-copy-signoff {
    color: var(--aspire-text-primary);
}

.portal-request-id {
    margin: 0 auto;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--aspire-border);
    background: color-mix(in srgb, var(--aspire-surface), transparent 10%);
    color: var(--aspire-text-secondary);
    font-size: 0.82rem;
}

.portal-request-id code {
    font-family: var(--aspire-font-family-mono);
    color: var(--aspire-text-primary);
}

.portal-action-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.portal-action-row-letter {
    justify-content: center;
}

.portal-letter-cta {
    min-height: 2.5rem;
    padding: 0.65rem 1rem;
    font-size: 0.76rem;
    letter-spacing: 0.06em;
}

.portal-eyebrow {
    margin: 0;
    color: var(--aspire-primary-light);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.account-home {
    display: grid;
    gap: 1.25rem;
}

.account-home-hero {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.account-home-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.04em;
}

.account-home-subtitle {
    margin: 0;
    max-width: 44rem;
    color: var(--aspire-text-secondary);
    line-height: 1.7;
}

.account-home-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.account-home-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.account-home-card-title {
    margin: 0 0 0.45rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.account-home-card-copy {
    margin: 0;
    color: var(--aspire-text-secondary);
    line-height: 1.6;
}

/* Blazor validation styling */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--aspire-success);
}

.invalid {
    outline: 1px solid var(--aspire-danger);
}

.validation-message {
    color: var(--aspire-danger);
    font-size: 0.85rem;
}

/* Blazor error boundary */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

@media (max-width: 640px) {
    .portal-action-row {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* ── Modal overlay (inline card-based dialogs) ───────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: color-mix(in srgb, var(--aspire-surface-sunken), transparent 58%);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.modal-card {
    width: min(calc(100vw - 2rem), var(--modal-card-width, 26.25rem));
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.35rem;
    border: 2px solid var(--aspire-border);
    border-radius: 2px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--aspire-surface-elevated), white 3%) 0%, var(--aspire-surface-elevated) 100%);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.34),
        0 0 0 1px color-mix(in srgb, var(--aspire-border), transparent 25%),
        0 0 28px color-mix(in srgb, var(--aspire-primary), transparent 88%);
}

.modal-title {
    margin: 0 0 0.9rem;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--aspire-text-primary);
}

.modal-card--compact {
    --modal-card-width: 23.75rem;
}

.modal-card--standard {
    --modal-card-width: 26.25rem;
}

.modal-card--wide {
    --modal-card-width: 30rem;
}

.modal-form {
    display: grid;
    gap: 1rem;
}

.modal-actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.25rem;
}

.modal-actions .rz-button {
    min-height: 2.75rem;
}

.modal-actions .rz-button.rz-light {
    min-width: 7.5rem;
}

.modal-actions .rz-button.rz-primary {
    min-width: 10.5rem;
}

.modal-card .theme-form-field-plain-label {
    margin-bottom: 0.45rem;
}

.modal-card .theme-form-field-plain-icon {
    color: var(--aspire-primary);
}

html[data-bs-theme="dark"] .modal-card .theme-form-field-plain-label {
    color: var(--aspire-text-primary);
}

html[data-bs-theme="dark"] .modal-card {
    box-shadow:
        0 28px 64px rgba(0, 0, 0, 0.48),
        0 0 0 1px color-mix(in srgb, var(--aspire-border), transparent 18%),
        0 0 34px color-mix(in srgb, var(--aspire-primary), transparent 84%);
}

@media (max-width: 640px) {
    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .rz-button,
    .modal-actions .rz-button.rz-light,
    .modal-actions .rz-button.rz-primary {
        width: 100%;
        min-width: 0;
    }
}
