html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

/* ========================================
   AVANZAMOS AFRICA - ADAPTIVE DESIGN SYSTEM
   ======================================== */

/* ----------------------------------------
   BASE CORPORATE THEME
   ---------------------------------------- */
:root {
    /* Primary - Corporate Blue */
    --primary-600: #0066CC;
    --primary-500: #0077E6;
    --primary-400: #0088FF;
    --primary-100: #E6F2FF;
    
    /* Secondary - Accent Blue */
    --secondary-500: #00A3E0;
    --secondary-100: #E6F7FC;
    
    /* Neutral - Backgrounds */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Semantic */
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Spacing */
    --section-padding: 5rem;
    --container-max: 1200px;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ----------------------------------------
   LOVIES THEME (Consumer Lifestyle)
   ---------------------------------------- */
[data-theme="lovies"] {
    --primary-600: #DB2777;
    --primary-500: #EC4899;
    --primary-400: #F472B6;
    --primary-100: #FCE7F3;
    --secondary-500: #A855F7;
    --secondary-100: #F3E8FF;
    --accent-500: #F59E0B;
    --bg-tint: #FDF2F8;
}

/* ----------------------------------------
   HEALTHCARE THEME (Guardian, Insurer)
   ---------------------------------------- */
[data-theme="healthcare"] {
    --primary-600: #0284C7;
    --primary-500: #0EA5E9;
    --primary-400: #38BDF8;
    --primary-100: #E0F2FE;
    --secondary-500: #10B981;
    --secondary-100: #D1FAE5;
    --bg-tint: #F0FDFA;
}

/* ----------------------------------------
   LOADING SCREEN
   ---------------------------------------- */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #F9FAFB 0%, #E6F2FF 100%);
    gap: 1.5rem;
}

.loading-logo {
    animation: pulse 2s ease-in-out infinite;
}

.loading-nodes {
    animation: rotate 8s linear infinite;
    transform-origin: 16px 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E6F2FF;
    border-top-color: #0066CC;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: #475569;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 500;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* ----------------------------------------
   RESET & BASE
   ---------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--white);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ----------------------------------------
   TYPOGRAPHY
   ---------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    color: var(--gray-900);
    line-height: 1.2;
    font-weight: 600;
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    color: var(--gray-600);
    max-width: 65ch;
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-500);
}

/* ----------------------------------------
   LAYOUT
   ---------------------------------------- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: var(--section-padding) 0;
}

.section-alt {
    background: var(--gray-50);
}

.text-center {
    text-align: center;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* ----------------------------------------
   HEADER / NAVIGATION
   ---------------------------------------- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    height: 40px;
    width: auto;
}

.footer-logo {
    height: 36px;
    width: auto;
    margin-bottom: 1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    color: var(--gray-600);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-600);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-600);
    transition: width 0.2s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ----------------------------------------
   BUTTONS
   ---------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--primary-600);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-500);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-600);
    border: 1px solid var(--primary-600);
}

.btn-secondary:hover {
    background: var(--primary-100);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* ----------------------------------------
   HERO SECTION
   ---------------------------------------- */
.hero {
    padding: 6rem 0;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.85), rgba(0, 76, 153, 0.9)), 
                url('../images/hero/hero-homepage.webp') center/cover no-repeat;
    color: var(--white);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero h1 {
    margin-bottom: 1.5rem;
    color: var(--white);
}

.hero p {
    font-size: 1.25rem;
    margin: 0 auto 2rem;
    color: rgba(255, 255, 255, 0.9);
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ----------------------------------------
   CARDS
   ---------------------------------------- */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-100);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary-600);
    font-size: 1.5rem;
    overflow: hidden;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Service Card Variant */
.service-card {
    display: flex;
    flex-direction: column;
}

.service-card .card-icon {
    width: 64px;
    height: 64px;
    background: transparent;
}

.card h3 {
    margin-bottom: 0.75rem;
}

.card p {
    font-size: 0.95rem;
}

/* Product Card Variant */
.product-card {
    position: relative;
    overflow: hidden;
}

.product-card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-lifestyle {
    background: #FCE7F3;
    color: #DB2777;
}

.badge-healthcare {
    background: #E0F2FE;
    color: #0284C7;
}

/* ----------------------------------------
   TECH STACK SECTION
   ---------------------------------------- */
.tech-stack {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3rem;
    margin-top: 3rem;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.tech-item svg, .tech-item img {
    width: 40px;
    height: 40px;
    opacity: 0.7;
}

/* ----------------------------------------
   CTA SECTION
   ---------------------------------------- */
.cta-section {
    background: var(--gray-900);
    color: var(--white);
    text-align: center;
    padding: 5rem 0;
}

.cta-section h2 {
    color: var(--white);
    margin-bottom: 1rem;
}

.cta-section p {
    color: var(--gray-400);
    margin: 0 auto 2rem;
}

/* ----------------------------------------
   FOOTER
   ---------------------------------------- */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer h4 {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer ul {
    list-style: none;
}

.footer li {
    margin-bottom: 0.5rem;
}

.footer a {
    color: var(--gray-400);
}

.footer a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
}

/* ----------------------------------------
   RESPONSIVE
   ---------------------------------------- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero {
        padding: 4rem 0;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .section {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* ----------------------------------------
   BLAZOR OVERRIDES
   ---------------------------------------- */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success);
}

.invalid {
    outline: 1px solid var(--error);
}

.validation-message {
    color: var(--error);
    font-size: 0.875rem;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    background: var(--error);
    color: white;
    padding: 1rem;
    z-index: 1000;
}