/* WellBase Patient App - Global Styles */
/* Works alongside MudBlazor for a consistent healthcare questionnaire experience */

/* ==========================================
   Design Tokens - CSS Custom Properties
   Single source of truth for all design values
   Synced with Theme/DesignTokens.cs
   ========================================== */

:root {
    /* Brand Colors - Doctrinus brand (black for default theme) */
    --wb-color-brand: #000000;
    --wb-color-brand-banner: #F5F5F5;

    /* Colors - Primary (Black - Bold, Professional - Doctrinus design) */
    --wb-color-primary: #000000;
    --wb-color-primary-dark: #000000;
    --wb-color-primary-light: #333333;
    --wb-color-primary-lighter: #666666;
    --wb-color-primary-lightest: #F5F5F5;
    --wb-color-primary-bg-hover: #F5F5F5;
    --wb-color-primary-contrast: #FFFFFF;
    --wb-color-primary-alpha-8: rgba(0, 0, 0, 0.08);
    --wb-color-primary-alpha-20: rgba(0, 0, 0, 0.2);

    /* Colors - Accent (Green for status/trust - from doctrinus.de) */
    --wb-color-accent: #006400;
    --wb-color-accent-light: #10B981;
    --wb-color-accent-lightest: #ECFDF5;

    /* Colors - Secondary (Gray - from doctrinus.de) */
    --wb-color-secondary: #333333;
    --wb-color-secondary-dark: #1A1A1A;
    --wb-color-secondary-light: #666666;
    --wb-color-secondary-lighter: #999999;
    --wb-color-secondary-lightest: #DFDFDF;
    --wb-color-secondary-contrast: #FFFFFF;

    /* Colors - Tertiary (use accent green) */
    --wb-color-tertiary: #006400;
    --wb-color-tertiary-dark: #004D00;
    --wb-color-tertiary-contrast: #FFFFFF;

    /* Colors - Semantic */
    --wb-color-success: #10B981;
    --wb-color-success-dark: #059669;
    --wb-color-success-light: #34D399;
    --wb-color-success-contrast: #FFFFFF;

    --wb-color-info: #3B82F6;
    --wb-color-info-dark: #2563EB;
    --wb-color-info-light: #60A5FA;
    --wb-color-info-contrast: #FFFFFF;

    --wb-color-warning: #F59E0B;
    --wb-color-warning-dark: #D97706;
    --wb-color-warning-light: #FBBF24;
    --wb-color-warning-contrast: #FFFFFF;

    --wb-color-error: #EF4444;
    --wb-color-error-dark: #DC2626;
    --wb-color-error-light: #F87171;
    --wb-color-error-contrast: #FFFFFF;

    /* Colors - Trust Badges (semantic colors for trust indicators) */
    --wb-color-trust-green: #4CAF50;
    --wb-color-trust-green-dark: #388E3C;
    --wb-color-trust-purple: #9C27B0;
    --wb-color-trust-purple-dark: #7B1FA2;
    --wb-color-trust-blue: #2196F3;
    --wb-color-trust-blue-dark: #1976D2;

    /* RGB values for gradient overlays (use with rgba()) */
    --wb-overlay-rgb: 0, 0, 0;
    /* Black for overlays - Doctrinus design */
    --wb-white-rgb: 255, 255, 255;
    --wb-black-rgb: 0, 0, 0;

    /* Colors - Background & Surface (Pure white - Doctrinus design) */
    --wb-color-background: #FFFFFF;
    --wb-color-background-page: #FFFFFF;
    --wb-color-surface: #FFFFFF;
    --wb-color-surface-hover: #F5F5F5;

    /* Colors - Text (Doctrinus) */
    --wb-color-text-primary: #1A1A1A;
    --wb-color-text-secondary: #666666;
    --wb-color-text-disabled: #999999;
    --wb-color-text-faint: #C8C8C8;
    --wb-color-text-inverse: #FFFFFF;

    /* Colors - Borders (Light gray - from doctrinus.de) */
    --wb-color-border: #DFDFDF;
    --wb-color-border-light: #EFEFEF;

    /* Colors - Overlay */
    --wb-color-overlay-dark: rgba(30, 41, 59, 0.5);
    --wb-color-overlay-light: rgba(255, 255, 255, 0.5);

    /* Colors - Chat (Future Feature) */
    --wb-color-chat-bubble-sent: #000000;
    --wb-color-chat-bubble-received: #F5F5F5;
    --wb-color-chat-text-sent: #FFFFFF;
    --wb-color-chat-text-received: #1A1A1A;
    --wb-color-chat-timestamp: #999999;
    --wb-color-chat-online: #006400;
    --wb-color-chat-offline: #999999;
    --wb-color-chat-typing: #666666;

    /* Colors - Video (Future Feature) */
    --wb-color-video-background: #0A0A0A;
    --wb-color-video-controls-bg: rgba(0, 0, 0, 0.8);
    --wb-color-video-controls-text: #FFFFFF;
    --wb-color-video-mute: #EF4444;
    --wb-color-video-end-call: #DC2626;
    --wb-color-video-pip-border: #000000;

    /* Spacing Scale */
    --wb-space-0: 0;
    --wb-space-px: 1px;
    --wb-space-0-5: 0.125rem;
    --wb-space-1: 0.25rem;
    --wb-space-1-5: 0.375rem;
    --wb-space-2: 0.5rem;
    --wb-space-2-5: 0.625rem;
    --wb-space-3: 0.75rem;
    --wb-space-3-5: 0.875rem;
    --wb-space-4: 1rem;
    --wb-space-5: 1.25rem;
    --wb-space-6: 1.5rem;
    --wb-space-7: 1.75rem;
    --wb-space-8: 2rem;
    --wb-space-9: 2.25rem;
    --wb-space-10: 2.5rem;
    --wb-space-11: 2.75rem;
    --wb-space-12: 3rem;
    --wb-space-14: 3.5rem;
    --wb-space-16: 4rem;
    --wb-space-20: 5rem;
    --wb-space-24: 6rem;
    --wb-space-28: 7rem;
    --wb-space-32: 8rem;
    --wb-space-36: 9rem;
    --wb-space-40: 10rem;

    /* Border Radius */
    --wb-radius-none: 0;
    --wb-radius-sm: 0.125rem;
    --wb-radius-md: 0.375rem;
    --wb-radius-lg: 0.5rem;
    --wb-radius-xl: 0.75rem;
    --wb-radius-2xl: 1rem;
    --wb-radius-3xl: 1.5rem;
    --wb-radius-full: 9999px;

    /* Doctrinus-specific radius values */
    --wb-radius-button: 100px;
    /* Pill-shaped buttons (doctrinus.de style) */
    --wb-radius-input: 4px;
    /* Input fields (doctrinus.de style) */

    /* Typography - Font Family */
    --wb-font-family: 'Satoshi', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* Typography - Font Sizes */
    --wb-font-size-xs: 0.75rem;
    --wb-font-size-sm: 0.875rem;
    --wb-font-size-md: 1rem;
    --wb-font-size-lg: 1.125rem;
    --wb-font-size-xl: 1.25rem;
    --wb-font-size-2xl: 1.5rem;
    --wb-font-size-3xl: 1.875rem;
    --wb-font-size-4xl: 2.25rem;
    --wb-font-size-5xl: 3rem;

    /* Typography - Line Heights */
    --wb-line-height-none: 1;
    --wb-line-height-tight: 1.25;
    --wb-line-height-snug: 1.375;
    --wb-line-height-normal: 1.5;
    --wb-line-height-relaxed: 1.625;
    --wb-line-height-loose: 2;

    /* Typography - Font Weights */
    --wb-font-weight-thin: 100;
    --wb-font-weight-light: 300;
    --wb-font-weight-normal: 400;
    --wb-font-weight-medium: 500;
    --wb-font-weight-semibold: 600;
    --wb-font-weight-bold: 700;
    --wb-font-weight-extrabold: 800;
    --wb-font-weight-black: 900;

    /* Shadows */
    --wb-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --wb-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --wb-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --wb-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --wb-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --wb-shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
    --wb-shadow-none: none;

    /* Doctrinus shadow (subtle, 15% opacity - from doctrinus.de) */
    --wb-shadow-doctrinus: 0px 4px 20px rgba(0, 0, 0, 0.15);

    /* Doctrinus focus ring */
    --wb-shadow-focus: 0 0 0 1.5px #000000;

    /* Transitions */
    --wb-transition-fast: 150ms;
    --wb-transition-normal: 200ms;
    --wb-transition-slow: 300ms;
    --wb-transition-slower: 500ms;
    --wb-ease-default: cubic-bezier(0.4, 0, 0.2, 1);
    --wb-ease-in: cubic-bezier(0.4, 0, 1, 1);
    --wb-ease-out: cubic-bezier(0, 0, 0.2, 1);
    --wb-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-Index Scale */
    --wb-z-dropdown: 1000;
    --wb-z-sticky: 1020;
    --wb-z-fixed: 1030;
    --wb-z-modal-backdrop: 1040;
    --wb-z-modal: 1050;
    --wb-z-popover: 1060;
    --wb-z-tooltip: 1070;
    --wb-z-toast: 1080;

    /* Breakpoints (for reference in CSS) */
    --wb-breakpoint-xs: 0;
    --wb-breakpoint-sm: 600px;
    --wb-breakpoint-md: 960px;
    --wb-breakpoint-lg: 1280px;
    --wb-breakpoint-xl: 1920px;

    /* Dark Section Colors (Footer, Newsletter - from doctrinus.de) */
    --wb-color-dark-bg: #1a1a1a;
    --wb-color-dark-surface: #3a3a3a;
    --wb-color-dark-text: #FFFFFF;
    --wb-color-dark-text-muted: rgba(255, 255, 255, 0.7);
    --wb-color-dark-text-faint: rgba(255, 255, 255, 0.5);
    --wb-color-dark-border: rgba(255, 255, 255, 0.1);
    --wb-color-dark-heading: #828282;

    /* Card Radius (used in footer contact card - larger rounded corners) */
    --wb-radius-card: 20px;

    /* Component Sizes - Icons */
    --wb-size-icon-sm: 1.25rem;
    /* 20px */
    --wb-size-icon-md: 2.5rem;
    /* 40px */
    --wb-size-icon-lg: 3rem;
    /* 48px */
    --wb-size-icon-xl: 3.5rem;
    /* 56px */

    /* Component Sizes - Form Elements */
    --wb-size-checkbox: 1.5rem;
    /* 24px */

    /* Component Heights - Buttons */
    --wb-height-button-lg: 3.5rem;
    /* 56px */

    /* Layout Spacing - Logo balance (for centering logo with back button) */
    --wb-space-logo-balance: 5rem;
    /* 80px */
    --wb-space-logo-balance-mobile: 3.75rem;
    /* 60px */

    /* Selection Button States (for medication pills, option cards, etc.) */
    --wb-color-selection-default-bg: #FFFFFF;
    /* White background (default state) */
    --wb-color-selection-default-text: #000000;
    /* Black text (default state) */
    --wb-color-selection-hover-bg: #F5F5F5;
    /* Light grey background (hover state) */
    --wb-color-selection-hover-text: #000000;
    /* Black text (hover state) */
    --wb-color-selection-selected-bg: #000000;
    /* Black background (selected state) */
    --wb-color-selection-selected-text: #FFFFFF;
    /* White text (selected state) */
    --wb-radius-selection-button: 12px;
    /* Border radius for selection buttons */

    /* Classic Theme Colors - for gradients and headers */
    --wb-color-classic-primary: #002366;
    --wb-color-classic-primary-light: #003d99;
    --wb-color-classic-primary-dark: #001a4d;
}

/* Dark mode support - only applies when .dark class is added to html/body */
/* Removed prefers-color-scheme to keep light mode as default */
/* To enable dark mode, add class="dark" to <html> element */
.dark {
    --wb-color-background: #0F172A;
    --wb-color-surface: #1E293B;
    --wb-color-surface-hover: #334155;
    --wb-color-text-primary: #F8FAFC;
    --wb-color-text-secondary: #94A3B8;
    --wb-color-text-disabled: #475569;
    --wb-color-text-faint: #334155;
    --wb-color-border: #334155;
    --wb-color-border-light: #1E293B;
    --wb-color-chat-bubble-received: #1E293B;
    --wb-color-chat-text-received: #F8FAFC;
}

/* Classic theme - Navy Blue (original WellBase design) */
/* Applied when data-theme="classic" is set on html element */
[data-theme="classic"],
.theme-classic {
    /* Brand Colors */
    --wb-color-brand: #002366;
    --wb-color-brand-banner: #d0e6ff;

    /* Primary Colors - Navy Blue */
    --wb-color-primary: #002366;
    --wb-color-primary-dark: #001A4D;
    --wb-color-primary-light: #003A99;
    --wb-color-primary-lighter: #3366CC;
    --wb-color-primary-lightest: #d0e6ff;
    --wb-color-primary-bg-hover: #F0F4FA;
    --wb-color-primary-alpha-8: rgba(0, 35, 102, 0.08);
    --wb-color-primary-alpha-20: rgba(0, 35, 102, 0.2);

    /* Secondary Colors - Slate */
    --wb-color-secondary: #475569;
    --wb-color-secondary-dark: #334155;
    --wb-color-secondary-light: #64748B;

    /* Tertiary Colors - Amber */
    --wb-color-tertiary: #F59E0B;
    --wb-color-tertiary-dark: #D97706;

    /* Background & Surface */
    --wb-color-background: #FFFFFF;
    --wb-color-background-page: #f2f5fa;
    --wb-color-surface-hover: #F1F5F9;

    /* Text */
    --wb-color-text-primary: #1E293B;
    --wb-color-text-secondary: #64748B;
    --wb-color-text-disabled: #94A3B8;
    --wb-color-text-faint: #CBD5E1;

    /* Borders */
    --wb-color-border: #E2E8F0;
    --wb-color-border-light: #F1F5F9;

    /* Button radius - original rounded (not pill) */
    --wb-radius-button: 12px;
    --wb-radius-input: 8px;

    /* RGB values for gradient overlays */
    --wb-overlay-rgb: 0, 35, 102;

    /* Chat Colors - Navy themed */
    --wb-color-chat-bubble-sent: #002366;
    --wb-color-chat-bubble-received: #FFFFFF;

    /* Focus ring with navy color */
    --wb-shadow-focus: 0 0 0 3px rgba(0, 35, 102, 0.4);
}

/* Rose theme - Feminine, warm aesthetic */
/* Applied when data-theme="rose" is set on html element */
/* Using Pink 700 (#C2185B) as primary for better WCAG AA contrast (5.3:1) */
[data-theme="rose"],
.theme-rose {
    /* Primary Colors - Rose Pink (accessibility-improved) */
    --wb-color-primary: #C2185B;
    --wb-color-primary-dark: #AD1457;
    --wb-color-primary-light: #F06292;
    --wb-color-primary-lighter: #F8BBD9;
    --wb-color-primary-lightest: #FCE4EC;
    --wb-color-primary-contrast: #FFFFFF;
    --wb-color-primary-alpha-8: rgba(194, 24, 91, 0.08);
    --wb-color-primary-alpha-20: rgba(194, 24, 91, 0.2);
    --wb-color-primary-bg-hover: #FFF0F5;

    /* Secondary Colors - Mauve */
    --wb-color-secondary: #7B1FA2;
    --wb-color-secondary-dark: #6A1B9A;
    --wb-color-secondary-light: #AB47BC;
    --wb-color-secondary-lighter: #CE93D8;
    --wb-color-secondary-contrast: #FFFFFF;

    /* Tertiary Colors - Coral */
    --wb-color-tertiary: #FF7043;
    --wb-color-tertiary-dark: #E64A19;
    --wb-color-tertiary-light: #FFAB91;
    --wb-color-tertiary-contrast: #FFFFFF;

    /* Background & Surface - Rose tinted */
    --wb-color-background: #FFF8FA;
    --wb-color-surface-hover: #FFF0F5;

    /* Border Focus */
    --wb-color-border-focus: #C2185B;

    /* RGB values for gradient overlays (use with rgba()) */
    --wb-overlay-rgb: 194, 24, 91;
    /* Rose for overlays */

    /* Chat Colors - Rose themed */
    --wb-color-chat-bubble-sent: #C2185B;
    --wb-color-chat-bubble-received: #FFF0F5;

    /* Focus ring with rose color */
    --wb-shadow-focus: 0 0 0 3px rgba(194, 24, 91, 0.4);

    /* Pill buttons like Doctrinus */
    --wb-radius-button: 100px;
    --wb-radius-input: 4px;
}

/* ==========================================
   Reset & Base
   ========================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: var(--wb-font-size-md);
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: var(--wb-font-family);
    background-color: var(--wb-color-background);
    color: var(--wb-color-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure all form elements use Satoshi font */
button,
input,
select,
textarea,
optgroup {
    font-family: inherit;
}

/* Focus styles for accessibility */
h1:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--wb-color-primary);
    outline-offset: 2px;
}

/* Links */
a {
    color: var(--wb-color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--wb-color-primary-dark);
    text-decoration: underline;
}

/* Search highlight - override Bootstrap's yellow mark background */
mark.search-highlight,
.search-highlight {
    background-color: transparent;
    color: inherit;
    font-weight: 700;
    padding: 0;
}

/* Form validation states (for non-MudBlazor forms) */
.valid.modified:not([type=checkbox]) {
    outline: 2px solid var(--wb-color-success);
    outline-offset: -1px;
}

.invalid {
    outline: 2px solid var(--wb-color-error);
    outline-offset: -1px;
}

.validation-message {
    color: var(--wb-color-error);
    font-size: var(--wb-font-size-sm);
    margin-top: var(--wb-space-1);
}

/* Blazor error UI */
#blazor-error-ui {
    color-scheme: light only;
    background: #FEF3C7;
    border-top: 2px solid var(--wb-color-warning);
    bottom: 0;
    box-shadow: var(--wb-shadow-lg);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: var(--wb-space-4) var(--wb-space-6);
    position: fixed;
    width: 100%;
    z-index: var(--wb-z-toast);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: var(--wb-space-4);
    top: var(--wb-space-3);
    font-size: var(--wb-font-size-xl);
    opacity: 0.7;
}

#blazor-error-ui .dismiss:hover {
    opacity: 1;
}

#blazor-error-ui .reload {
    color: var(--wb-color-primary);
    font-weight: var(--wb-font-weight-semibold);
}

/* Blazor error boundary */
.blazor-error-boundary {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border-left: 4px solid var(--wb-color-error);
    padding: var(--wb-space-6) var(--wb-space-6) var(--wb-space-6) var(--wb-space-4);
    color: #991B1B;
    border-radius: var(--wb-radius-lg);
    margin: var(--wb-space-4);
}

.blazor-error-boundary::after {
    content: "Ein Fehler ist aufgetreten. Bitte laden Sie die Seite neu.";
}

/* ==========================================
   Branded Splash Screen / Loading Indicator
   Matches SplashScreen.razor.css for consistent UX
   ========================================== */

#loading-container {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    z-index: 1000;
}

/* Global Persistent Loading Overlay */
.global-loading-overlay {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.global-loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Logo - flies in from top (matches SplashScreen.razor) */
.loading-logo,
.global-loading-logo {
    animation: logoSlideDown 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    text-align: center;
    width: auto;
    min-width: max-content;
    opacity: 0;
}

.loading-logo-img,
.global-loading-logo-img {
    height: 48px;
    width: auto;
    display: block;
}

@keyframes logoSlideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

/* Bars - fly in from bottom (matches SplashScreen.razor) */
.loading-bars,
.global-loading-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    height: 76px;
    animation: barsSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
    opacity: 0;
}

@keyframes barsSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.loading-bar,
.global-loading-bar {
    width: 8px;
    background-color: #000000;
    border-radius: 4px;
    animation: bar-jump 1s ease-in-out infinite;
}

.loading-bar:nth-child(1),
.global-loading-bar:nth-child(1) {
    height: 28px;
    animation-delay: 0s;
}

.loading-bar:nth-child(2),
.global-loading-bar:nth-child(2) {
    height: 42px;
    animation-delay: 0.1s;
}

.loading-bar:nth-child(3),
.global-loading-bar:nth-child(3) {
    height: 56px;
    animation-delay: 0.2s;
}

.loading-bar:nth-child(4),
.global-loading-bar:nth-child(4) {
    height: 42px;
    animation-delay: 0.3s;
}

.loading-bar:nth-child(5),
.global-loading-bar:nth-child(5) {
    height: 28px;
    animation-delay: 0.4s;
}

@keyframes bar-jump {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@media (prefers-reduced-motion: reduce) {

    .loading-logo,
    .global-loading-logo {
        animation: none;
        opacity: 1;
    }

    .loading-bars,
    .global-loading-bars {
        animation: none;
        opacity: 1;
    }

    .loading-bar,
    .global-loading-bar {
        animation: none;
    }
}

@keyframes wbSplashBarsSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

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

.wb-splash-message {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    animation: wbSplashMessageSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0;
}

@keyframes wbSplashMessageSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@media (prefers-reduced-motion: reduce) {

    .wb-splash-logo,
    .wb-splash-bars,
    .wb-splash-message {
        animation: none;
        opacity: 1;
    }

    .wb-splash-bar {
        animation: none;
    }

    .wb-splash-screen {
        transition: none;
    }
}

/* Authorizing screen - matches splash screen for seamless flow */
.auth-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: radial-gradient(ellipse at center, #d0e6ff 0%, #ffffff 70%);
    gap: var(--wb-space-6, 1.5rem);
}

/* Hide chat button during auth check */
body:has(.auth-loading-container) .chat-button-container {
    display: none;
}

/* ==========================================
   Questionnaire Layout
   ========================================== */

/* Mobile-first questionnaire container */
/* Note: Layout-specific styles are in QuestionnaireTake.razor.css (scoped) */
/* This provides only basic resets that don't conflict with scoped styles */
.questionnaire-container {
    box-sizing: border-box;
}

/* Question card styling */
/* Note: Layout-specific styles (padding, margin, flex) are in QuestionnaireTake.razor.css (scoped) */
.question-card {
    background: var(--wb-color-surface);
    box-sizing: border-box;
}

/* Progress bar area */
.progress-area {
    padding: var(--wb-space-4) 0;
    position: sticky;
    top: 0;
    background: var(--wb-color-background);
    z-index: var(--wb-z-sticky);
}

/* Navigation buttons area */
.navigation-area {
    padding: var(--wb-space-4) 0;
    margin-top: auto;
    display: flex;
    gap: var(--wb-space-4);
    justify-content: space-between;
}

/* Large touch targets for mobile */
.touch-target {
    min-height: 48px;
    min-width: 48px;
}

/* ==========================================
   Selection Cards (Radio/Checkbox Options)
   ========================================== */

.selection-card {
    border: 2px solid var(--wb-color-border);
    border-radius: var(--wb-radius-xl);
    padding: var(--wb-space-4);
    cursor: pointer;
    transition: all var(--wb-transition-fast) var(--wb-ease-default);
    background: var(--wb-color-surface);
}

.selection-card:hover {
    border-color: var(--wb-color-primary);
    background: var(--wb-color-primary-bg-hover);
}

.selection-card.selected {
    border-color: var(--wb-color-primary);
    background: var(--wb-color-primary-lightest);
}

.selection-card:focus-within {
    outline: 2px solid var(--wb-color-primary);
    outline-offset: 2px;
}

/* ==========================================
   Chat Components (Future Feature)
   ========================================== */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--wb-color-background);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--wb-space-4);
    display: flex;
    flex-direction: column;
    gap: var(--wb-space-3);
}

.chat-bubble {
    max-width: 80%;
    padding: var(--wb-space-3) var(--wb-space-4);
    border-radius: var(--wb-radius-2xl);
    position: relative;
}

.chat-bubble--sent {
    background: var(--wb-color-chat-bubble-sent);
    color: var(--wb-color-chat-text-sent);
    align-self: flex-end;
    border-bottom-right-radius: var(--wb-radius-sm);
}

.chat-bubble--received {
    background: var(--wb-color-chat-bubble-received);
    color: var(--wb-color-chat-text-received);
    align-self: flex-start;
    border-bottom-left-radius: var(--wb-radius-sm);
    box-shadow: var(--wb-shadow-sm);
}

.chat-timestamp {
    font-size: var(--wb-font-size-xs);
    color: var(--wb-color-chat-timestamp);
    margin-top: var(--wb-space-1);
}

.chat-input-area {
    padding: var(--wb-space-4);
    background: var(--wb-color-surface);
    border-top: 1px solid var(--wb-color-border);
}

.chat-typing-indicator {
    color: var(--wb-color-chat-typing);
    font-size: var(--wb-font-size-sm);
    padding: var(--wb-space-2) var(--wb-space-4);
}

.chat-status--online {
    color: var(--wb-color-chat-online);
}

.chat-status--offline {
    color: var(--wb-color-chat-offline);
}

/* ==========================================
   Video Call Components (Future Feature)
   ========================================== */

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--wb-color-video-background);
    border-radius: var(--wb-radius-xl);
    overflow: hidden;
}

.video-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-pip {
    position: absolute;
    bottom: var(--wb-space-4);
    right: var(--wb-space-4);
    width: 120px;
    height: 90px;
    border-radius: var(--wb-radius-lg);
    border: 2px solid var(--wb-color-video-pip-border);
    box-shadow: var(--wb-shadow-lg);
    overflow: hidden;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--wb-space-6);
    background: var(--wb-color-video-controls-bg);
    display: flex;
    justify-content: center;
    gap: var(--wb-space-4);
}

.video-control-btn {
    width: 56px;
    height: 56px;
    border-radius: var(--wb-radius-full);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--wb-transition-fast) var(--wb-ease-default);
}

.video-control-btn:hover {
    transform: scale(1.1);
}

.video-control-btn--mute {
    background: var(--wb-color-video-mute);
    color: var(--wb-color-video-controls-text);
}

.video-control-btn--end {
    background: var(--wb-color-video-end-call);
    color: var(--wb-color-video-controls-text);
}

.video-control-btn--default {
    background: rgba(255, 255, 255, 0.2);
    color: var(--wb-color-video-controls-text);
}

/* ==========================================
   Animations & Transitions
   ========================================== */

/* Smooth page transitions */
.page-transition {
    animation: fadeIn var(--wb-transition-normal) var(--wb-ease-out);
}

/* Page transition classes for navigation */
.page-fade-out {
    opacity: 0;
    transition: opacity var(--wb-transition-normal) var(--wb-ease-out);
}

.page-fade-in {
    animation: pageFadeIn var(--wb-transition-normal) var(--wb-ease-out);
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s var(--wb-ease-in-out) infinite;
}

/* ==========================================
   Utility Classes
   ========================================== */

/* Button Reset - removes all default button styling for custom card buttons */
.btn-reset {
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-align: inherit;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}

/* Pillbox button shape - overrides MudBlazor button radius */
.pillbox,
.mud-button-root.pillbox {
    border-radius: 9999px !important;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: var(--wb-space-1);
}

.mt-2 {
    margin-top: var(--wb-space-2);
}

.mt-3 {
    margin-top: var(--wb-space-4);
}

.mt-4 {
    margin-top: var(--wb-space-6);
}

.mb-1 {
    margin-bottom: var(--wb-space-1);
}

.mb-2 {
    margin-bottom: var(--wb-space-2);
}

.mb-3 {
    margin-bottom: var(--wb-space-4);
}

.mb-4 {
    margin-bottom: var(--wb-space-6);
}

.gap-1 {
    gap: var(--wb-space-1);
}

.gap-2 {
    gap: var(--wb-space-2);
}

.gap-3 {
    gap: var(--wb-space-4);
}

.gap-4 {
    gap: var(--wb-space-6);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* ==========================================
   Questionnaire Layout - Full screen, no borders
   Override MudBlazor defaults for clean questionnaire UI
   ========================================== */
.mud-layout,
.mud-main-content {
    background-color: var(--wb-color-surface) !important;
    border: none !important;
    box-shadow: none !important;
}

.questionnaire-container,
.question-card,
.card-content {
    background-color: var(--wb-color-surface) !important;
    border: none !important;
    box-shadow: none !important;
}

/* MudBlazor input adornment - faint unit text (cm, kg, etc.) */
.mud-input-adornment-text,
.mud-input-adornment-end .mud-typography,
p.mud-input-adornment-text {
    color: var(--wb-color-text-faint) !important;
    font-size: var(--wb-font-size-sm) !important;
    font-weight: 400 !important;
}

/* ==========================================
   Help List Styles (for MarkupString content)
   Global styles needed because help-list is rendered
   via MarkupString and doesn't get CSS isolation scope
   ========================================== */
.question-help .help-list {
    margin: var(--wb-space-2) 0 var(--wb-space-4) 0;
    padding-left: 0;
    list-style-type: disc;
    list-style-position: inside;
}

.question-help .help-list li {
    margin-bottom: var(--wb-space-1);
    padding-left: 0;
}

/* ==========================================
   MudBlazor Component Overrides
   ========================================== */

/* Buttons - pill shape using design token */
.mud-button-root {
    border-radius: var(--wb-radius-button) !important;
}

/* Popovers/menus - small radius */
.mud-popover {
    border-radius: 4px !important;
}

.mud-menu-list {
    border-radius: 4px !important;
}

.mud-list-item,
.mud-menu-item {
    border-radius: 0 !important;
}