/* ═══════════════════════════════════════════════════════════════════════════════
   WebClientBase Design System - Enterprise B2B
   Architecture: Primitives -> Semantics -> Components
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
    /* ═════════════════════════════════════════════════════════════════════════
       1. PRIMITIVES (Raw Color Palettes)
       Do NOT use these directly in components. Use Semantic Tokens instead.
       ═════════════════════════════════════════════════════════════════════════ */

    /* Neutral (Zinc) */
    --primitive-neutral-0: #ffffff;
    --primitive-neutral-50: #fafafa;
    --primitive-neutral-100: #f4f4f5;
    --primitive-neutral-200: #e4e4e7;
    --primitive-neutral-300: #d4d4d8;
    --primitive-neutral-400: #a1a1aa;
    --primitive-neutral-500: #71717a;
    --primitive-neutral-600: #52525b;
    --primitive-neutral-700: #3f3f46;
    --primitive-neutral-800: #27272a;
    --primitive-neutral-900: #18181b;
    --primitive-neutral-950: #09090b;

    /* Brand (Blue/Indigo based for Enterprise Trust) */
    --primitive-brand-500: #18181b;
    /* Using Black as luxury/premium brand */
    --primitive-brand-600: #000000;

    /* Utility */
    --primitive-white: #ffffff;
    --primitive-black: #000000;
    --primitive-overlay: rgba(0, 0, 0, 0.4);

    /* Typography */
    --font-heading: 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-24: 6rem;

    /* ═════════════════════════════════════════════════════════════════════════
       2. SEMANTIC TOKENS (Light Mode Default)
       Use these in your CSS.
       ═════════════════════════════════════════════════════════════════════════ */

    /* Backgrounds */
    --bg-page: var(--primitive-neutral-50);
    /* Main page background */
    --bg-surface: var(--primitive-white);
    /* Cards, Panels */
    --bg-surface-hover: var(--primitive-neutral-50);
    --bg-overlay: rgba(255, 255, 255, 0.9);
    /* Glassmorphism base */

    /* Gradients */
    --brand-gradient: linear-gradient(135deg, #18181b 0%, #52525b 100%);
    /* Zinc-900 to Zinc-600 */

    /* Text */
    --text-primary: var(--primitive-neutral-900);
    /* Headings, Body */
    --text-secondary: var(--primitive-neutral-600);
    /* Subtitles */
    --text-tertiary: var(--primitive-neutral-400);
    /* Placeholders, disabled */
    --text-inverse: var(--primitive-white);
    /* Text on primary buttons */

    /* Borders */
    --border-subtle: var(--primitive-neutral-200);
    --border-strong: var(--primitive-neutral-300);

    /* Actions */
    --action-primary-bg: var(--primitive-neutral-900);
    --action-primary-bg-hover: var(--primitive-neutral-700);
    --action-primary-text: var(--primitive-white);

    --action-secondary-bg: var(--primitive-white);
    --action-secondary-bg-hover: var(--primitive-neutral-50);
    --action-secondary-text: var(--primitive-neutral-900);
    --action-secondary-border: var(--primitive-neutral-200);

    /* Status */
    --border-radius-base: 4px;
    --border-radius-lg: 8px;
    --border-radius-xl: 12px;
}

/* ═════════════════════════════════════════════════════════════════════════
   3. DARK MODE RE-MAPPING
   ═════════════════════════════════════════════════════════════════════════ */
[data-theme="dark"],
:root[data-theme="dark"] {
    /* Backgrounds */
    --bg-page: var(--primitive-neutral-950);
    --bg-surface: var(--primitive-neutral-900);
    --bg-surface-hover: var(--primitive-neutral-800);
    --bg-overlay: rgba(9, 9, 11, 0.9);

    /* Gradients */
    --brand-gradient: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
    /* White to Zinc-400 */

    /* Text */
    --text-primary: var(--primitive-neutral-50);
    --text-secondary: var(--primitive-neutral-400);
    --text-tertiary: var(--primitive-neutral-600);
    --text-inverse: var(--primitive-neutral-950);

    /* Borders */
    --border-subtle: var(--primitive-neutral-800);
    --border-strong: var(--primitive-neutral-700);

    /* Actions */
    --action-primary-bg: var(--primitive-neutral-50);
    --action-primary-bg-hover: var(--primitive-neutral-200);
    --action-primary-text: var(--primitive-neutral-950);

    --action-secondary-bg: var(--primitive-neutral-900);
    --action-secondary-bg-hover: var(--primitive-neutral-800);
    --action-secondary-text: var(--primitive-neutral-50);
    --action-secondary-border: var(--primitive-neutral-700);
}

/* ═════════════════════════════════════════════════════════════════════════
   4. GLOBAL RESET & BASE STYLES
   ═════════════════════════════════════════════════════════════════════════ */
html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: var(--bg-page) !important;
    color: var(--text-primary) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-top: 0;
}

/* ═════════════════════════════════════════════════════════════════════════
   5. COMPONENT UTILITIES
   ═════════════════════════════════════════════════════════════════════════ */

/* Unified Navigation Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-overlay);
    backdrop-filter: blur(16px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.nav-overlay-link {
    font-size: var(--text-3xl);
    /* Large, legible type */
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    margin: var(--space-4) 0;
    transition: color 0.2s ease;
}

.nav-overlay-link:hover {
    color: var(--text-secondary);
}

/* Hero Section */
.hero-section {
    padding: var(--space-24) var(--space-6);
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-headline {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-6);
    letter-spacing: -0.02em;
}

.hero-subtext {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto var(--space-8);
}

.hero-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    margin-bottom: var(--space-12);
}

/* Buttons */
.btn-enterprise-primary {
    background-color: var(--action-primary-bg);
    color: var(--action-primary-text);
    padding: var(--space-3) var(--space-8);
    border-radius: var(--border-radius-base);
    font-weight: 600;
    text-decoration: none;
    border: none;
    transition: background-color 0.2s;
    cursor: pointer;
}

.btn-enterprise-primary:hover {
    background-color: var(--action-primary-bg-hover);
}

.btn-enterprise-secondary {
    background-color: var(--action-secondary-bg);
    color: var(--action-secondary-text);
    border: 1px solid var(--action-secondary-border);
    padding: var(--space-3) var(--space-8);
    border-radius: var(--border-radius-base);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
    cursor: pointer;
}

.btn-enterprise-secondary:hover {
    background-color: var(--action-secondary-bg-hover);
}

/* Image Placeholders */
.image-placeholder {
    background-color: var(--bg-surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--border-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    overflow: hidden;
    position: relative;
}

.hero-image-placeholder {
    width: 100%;
    height: 500px;
    /* Large banner */
    margin-top: var(--space-8);
}

.service-icon-placeholder {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-4);
    border-radius: var(--border-radius-lg);
    background-color: var(--bg-surface-hover);
}

/* Solutions Grid */
.solutions-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    /* Mobile First */
    gap: var(--space-8);
    max-width: 1200px;
    margin: var(--space-16) auto;
    padding: 0 var(--space-6);
}

@media (min-width: 768px) {
    .solutions-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2x2 on Tablet/Desktop */
    }
}

.solution-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: var(--space-8);
    border-radius: var(--border-radius-xl);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.solution-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

.solution-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-3);
}

.solution-desc {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

/* Trust Section */
.trust-section {
    padding: var(--space-16) 0;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.trust-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-8);
}

/* MudBlazor Overrides for Dark Mode Button Text */
[data-theme="dark"] .mud-button-filled-primary {
    color: var(--action-primary-text) !important;
}

/* Hardened Overrides for Dark Mode Text Visibility */
[data-theme="dark"] .nav-overlay-link {
    color: var(--primitive-neutral-50) !important;
    /* Force White */
}

[data-theme="dark"] .btn-enterprise-secondary {
    background-color: var(--primitive-neutral-900) !important;
    color: var(--primitive-neutral-50) !important;
    /* Force White */
    border-color: var(--primitive-neutral-700) !important;
}

/* ═════════════════════════════════════════════════════════════════════════
   6. AUTHENTICATION COMPONENTS
   ═════════════════════════════════════════════════════════════════════════ */

/* Auth Container */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
    padding: var(--space-6);
}

/* Auth Card */
.auth-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius-xl);
    padding: var(--space-12);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
}

.auth-footer {
    margin-top: var(--space-6);
    text-align: center;
    color: var(--text-secondary);
    display: flex;
    gap: var(--space-2);
    align-items: center;
    justify-content: center;
}

/* Form Components */
.form-group {
    margin-bottom: var(--space-6);
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius-base);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:hover {
    border-color: var(--border-strong);
}

.form-input:focus {
    outline: none;
    border-color: var(--action-primary-bg);
    box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.1);
}

[data-theme="dark"] .form-input:focus {
    box-shadow: 0 0 0 3px rgba(250, 250, 250, 0.1);
}

.form-input:disabled {
    background-color: var(--bg-surface-hover);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-hint {
    display: block;
    margin-top: var(--space-1);
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.checkbox-label {
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
    user-select: none;
}

.form-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--border-radius-base);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: var(--font-body);
}

.btn-primary {
    background-color: var(--action-primary-bg);
    color: var(--action-primary-text);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--action-primary-bg-hover);
}

.btn-secondary {
    background-color: var(--action-secondary-bg);
    color: var(--action-secondary-text);
    border: 1px solid var(--action-secondary-border);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--action-secondary-bg-hover);
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: var(--space-3);
}

/* Links */
.link-primary {
    color: var(--action-primary-bg);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.link-primary:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.link-secondary {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.link-secondary:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Validation */
.validation-message {
    display: block;
    margin-top: var(--space-1);
    font-size: 0.875rem;
    color: #ef4444;
}

/* Alerts */
.alert {
    padding: var(--space-4);
    border-radius: var(--border-radius-base);
    margin-top: var(--space-6);
    font-size: 0.875rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

[data-theme="dark"] .alert-success {
    background-color: #064e3b;
    color: #6ee7b7;
    border-color: #059669;
}

[data-theme="dark"] .alert-error {
    background-color: #7f1d1d;
    color: #fca5a5;
    border-color: #dc2626;
}

/* Spinners */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-subtle);
    border-top-color: var(--action-primary-bg);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12);
}

/* Success State (for verification pages) */
.success-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
}

.checkmark {
    color: #10b981;
    stroke-width: 3;
}

/* Profile Page Specific */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
}

.profile-header {
    margin-bottom: var(--space-12);
}

.profile-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.profile-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.profile-section {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius-xl);
    padding: var(--space-8);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-6);
    color: var(--text-primary);
}

.profile-actions {
    margin-top: var(--space-8);
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-subtle);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-lg {
    font-size: 1.125rem;
}

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

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

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

.mr-2 {
    margin-right: var(--space-2);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    color: var(--text-primary);
    transition: opacity 0.2s ease;
}

.theme-toggle:hover {
    opacity: 0.7;
}