/* Links - Enhanced accessibility */
a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: rgba(196, 30, 58, 0.3);
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
    transition: var(--transition-normal);
    font-weight: var(--font-weight-medium);
}

a:hover,
a:focus {
    color: var(--primary-dark);
    text-decoration-color: var(--primary-dark);
    outline: none;
}

a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 3px;
}

/* External links indicator */
a[target="_blank"]::after {
    content: ' ↗';
    font-size: 0.875rem;
    opacity: 0.7;
    margin-left: 0.25rem;
}

/* Enhanced loading states and micro-interactions */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Enhanced form styles */
input, textarea, select {
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-base);
    transition: var(--transition-normal);
    background: var(--bg-primary);
    color: var(--text-primary);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

/* Badge component */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--gray-700);
}

.badge--primary {
    background: rgba(196, 30, 58, 0.1);
    color: var(--primary-dark);
}

.badge--success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.badge--warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge--error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--error);
}

/* Performance optimizations and modern features */
.hero::before {
    will-change: transform;
    contain: layout style paint;
}

.access-card,
.content-section {
    will-change: transform, box-shadow;
    contain: layout style paint;
}

.cta-button {
    will-change: transform, box-shadow;
    contain: layout style;
}


/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Focus management */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: var(--z-tooltip);
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Print styles */
@media print {
    .cta-button {
        display: none;
    }

    .hero {
        background: var(--primary);
        color: white;
        -webkit-print-color-adjust: exact;
    }

    .content-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {

    .cta-button {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero::before {
        animation: none;
    }
}