/* 
   ENTERPRISE FINANCIAL PLATFORM DESIGN SYSTEM
   Centralized CSS Variables, Typography, Spacing, and Components.
*/

:root {
    /* Color System */
    --primary: #0F172A;
    --secondary: #1E293B;
    --accent: #2563EB;
    
    --success: #16A34A;
    --warning: #F59E0B;
    --danger: #DC2626;
    
    --text: #0F172A;
    --text-light: #64748B;
    
    --background: #FFFFFF;
    --surface: #F8FAFC;
    --border: #E2E8F0;

    /* Typography Scale Variables */
    --h1-size: 56px;
    --h2-size: 42px;
    --h3-size: 32px;
    --h4-size: 24px;
    --h5-size: 20px;
    --h6-size: 18px;
    --body-large-size: 18px;
    --body-size: 16px;
    --small-size: 14px;
    --caption-size: 12px;

    /* Spacing System */
    --space-4: 4px;
    --space-8: 8px;
    --space-12: 12px;
    --space-16: 16px;
    --space-24: 24px;
    --space-32: 32px;
    --space-48: 48px;
    --space-64: 64px;
    --space-80: 80px;
    --space-120: 120px;
}

body {
    font-family: 'DM Sans', 'Inter', sans-serif;
    color: var(--text);
    background-color: var(--background);
    line-height: 1.5;
    font-size: var(--body-size);
}

/* Typography Base */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'DM Sans', 'Inter', sans-serif;
    color: var(--primary);
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: var(--space-16);
}

h1, .h1 { font-size: var(--h1-size); letter-spacing: -0.02em; }
h2, .h2 { font-size: var(--h2-size); letter-spacing: -0.01em; }
h3, .h3 { font-size: var(--h3-size); }
h4, .h4 { font-size: var(--h4-size); font-weight: 600; }
h5, .h5 { font-size: var(--h5-size); font-weight: 600; }
h6, .h6 { font-size: var(--h6-size); font-weight: 600; }

.body-large { font-size: var(--body-large-size); }
.text-small { font-size: var(--small-size); }
.text-caption { font-size: var(--caption-size); }

/* Spacing Sections */
.section-sm { padding-block: 60px; }
.section-md { padding-block: 80px; }
.section-lg { padding-block: 120px; }

/* Premium Enterprise Card */
.enterprise-card {
    border-radius: 20px;
    background: var(--background);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: var(--space-24);
    transition: all 0.3s ease;
    will-change: transform, box-shadow;
    border: 1px solid var(--border);
}
.enterprise-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

/* Button System */
.btn-enterprise-primary {
    height: 48px;
    padding: 0 var(--space-24);
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #ffffff;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    border: none;
}
.btn-enterprise-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    color: #ffffff;
}
.btn-enterprise-primary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.btn-enterprise-primary:active {
    transform: translateY(0);
}
.btn-enterprise-primary:disabled, .btn-enterprise-primary.loading {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-enterprise-secondary {
    height: 48px;
    padding: 0 var(--space-24);
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}
.btn-enterprise-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    color: var(--primary);
}
.btn-enterprise-secondary:focus-visible {
    outline: 2px solid var(--text-light);
    outline-offset: 2px;
}
.btn-enterprise-secondary:active {
    transform: translateY(0);
}
.btn-enterprise-secondary:disabled, .btn-enterprise-secondary.loading {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Form Improvements */
.enterprise-input {
    height: 48px;
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--text);
    width: 100%;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: var(--body-size);
}
.enterprise-input:hover:not(:disabled) {
    border-color: #cbd5e1;
}
.enterprise-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.enterprise-input.error {
    border-color: var(--danger);
}
.enterprise-input.success {
    border-color: var(--success);
}
.enterprise-input:disabled {
    background: var(--surface);
    color: var(--text-light);
    cursor: not-allowed;
}
textarea.enterprise-input {
    height: auto;
    min-height: 120px;
    resize: vertical;
}

select.enterprise-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Loading Experience */
#enterprise-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--background);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
}
#enterprise-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}
.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: loader-spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin-bottom: var(--space-24);
}
.loader-brand {
    font-size: var(--h4-size);
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes loader-spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Accessibility Focus Rings Global */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* General Layout Utilities */
.text-balance { text-wrap: balance; }
