/* ==========================================================================
   Portal-only chrome overrides
   --------------------------------------------------------------------------
   The Portal consumes the shared design system as the single source of truth
   (_content/SM360.UI/css/sm360.css). This file holds ONLY the handful of
   selectors that are genuinely Portal-specific and are NOT part of the shared
   bundle. Everything else must live in the shared sm360.css.

   Do NOT re-fork the shared bundle here. If a rule belongs to the shared
   design system, put it in src/UI/SM360.UI/wwwroot/css/sm360.css instead.
   ========================================================================== */

/* --- Screen Reader Only (Accessibility) --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Signed-out pages (sign-in, forgot password, reset password, SSO) ---
   One card for every signed-out page. Sign-in, AuthCardShell (forgot and reset password) and the
   other pages on LoginLayout all use these classes, so they cannot drift apart. Colours come from
   theme tokens: the shared bundle restates those tokens under [data-theme="dark"], and its
   [data-theme="dark"] .sm360-login-card / .sm360-login-title rules assume exactly these class names.
   The page behind the card is a fixed navy backdrop in both themes. */
.sm360-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sm360-navy) 0%, var(--sm360-navy-dark) 100%);
    padding: var(--sm360-space-4);
}

.sm360-login-card {
    width: 100%;
    max-width: 440px;
    background: var(--sm360-bg-primary);
    border-radius: var(--sm360-radius-xl);
    padding: var(--sm360-space-8);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.sm360-login-header {
    text-align: center;
    margin-bottom: var(--sm360-space-8);
}

.sm360-login-logo {
    margin-bottom: var(--sm360-space-4);
}

.sm360-login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--sm360-text-primary);
    margin: 0 0 var(--sm360-space-2);
}

.sm360-login-subtitle {
    font-size: 0.875rem;
    color: var(--sm360-text-muted);
    margin: 0;
}

/* The wordmark sits on the card, so it follows the card: --sm360-brand-name is the teal that
   clears 3:1 on both the light (#ffffff) and dark (#0f172a) card, and --sm360-text-primary is
   the card's own ink. A fixed navy "360" was 1.2:1 on the dark card. */
.sm360-wordmark-sm {
    fill: var(--sm360-brand-name);
}

.sm360-wordmark-360 {
    fill: var(--sm360-text-primary);
}

/* --- Persisted text chat --- */
/* The tenant primary color can be too light for white text. These Portal-owned text-bearing
   action surfaces use a fixed accessible color rather than weakening contrast through branding. */
.sm360-persisted-ai-chat .sm360-ai-message.user .sm360-ai-message-text,
.sm360-persisted-ai-chat .sm360-ai-send-btn {
    background: #0f766e;
    color: var(--sm360-white);
}
.sm360-persisted-ai-chat .sm360-ai-send-btn:hover:not(:disabled) {
    background: #115e59;
}
.sm360-persisted-ai-chat .sm360-ai-send-btn:focus-visible,
.sm360-persisted-ai-chat .sm360-ai-chat-header-btn:focus-visible,
.sm360-persisted-ai-chat .sm360-ai-session-item:focus-visible,
.sm360-btn-sso:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}
@keyframes sm360-agent-highlight-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.22); }
    50% { box-shadow: 0 0 0 7px rgba(13, 148, 136, 0.42); }
}

.sm360-agent-highlight {
    border-radius: 0.5rem;
    outline: 3px solid var(--sm360-primary, #0d9488);
    outline-offset: 4px;
    animation: sm360-agent-highlight-pulse 1.2s ease-in-out 3;
}

@media (prefers-reduced-motion: reduce) {
    .sm360-agent-highlight { animation: none; }
}


/* Progressive history: the oldest turns stay one click away instead of disappearing. */
.sm360-persisted-ai-chat .sm360-ai-load-earlier {
    display: block;
    margin: 0 auto var(--sm360-space-3, 12px);
    padding: 4px 12px;
    border: 1px solid var(--sm360-border, #d6d6d6);
    border-radius: 999px;
    background: transparent;
    color: var(--sm360-text-secondary, #555);
    font-size: 0.75rem;
    cursor: pointer;
}


/* A flex scroll child needs an explicit zero minimum, or a long conversation can push the
   newest message below the fold instead of scrolling. */
.sm360-persisted-ai-chat .sm360-ai-chat-messages {
    min-height: 0;
}

/* Browser assistance asks before a click that would change data. */
.sm360-ai-confirm {
    margin: 0.5rem 0.75rem;
    padding: 0.75rem 0.875rem;
    border-radius: 0.75rem;
    border: 1px solid var(--sm360-primary, #0d9488);
    background: color-mix(in srgb, var(--sm360-primary, #0d9488) 10%, transparent);
}

.sm360-ai-confirm p {
    margin: 0 0 0.5rem;
}

.sm360-ai-confirm-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* sm360#2273: the SDK checkbox is content-scoped, so a Portal page that draws its own checkbox
   gets no layout or accent. These mirror the SDK's tokens rather than inventing a second style. */
.sm360-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.sm360-checkbox-input {
    width: 16px;
    height: 16px;
    accent-color: var(--sm360-teal, #0f766e);
    cursor: pointer;
}
