/* =====================================================
   GLOBAL RESET
   ===================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

/* =====================================================
   BRAND VARIABLES
   ===================================================== */

:root {
    /* Header brand logo height (used by the app-shell header and the login logo). */
    --wps-appbar-logo-height: 44px;

    /* Approx. height of the fixed top header bar. Consumed by dialogs that size against
       the remaining viewport (e.g. InvoiceEditorDialog). Kept after the app-shell rework. */
    --wps-site-chrome-height: calc(max(2.75rem, var(--wps-appbar-logo-height, 44px)) + 1.1rem);

    /* WPSNA semantic aliases → WPSI Fluent tokens (wpsi-fluent-theme.css) */
    --brand-accent: var(--wpsi-accent);
    --brand-accent-hover: var(--wpsi-accent-light);
    --brand-accent-soft: var(--wpsi-accent-soft);
    --brand-accent-glow: color-mix(in srgb, var(--wpsi-accent) 35%, transparent);
    --font-base: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
    --color-valid: var(--success);
    --color-invalid: var(--error);

    --wps-color-surface: var(--neutral-layer-2);
    --wps-color-on-surface: var(--neutral-foreground-rest);
    --wps-color-border: var(--neutral-stroke-rest);
    --wps-color-subtle: var(--neutral-foreground-hint);
    --wps-color-primary: var(--wpsi-accent);
}

/* =====================================================
   BASE DOCUMENT
   ===================================================== */

html, body {
    font-family: var(--font-base);
    height: 100%;
    margin: 0;
}

a {
    text-decoration: none;
}

/* =====================================================
   VALIDATION FIX FOR DARK MODE
   ===================================================== */

.validation-summary-errors {
    background-color: var(--wpsi-messagebar-error-bg);
    color: var(--wpsi-messagebar-error-text);
    padding: 1rem;
    border-radius: var(--wpsi-border-radius);
    border: 1px solid var(--wpsi-messagebar-error-border);
}

    .validation-summary-errors ul {
        margin: 0;
        padding-left: 1.2rem;
    }

.validation-message {
    color: #ff6b6b;
}

.alert-warning {
    background-color: var(--wpsi-messagebar-warning-bg) !important;
    color: var(--wpsi-messagebar-warning-text) !important;
    border: 1px solid var(--wpsi-messagebar-warning-border);
}

.alert-danger {
    background-color: var(--wpsi-messagebar-error-bg) !important;
    color: var(--wpsi-messagebar-error-text) !important;
    border: 1px solid var(--wpsi-messagebar-error-border);
}

.alert-success {
    background-color: var(--wpsi-messagebar-success-bg) !important;
    color: var(--wpsi-messagebar-success-text) !important;
    border: 1px solid var(--wpsi-messagebar-success-border);
}

.alert-info {
    background-color: var(--wpsi-messagebar-info-bg) !important;
    color: var(--wpsi-messagebar-info-text) !important;
    border: 1px solid var(--wpsi-messagebar-info-border);
}

/* =====================================================
   BLAZOR VALIDATION
   ===================================================== */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--color-valid);
}

.invalid {
    outline: 1px solid var(--color-invalid);
}

.validation-message {
    color: var(--color-invalid);
}

/* =====================================================
   BLAZOR ERROR BOUNDARY
   ===================================================== */

.blazor-error-boundary {
    background: #7f1d1d;
    padding: 1rem 1rem 1rem 3.7rem;
    color: #ffffff;
}

    .blazor-error-boundary::after {
        content: "An unexpected error has occurred.";
    }

/* =====================================================
   WPSNA THEME (layout-specific; tokens in wpsi-fluent-theme.css)
   ===================================================== */

.wps-body {
    background: var(--neutral-layer-1);
    color: var(--neutral-foreground-rest);
    height: 100%;
    overflow: hidden;
}

/* =====================================================
   ADMIN TAB SECTIONS (grouped panels under /admin tabs)
   ===================================================== */

.wps-admin-section {
    border-radius: 0.5rem;
    border: 1px solid var(--wps-color-border);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

/* Fluent dialogs render inside main; elevate above app bar / nav drawer (1020–1031). */
fluent-dialog .overlay {
    z-index: 2000;
}

/* Hidden dialogs must not leave a full-page overlay that blocks clicks (billing grids). */
fluent-dialog[hidden] .overlay,
fluent-dialog[hidden] .positioning-region {
    display: none !important;
    pointer-events: none !important;
}

fluent-dialog .positioning-region {
    z-index: 2001;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 5vh, 3rem) 0;
    box-sizing: border-box;
}

/* ============================================
   LOGIN LOGO (auth pages)
   ============================================ */

.wps-login-logo {
    height: 11.25rem;
    width: auto;
    max-width: 100%;
    display: block;
    transition: transform 0.2s ease, filter 0.2s ease;
}

    .wps-login-logo:hover {
        transform: scale(1.03);
        filter: brightness(1.08);
    }

/* Dark mode logo accent glow + depth from enhanced ribbon mark */
.wps-login-logo {
    filter:
        drop-shadow(0 4px 14px color-mix(in srgb, var(--wpsi-accent) 45%, transparent))
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
}

/* =====================================================
   LAYOUT — AccountLayout footer bar (app shell lives in wpsna-shell.css)
   ===================================================== */

.wps-footer-bar {
    flex: 0 0 auto;
    width: 100%;
    margin: 0;
    border-top: 1px solid var(--neutral-stroke-divider);
    background-color: var(--neutral-layer-2);
}

.wps-site-footer {
    margin: 0;
    padding: 0.2rem 0.5rem;
    text-align: center;
}

.wps-site-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem 0.4rem;
    margin: 0;
    padding: 0;
}

.wps-site-footer-muted,
.wps-site-footer-separator {
    color: var(--neutral-foreground-hint);
    font-size: 8pt;
    line-height: 1.2;
}

.wps-site-footer-separator {
    opacity: 0.65;
}

.wps-site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem 0.4rem;
}

.wps-site-footer-nav a {
    color: var(--neutral-foreground-hint);
    font-size: 8pt;
    text-decoration: none;
}

.wps-site-footer-nav a:hover,
.wps-site-footer-nav a:focus-visible {
    color: var(--brand-accent);
    text-decoration: underline;
}

.wps-page-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}

.wps-page-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* =====================================================
   BLAZOR GLOBAL ERROR UI (PRODUCTION SAFE)
   ===================================================== */

#blazor-error-ui {
    background: var(--neutral-layer-2);
    color: var(--wpsi-messagebar-error-text);
    padding: 1rem 1.5rem;
    border-top: 3px solid var(--error);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.4);
    font-weight: 500;
    z-index: 11000;
}

    #blazor-error-ui a.reload {
        color: var(--brand-accent);
        font-weight: 600;
        margin-left: 1rem;
    }

    #blazor-error-ui .dismiss {
        color: #ff6b6b;
        cursor: pointer;
        margin-left: 1rem;
    }

    #blazor-error-ui.show {
        display: block;
    }

/* ================================
   Admin Fade Animation
================================ */

.admin-fade {
    animation: adminFadeIn 0.25s ease-out;
}

@keyframes adminFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   Tab Loading Centering
================================ */

.admin-tab-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 0;
}

/* ================================
   Auth Indicators
================================ */
.auth-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.auth-ok {
    background-color: var(--success);
    box-shadow: 0 0 6px color-mix(in srgb, var(--success) 50%, transparent);
}

.auth-bad {
    background-color: var(--error);
    box-shadow: 0 0 6px color-mix(in srgb, var(--error) 50%, transparent);
}

/* =====================================================
   HERO AREA
   ===================================================== */

.hero-section {
    position: relative;
    height: 50vh;
    min-height: 380px;
    max-height: 520px;
    overflow: hidden;
    border-bottom: 1px solid var(--neutral-stroke-rest);
}

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.65) 45%, color-mix(in srgb, var(--wpsi-accent) 35%, transparent) 100%);
    display: flex;
    align-items: center;
    padding-left: 8%;
}

.hero-content {
    max-width: 700px;
    color: white;
}

.hero-title {
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
}

    /* FocusOnNavigate targets h1 after route changes; hero titles are not interactive. */
    .hero-section .hero-title:focus,
    .hero-section .hero-title:focus-visible {
        outline: none;
        box-shadow: none;
    }

    .hero-title .accent {
        color: var(--brand-accent);
    }

.hero-subtitle {
    margin-top: 1.5rem;
    font-size: 1.2rem;
    opacity: 0.85;
}

.hero-cta {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

/* =====================================================
   CTA BUTTONS
   ===================================================== */

.cta-primary {
    background: var(--brand-accent);
    color: white;
    padding: 0.9rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    transition: 0.3s;
}

    .cta-primary:hover {
        background: var(--brand-accent-hover);
    }

.cta-secondary {
    border: 1px solid white;
    padding: 0.9rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    color: white;
    transition: 0.3s;
}

    .cta-secondary:hover {
        background: rgba(255,255,255,0.15);
    }

/* =====================================================
   CAPABILITIES / AUTHORITY — content moved to Home.razor cards
   ===================================================== */

/* =====================================================
   TECHNOLOGY PARTNERS (home page — logo grid inside card)
   ===================================================== */

.partners-logo-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2rem 2.75rem;
    max-width: 960px;
    margin: 0 auto 1rem;
}

.partner-logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 var(--partner-logo-max-width, 180px);
    max-width: var(--partner-logo-max-width, 180px);
    min-height: var(--partner-logo-max-height, 80px);
}

.partner-logo-item img {
    display: block;
    max-width: var(--partner-logo-max-width, 180px);
    max-height: var(--partner-logo-max-height, 80px);
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.92;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.partner-logo-item a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-logo-item a:hover img,
.partner-logo-item a:focus-visible img {
    opacity: 1;
    transform: scale(1.03);
}

/* =====================================================
   CUSTOMER LOGOS (home page — logo grid inside card)
   ===================================================== */

.customers-logo-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2rem 2.75rem;
    max-width: 1200px;
    margin: 0 auto;
}

.customer-logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 var(--customer-logo-max-width, 160px);
    max-width: var(--customer-logo-max-width, 160px);
    min-height: var(--customer-logo-max-height, 72px);
}

.customer-logo-item img {
    display: block;
    max-width: var(--customer-logo-max-width, 160px);
    max-height: var(--customer-logo-max-height, 72px);
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.88;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.customer-logo-size-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--neutral-stroke-rest);
    border-radius: 0.375rem;
    background: color-mix(in srgb, var(--neutral-layer-3) 80%, transparent);
}

.customer-logo-size-preview-label {
    font-size: 0.75rem;
    color: var(--neutral-foreground-hint);
}

.customer-logo-admin-thumb {
    margin: 0 auto;
}

.customer-logo-grid-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.customer-logo-item a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.customer-logo-item a:hover img,
.customer-logo-item a:focus-visible img {
    opacity: 1;
    transform: scale(1.03);
}

.customer-testimonials {
    max-width: 1200px;
    margin: 0 auto;
}

.customer-testimonials--with-logos {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--neutral-stroke-rest);
}

.customer-testimonial-carousel {
    --testimonial-carousel-nav-width: 2rem;
    --testimonial-carousel-gap: 0.35rem;
    --testimonial-carousel-track-gap: 1.25rem;
    --testimonial-carousel-visible-cards: 2;
    --testimonial-card-min-width: 18rem;
    --testimonial-carousel-track-width: min(100%, 920px);
    display: grid;
    grid-template-columns:
        var(--testimonial-carousel-nav-width)
        minmax(0, 1fr)
        var(--testimonial-carousel-nav-width);
    align-items: center;
    gap: var(--testimonial-carousel-gap);
    width: min(100%, calc(var(--testimonial-carousel-track-width) + (2 * var(--testimonial-carousel-nav-width)) + (2 * var(--testimonial-carousel-gap))));
    margin: 0 auto;
}

.customer-testimonial-carousel-nav-spacer {
    width: var(--testimonial-carousel-nav-width);
}

.customer-testimonial-carousel-nav {
    flex-shrink: 0;
}

.customer-testimonial-carousel-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--testimonial-carousel-track-gap);
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.35rem 0.25rem 0.75rem;
}

.customer-testimonial-carousel-track::-webkit-scrollbar {
    display: none;
}

.customer-testimonial-card {
    flex: 0 0 auto;
    width: clamp(
        var(--testimonial-card-min-width),
        calc((100% - ((var(--testimonial-carousel-visible-cards) - 1) * var(--testimonial-carousel-track-gap))) / var(--testimonial-carousel-visible-cards)),
        28rem
    );
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 11rem;
    padding: 1.25rem 1.35rem;
}

.customer-testimonial-quote {
    margin: 0 0 1rem;
    padding: 0;
    border: none;
}

.customer-testimonial-quote p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--neutral-foreground-rest);
}

.customer-testimonial-quote p::before {
    content: "\201C";
    color: var(--accent-fill-rest);
    font-size: 1.35rem;
    line-height: 0;
    margin-right: 0.15rem;
    vertical-align: -0.15em;
}

.customer-testimonial-footer {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: auto;
}

.customer-testimonial-logo {
    flex-shrink: 0;
    max-width: var(--customer-logo-max-width, 96px);
    max-height: calc(var(--customer-logo-max-height, 72px) * 0.75);
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.9;
}

.customer-testimonial-attribution {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.customer-testimonial-author {
    font-style: normal;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--neutral-foreground-rest);
}

.customer-testimonial-title {
    font-size: 0.85rem;
    color: var(--neutral-foreground-hint);
}

.customer-testimonial-quote-preview {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 28rem;
    color: var(--neutral-foreground-hint);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .customer-testimonial-carousel {
        --testimonial-carousel-visible-cards: 1;
        --testimonial-carousel-nav-width: 1.75rem;
    }
}

.spotlight-info-page {
    padding: 4rem 10%;
}

.spotlight-info-container {
    max-width: 900px;
    margin: 0 auto;
}

.spotlight-info-container h1 {
    margin-bottom: 1.25rem;
}

.spotlight-info-container p {
    font-size: 1.1rem;
    line-height: 1.75;
    color: #374151;
}