/* ============================================
   PACTAHEALTH SALES PAGE - DESIGN SYSTEM
   ============================================ */

/* CSS Variables */
:root {
    --primary: #0A4F6B;
    --primary-dark: #073A4F;
    --primary-light: #E8F4F8;
    --cta: #E8913A;
    --cta-hover: #D4802F;
    --success: #2ECC71;
    --success-light: #E8F8EE;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --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 -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --max-width: 1200px;
    --nav-height: 72px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --text-on-brand: #FFFFFF;
    --text-on-brand-muted: rgba(255, 255, 255, 0.85);
    --on-brand-muted: rgba(255, 255, 255, 0.15);
    --footer-text: rgba(255, 255, 255, 0.7);
    --footer-text-muted: rgba(255, 255, 255, 0.6);
    --footer-text-subtle: rgba(255, 255, 255, 0.5);
    --footer-rule: rgba(255, 255, 255, 0.1);
    --nav-surface: rgba(255, 255, 255, 0.95);
    --status-info-bg: #E8F4F8;
    --status-info-fg: #0A4F6B;
    --status-success-bg: #E8F8EE;
    --status-success-fg: #1F8A4C;
    --status-urgent-bg: #FFF8E7;
    --status-urgent-fg: #8A5A00;
    --focus-ring: #E8913A;

    /* MedCore HIS-compatible aliases for this standalone sales app. */
    --his-500: var(--primary);
    --his-600: var(--primary);
    --his-700: var(--primary-dark);
    --bg-canvas: var(--bg);
    --bg-surface: var(--surface);
    --border-muted: var(--border);
    --r-sm: var(--radius-sm);
    --r-md: var(--radius-md);
    --r-lg: var(--radius-lg);
    --sh-sm: var(--shadow-sm);
    --sh-md: var(--shadow-md);
    --sh-lg: var(--shadow-lg);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

[id] {
    scroll-margin-block-start: calc(var(--nav-height) + 1.25rem);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    color: var(--primary);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Blazor Error UI */
#blazor-error-ui {
    background: var(--status-urgent-bg);
    color: var(--status-urgent-fg);
    bottom: 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
    display: none;
    inset-inline-start: 0;
    padding: 1rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
    font-size: 0.875rem;
}

#blazor-error-ui .reload {
    color: var(--primary);
    font-weight: 600;
    margin-inline-start: 0.5rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    inset-inline-end: 1.5rem;
    top: 1rem;
    font-weight: 700;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-height: 44px;
}

.btn-primary {
    background: var(--cta);
    color: var(--text-on-brand);
    box-shadow: 0 4px 14px rgba(232, 145, 58, 0.35);
}

.btn-primary:hover {
    background: var(--cta-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 145, 58, 0.45);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--text-on-brand);
    transform: translateY(-2px);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

.btn-full {
    width: 100%;
}

/* Section Styles */
.section {
    padding: 4.5rem 0;
}

.section-alt {
    background: var(--surface);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3.5rem;
}

.section-header h2 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

/* Feature List */
.feature-list {
    list-style: none;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.feature-list svg {
    flex-shrink: 0;
    margin-top: 0.2rem;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

/* Grid layouts */
.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 3rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.comparison-table th,
.comparison-table td {
    padding: 1rem 1.5rem;
    text-align: start;
    border-bottom: 1px solid var(--border);
}

.comparison-table th {
    background: var(--primary);
    color: var(--text-on-brand);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table td:first-child {
    font-weight: 500;
    color: var(--text-primary);
}

.comparison-table td:not(:first-child) {
    text-align: center;
}

.comparison-table caption {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* FAQ Accordion */
.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
}

.faq-question {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 0;
    text-align: start;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
    transition: var(--transition);
    font-family: inherit;
}

.faq-question:hover {
    color: var(--primary);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    color: var(--text-secondary);
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding-top: 1rem;
}

.faq-answer[hidden] {
    display: none;
}

.faq-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Responsive */
@media (min-width: 640px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .section {
        padding: 5.5rem 0;
    }

    .section-header h2 {
        font-size: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .container {
        padding: 0 2rem;
    }
}

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.hidden { display: none; }
