/* OrgReach Portal - Modern Responsive Styles */

/* CSS Custom Properties with Responsive Values */
:root {
    /* Colors */
    --orgreach-primary: #823dd8;
    --orgreach-primary-dark: #6f2bb0;
    --orgreach-primary-light: #a26cf5;
    --orgreach-secondary: #5b616b;
    --orgreach-secondary-light: #bca0e6;
    --orgreach-background-light: #f8f9fb;
    --orgreach-background-dark: #23232b;
    --orgreach-card-light: #ececf2;
    --orgreach-card-dark: #39395e;
    --orgreach-accent: #02bfe7;
    --orgreach-success: #2e8540;
    --orgreach-warning: #fdb81e;
    --orgreach-danger: #d43a52;
    --orgreach-danger-light: #fe4242;
    --orgreach-neutral: #ceced2;
    --orgreach-text-light: #23232b;
    --orgreach-text-dark: #f8f9fb;
    
    /* Responsive Typography with Clamp */
    --font-size-base: clamp(0.9375rem, 0.875rem + 0.25vw, 1rem);
    --font-size-sm: clamp(0.8125rem, 0.75rem + 0.25vw, 0.875rem);
    --font-size-lg: clamp(1.0625rem, 1rem + 0.25vw, 1.125rem);
    --font-size-xl: clamp(1.1875rem, 1.125rem + 0.25vw, 1.25rem);
    --font-size-2xl: clamp(1.375rem, 1.25rem + 0.5vw, 1.5rem);
    --font-size-3xl: clamp(1.625rem, 1.5rem + 0.5vw, 1.875rem);
    --font-size-4xl: clamp(2rem, 1.75rem + 1vw, 2.5rem);
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 1.75;
    
    /* Spacing with Clamp */
    --space-xs: clamp(0.25rem, 0.2rem + 0.2vw, 0.375rem);
    --space-sm: clamp(0.5rem, 0.4rem + 0.4vw, 0.75rem);
    --space-md: clamp(1rem, 0.8rem + 0.8vw, 1.5rem);
    --space-lg: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
    --space-xl: clamp(2rem, 1.6rem + 1.6vw, 3rem);
    --space-2xl: clamp(3rem, 2.4rem + 2.4vw, 4rem);
    
    /* Container Widths */
    --container-xs: 20rem;
    --container-sm: 30rem;
    --container-md: 48rem;
    --container-lg: 64rem;
    --container-xl: 80rem;
    --container-2xl: 96rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-purple: 0 10px 40px -10px rgba(130, 61, 216, 0.3);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

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

/* Improved Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--orgreach-text-light);
    background-color: var(--orgreach-background-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 700;
    line-height: var(--line-height-tight);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    margin: 0 0 var(--space-md);
    line-height: var(--line-height-relaxed);
}

/* Unified Sticky Header - Responsive */
.orgreach-unified-header {
    background: var(--orgreach-background-dark);
    color: var(--orgreach-text-dark);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-md);
    margin: calc(var(--space-lg) * -1) calc(var(--space-lg) * -1) var(--space-lg);
}

.orgreach-header-main {
    padding: var(--space-sm) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    max-width: var(--container-2xl);
    margin: 0 auto;
}

.orgreach-header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--orgreach-text-dark);
    flex-shrink: 0;
}

.orgreach-header-logo img {
    width: clamp(2rem, 2rem + 1vw, 2.5rem);
    height: auto;
}

.orgreach-header-logo h1 {
    font-size: var(--font-size-xl);
    color: var(--orgreach-primary-light);
    margin: 0;
    display: none;
}

@media (min-width: 640px) {
    .orgreach-header-logo h1 {
        display: block;
    }
}

.orgreach-header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex: 1;
    justify-content: flex-end;
}

.orgreach-nav-links {
    display: none;
    gap: var(--space-xs);
    align-items: center;
}

@media (min-width: 768px) {
    .orgreach-nav-links {
        display: flex;
    }
}

.orgreach-nav-link {
    color: var(--orgreach-text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-sm);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    white-space: nowrap;
}

.orgreach-nav-link:hover,
.orgreach-nav-link:focus {
    background: rgba(130, 61, 216, 0.1);
    color: var(--orgreach-primary-light);
    outline: none;
}

.orgreach-nav-link.active {
    color: var(--orgreach-primary-light);
}

.orgreach-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: calc(var(--space-xs) * -1);
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: var(--orgreach-primary);
    border-radius: var(--radius-sm);
}

/* Mobile Menu Button */
.orgreach-mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: transparent;
    border: 1px solid rgba(130, 61, 216, 0.2);
    border-radius: var(--radius-md);
    color: var(--orgreach-text-dark);
    cursor: pointer;
    transition: all var(--transition-base);
}

@media (min-width: 768px) {
    .orgreach-mobile-menu-btn {
        display: none;
    }
}

.orgreach-mobile-menu-btn:hover {
    background: rgba(130, 61, 216, 0.1);
    border-color: var(--orgreach-primary);
}

/* User Menu - Responsive */
.orgreach-user-menu {
    position: relative;
}

.orgreach-user-button {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: rgba(130, 61, 216, 0.1);
    border: 1px solid rgba(130, 61, 216, 0.2);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--orgreach-text-dark);
    transition: all var(--transition-base);
    font-size: var(--font-size-sm);
}

.orgreach-user-button:hover,
.orgreach-user-button:focus {
    background: rgba(130, 61, 216, 0.2);
    border-color: var(--orgreach-primary);
    outline: none;
}

.orgreach-user-avatar {
    width: clamp(1.5rem, 1.5rem + 0.5vw, 2rem);
    height: clamp(1.5rem, 1.5rem + 0.5vw, 2rem);
    background: var(--orgreach-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.orgreach-user-button span {
    display: none;
}

@media (min-width: 640px) {
    .orgreach-user-button span {
        display: block;
    }
}

.orgreach-user-dropdown {
    position: absolute;
    top: calc(100% + var(--space-xs));
    right: 0;
    background: white;
    border: 1px solid var(--orgreach-neutral);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 12rem;
    display: none;
    overflow: hidden;
    z-index: var(--z-dropdown);
}

.orgreach-user-dropdown.active {
    display: block;
}

.orgreach-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--orgreach-text-light);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}

.orgreach-dropdown-item:hover,
.orgreach-dropdown-item:focus {
    background: var(--orgreach-background-light);
    color: var(--orgreach-primary);
    outline: none;
}

.orgreach-dropdown-divider {
    height: 1px;
    background: var(--orgreach-neutral);
    margin: var(--space-xs) 0;
}

/* Quick Access Bar - Responsive with Scroll */
.orgreach-quick-access-bar {
    background: var(--orgreach-primary);
    padding: var(--space-xs) var(--space-lg);
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    -webkit-overflow-scrolling: touch;
}

.orgreach-quick-access-bar::-webkit-scrollbar {
    height: 4px;
}

.orgreach-quick-access-bar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
}

.orgreach-quick-access-bar > span {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--font-size-sm);
    margin-right: var(--space-xs);
    flex-shrink: 0;
}

.orgreach-quick-service {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: var(--font-size-sm);
    white-space: nowrap;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.orgreach-quick-service:hover,
.orgreach-quick-service:focus {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    outline: none;
}

/* Container & Layout */
.orgreach-container {
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: var(--space-md);
}

/* Dashboard Styles - Responsive */
.orgreach-dashboard-hero {
    background: linear-gradient(135deg, var(--orgreach-primary) 0%, var(--orgreach-primary-dark) 100%);
    color: white;
    padding: var(--space-xl) var(--space-lg);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-purple);
    text-align: center;
}

.orgreach-dashboard-hero h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-xs);
    line-height: var(--line-height-tight);
}

.orgreach-dashboard-hero p {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin: 0;
}

/* Stats Grid - Responsive */
.orgreach-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-card {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--orgreach-neutral);
    transition: all var(--transition-base);
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--orgreach-primary-light);
}

.stat-icon {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-sm);
    display: block;
}

.stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--orgreach-primary);
    margin-bottom: var(--space-xs);
    line-height: var(--line-height-tight);
}

.stat-label {
    color: var(--orgreach-secondary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}

/* Services Grid - Responsive */
.services-grid,
.services-full-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.service-card,
.service-card-full {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--orgreach-neutral);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.service-card:hover,
.service-card-full:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--orgreach-primary-light);
}

.service-card::before,
.service-card-full::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--orgreach-primary), var(--orgreach-primary-light));
    transform: translateX(-100%);
    transition: transform var(--transition-base);
}

.service-card:hover::before,
.service-card-full:hover::before {
    transform: translateX(0);
}

.service-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-md);
    display: block;
}

.service-name {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--orgreach-primary);
    margin-bottom: var(--space-xs);
    line-height: var(--line-height-tight);
}

.service-description {
    color: var(--orgreach-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-md);
    line-height: var(--line-height-relaxed);
    flex-grow: 1;
}

.service-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--orgreach-success);
    font-weight: 500;
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: var(--orgreach-success);
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Settings Layout - Responsive */
.orgreach-settings-container {
    margin-top: var(--space-lg);
}

.orgreach-settings-header {
    margin-bottom: var(--space-lg);
}

.orgreach-settings-header h1 {
    font-size: var(--font-size-3xl);
    color: var(--orgreach-text-light);
    margin-bottom: var(--space-xs);
}

.orgreach-settings-header p {
    color: var(--orgreach-secondary);
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
}

.orgreach-settings-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

@media (min-width: 768px) {
    .orgreach-settings-layout {
        grid-template-columns: 16rem 1fr;
    }
}

.orgreach-settings-sidebar {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    height: fit-content;
}

@media (min-width: 768px) {
    .orgreach-settings-sidebar {
        position: sticky;
        top: calc(4rem + var(--space-md));
    }
}

.orgreach-settings-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.orgreach-settings-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--orgreach-text-light);
    transition: all var(--transition-fast);
    line-height: var(--line-height-normal);
}

.orgreach-settings-nav-item:hover,
.orgreach-settings-nav-item:focus {
    background: var(--orgreach-background-light);
    color: var(--orgreach-primary);
    outline: none;
}

.orgreach-settings-nav-item.active {
    background: var(--orgreach-primary);
    color: white;
}

.nav-icon {
    font-size: var(--font-size-xl);
    width: 2.5rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-title {
    font-weight: 600;
    margin-bottom: 0.125rem;
    font-size: var(--font-size-base);
}

.nav-desc {
    font-size: var(--font-size-sm);
    opacity: 0.8;
    line-height: var(--line-height-snug);
}

/* Form Styles - Responsive */
.orgreach-settings-form {
    max-width: var(--container-md);
}

.form-section {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--orgreach-neutral);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    font-size: var(--font-size-xl);
    color: var(--orgreach-text-light);
    margin-bottom: var(--space-md);
    line-height: var(--line-height-tight);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--orgreach-text-light);
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}

.form-control {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--orgreach-neutral);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    transition: all var(--transition-fast);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--orgreach-primary);
    box-shadow: 0 0 0 3px rgba(130, 61, 216, 0.1);
}

.form-control[readonly] {
    background: var(--orgreach-background-light);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-help {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--orgreach-secondary);
    margin-top: var(--space-xs);
    line-height: var(--line-height-relaxed);
}

/* Buttons - Responsive */
.btn {
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    white-space: nowrap;
}

.btn-primary {
    background: var(--orgreach-primary);
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--orgreach-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    outline: none;
}

.btn-secondary {
    background: var(--orgreach-secondary);
    color: white;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: var(--orgreach-secondary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    outline: none;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--orgreach-primary);
    color: var(--orgreach-primary);
    padding: calc(var(--space-sm) - 2px) calc(var(--space-lg) - 2px);
}

.btn-outline:hover,
.btn-outline:focus {
    background: var(--orgreach-primary);
    color: white;
    outline: none;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-size-sm);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

/* Loading & Notifications */
.orgreach-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    backdrop-filter: blur(4px);
}

.orgreach-loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--orgreach-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.orgreach-notification {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    background: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transform: translateX(calc(100% + var(--space-lg)));
    transition: transform var(--transition-base);
    z-index: var(--z-tooltip);
    max-width: 90vw;
}

.orgreach-notification.show {
    transform: translateX(0);
}

.orgreach-notification-success {
    border-left: 4px solid var(--orgreach-success);
}

.orgreach-notification-error {
    border-left: 4px solid var(--orgreach-danger);
}

.notification-icon {
    font-size: var(--font-size-xl);
    font-weight: bold;
    flex-shrink: 0;
}

.orgreach-notification-success .notification-icon {
    color: var(--orgreach-success);
}

.orgreach-notification-error .notification-icon {
    color: var(--orgreach-danger);
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .orgreach-header-main {
        padding: var(--space-sm) var(--space-md);
    }
    
    .orgreach-quick-access-bar {
        padding: var(--space-xs) var(--space-md);
    }
    
    .orgreach-dashboard-hero {
        padding: var(--space-lg) var(--space-md);
    }
    
    .services-grid,
    .services-full-grid {
        gap: var(--space-sm);
    }
    
    .service-card,
    .service-card-full {
        padding: var(--space-md);
    }
    
    .orgreach-notification {
        right: var(--space-sm);
        left: var(--space-sm);
        max-width: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --orgreach-background-light: #1a1a1f;
        --orgreach-card-light: #2a2a35;
        --orgreach-text-light: #f8f9fb;
        --orgreach-neutral: #4a4a5a;
    }
}

[data-theme="dark"] {
    --orgreach-background-light: #1a1a1f;
    --orgreach-card-light: #2a2a35;
    --orgreach-text-light: #f8f9fb;
    --orgreach-neutral: #4a4a5a;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible for Keyboard Navigation */
:focus-visible {
    outline: 2px solid var(--orgreach-primary);
    outline-offset: 2px;
}

/* Login Page Styles */
.orgreach-login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: var(--space-lg);
}

.orgreach-login-box {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 32rem;
    width: 100%;
    overflow: hidden;
}

.orgreach-login-header {
    background: linear-gradient(135deg, var(--orgreach-primary) 0%, var(--orgreach-primary-dark) 100%);
    color: white;
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
}

.orgreach-login-logo {
    width: clamp(4rem, 5rem + 2vw, 5rem);
    height: auto;
    margin-bottom: var(--space-md);
}

.orgreach-login-title {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-xs);
    color: white;
    font-weight: 700;
    line-height: var(--line-height-tight);
}

.orgreach-login-subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    color: white;
    margin: 0;
    line-height: var(--line-height-normal);
}

.orgreach-login-content {
    padding: var(--space-xl);
}

.orgreach-login-description {
    text-align: center;
    color: var(--orgreach-secondary);
    margin-bottom: var(--space-lg);
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
}

.orgreach-services-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.orgreach-service-preview-item {
    background: var(--orgreach-background-light);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--orgreach-text-light);
    border: 1px solid var(--orgreach-neutral);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    line-height: var(--line-height-normal);
}

.orgreach-service-preview-item .service-icon {
    font-size: var(--font-size-xl);
}

.orgreach-login-actions {
    text-align: center;
}

.orgreach-login-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-lg);
    width: 100%;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.login-icon {
    font-size: var(--font-size-xl);
}

.orgreach-login-help {
    color: var(--orgreach-secondary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    margin: 0;
}

.orgreach-login-footer {
    background: var(--orgreach-background-light);
    padding: var(--space-lg);
    text-align: center;
    border-top: 1px solid var(--orgreach-neutral);
}

.orgreach-login-footer p {
    margin: 0;
    color: var(--orgreach-secondary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}

.orgreach-link {
    color: var(--orgreach-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.orgreach-link:hover,
.orgreach-link:focus {
    text-decoration: underline;
    color: var(--orgreach-primary-dark);
}

@media (max-width: 640px) {
    .orgreach-login-container {
        padding: var(--space-md);
    }
    
    .orgreach-login-header {
        padding: var(--space-xl) var(--space-md);
    }
    
    .orgreach-login-content {
        padding: var(--space-lg);
    }
    
    .orgreach-services-preview {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print Styles */
@media print {
    .orgreach-unified-header,
    .orgreach-quick-access-bar,
    .form-actions,
    .service-launch-btn {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .service-card,
    .stat-card {
        break-inside: avoid;
    }
}

/* Support Chat Window Styles */
.orgreach-support-chat-window {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 320px;
    height: 400px;
    background: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    transition: all var(--transition-base);
}

.orgreach-support-chat-window.minimized {
    height: 48px;
}

.orgreach-support-chat-window .chat-window-header {
    background: var(--orgreach-primary);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

.orgreach-support-chat-window .chat-window-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.orgreach-support-chat-window .chat-window-title h6 {
    margin: 0;
    font-size: var(--font-size-base);
    color: white;
}

.orgreach-support-chat-window .chat-status {
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

.orgreach-support-chat-window .chat-window-actions {
    display: flex;
    gap: var(--space-xs);
}

.orgreach-support-chat-window .chat-window-actions button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    transition: all var(--transition-fast);
}

.orgreach-support-chat-window .chat-window-actions button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.orgreach-support-chat-window .chat-window-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    background: var(--orgreach-background-light);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.orgreach-support-chat-window.minimized .chat-window-messages,
.orgreach-support-chat-window.minimized .chat-window-input {
    display: none;
}

.orgreach-support-chat-window .chat-message {
    display: flex;
    margin-bottom: var(--space-xs);
}

.orgreach-support-chat-window .chat-message.own {
    justify-content: flex-end;
}

.orgreach-support-chat-window .chat-message.other {
    justify-content: flex-start;
}

.orgreach-support-chat-window .message-bubble {
    max-width: 80%;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-lg);
    position: relative;
}

.orgreach-support-chat-window .chat-message.own .message-bubble {
    background: var(--orgreach-primary);
    color: white;
}

.orgreach-support-chat-window .chat-message.other .message-bubble {
    background: white;
    color: var(--orgreach-text-light);
    border: 1px solid var(--orgreach-neutral);
}

.orgreach-support-chat-window .message-bubble p {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    white-space: pre-wrap;
}

.orgreach-support-chat-window .message-time {
    display: block;
    font-size: var(--font-size-sm);
    opacity: 0.7;
    margin-top: var(--space-xs);
}

.orgreach-support-chat-window .chat-window-input {
    padding: var(--space-sm);
    background: white;
    border-top: 1px solid var(--orgreach-neutral);
    display: flex;
    gap: var(--space-sm);
    align-items: flex-end;
}

.orgreach-support-chat-window .chat-input-field {
    flex: 1;
    min-height: 36px;
    max-height: 100px;
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--orgreach-neutral);
    border-radius: var(--radius-md);
    resize: none;
    font-family: inherit;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}

.orgreach-support-chat-window .chat-input-field:focus {
    outline: none;
    border-color: var(--orgreach-primary);
}

.orgreach-support-chat-window .chat-input-actions {
    display: flex;
    gap: var(--space-xs);
}

.orgreach-support-chat-window .chat-send-message {
    background: var(--orgreach-primary);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.orgreach-support-chat-window .chat-send-message:hover {
    background: var(--orgreach-primary-dark);
    transform: scale(1.05);
}

.orgreach-support-chat-window .chat-send-message:active {
    transform: scale(0.95);
}

/* Mobile responsiveness for chat */
@media (max-width: 640px) {
    .orgreach-support-chat-window {
        width: calc(100vw - 20px);
        right: 10px;
        max-width: 360px;
    }
}