/* ========================================
   CSS Reset and Base Styles
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-color: #1e3a8a;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #0ea5e9;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --bg-dark: #0f172a;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--text-dark);
    background-color: var(--bg-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-light);
    font-size: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--primary-light);
}

.lead-text {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--text-dark);
    font-weight: 500;
}

/* ========================================
   Layout Components
   ======================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-2xl) 0;
}

.section-light {
    background-color: var(--bg-white);
}

.section-dark {
    background-color: var(--bg-light);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title {
    margin-bottom: var(--spacing-md);
    color: var(--primary-dark);
}

.section-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 0 auto var(--spacing-md);
    border-radius: var(--radius-sm);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* ========================================
   Header & Navigation
   ======================================== */

#header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.navbar {
    padding: var(--spacing-sm) 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-shrink: 0;
}

.logo-asp {
    height: 60px;
    width: auto;
}

.logo-portugal {
    height: 50px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.nav-link {
    font-weight: 500;
    color: var(--text-dark);
    padding: var(--spacing-xs) 0;
    position: relative;
    transition: color var(--transition-base);
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: var(--spacing-xs);
}

/* Remote Assistance Button */
.btn-remote-assist {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    border: none;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-remote-assist i {
    font-size: 0.85rem;
}

.btn-remote-assist:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

/* ========================================
   Hero Section
   ======================================== */

#hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    background-color: var(--primary-dark);
    background-image: 
        linear-gradient(135deg, rgba(30, 58, 138, 0.92) 0%, rgba(30, 64, 175, 0.88) 50%, rgba(14, 165, 233, 0.85) 100%),
        url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.02) 35px, rgba(255,255,255,.02) 70px);
    pointer-events: none;
}

.hero-overlay {
    width: 100%;
    padding: var(--spacing-2xl) 0;
}

.hero-content {
    text-align: center;
    color: white;
    position: relative;
    z-index: 1;
}

.hero-title {
    color: white;
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xl);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 300;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: #d97706;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   About Section
   ======================================== */

.content-wrapper {
    display: grid;
    gap: var(--spacing-xl);
}

.about-content p {
    text-align: justify;
    line-height: 1.8;
}

.highlight-box {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    margin: var(--spacing-lg) 0;
}

.highlight-box i {
    font-size: 2rem;
    color: var(--accent-color);
    flex-shrink: 0;
}

.highlight-box h3 {
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
    font-size: 1.25rem;
}

.highlight-box p {
    margin-bottom: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.stat-card {
    text-align: center;
    padding: var(--spacing-lg);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ========================================
   Services Section
   ======================================== */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.service-card {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.service-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
}

.service-title {
    color: var(--primary-dark);
    margin-bottom: var(--spacing-md);
    font-size: 1.25rem;
}

.service-description {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 0;
}

/* ========================================
   Contact Section
   ======================================== */

.contact-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.contact-info {
    display: grid;
    gap: var(--spacing-md);
}

.contact-card {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base);
}

.contact-card:hover {
    transform: translateX(5px);
}

.contact-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.5rem;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.contact-details h3 {
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
    color: var(--primary-dark);
}

.contact-details p {
    margin-bottom: 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

.contact-details a {
    color: var(--primary-color);
    font-weight: 500;
}

.contact-note {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Map Container */
.map-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.map-container iframe {
    display: block;
    border-radius: var(--radius-lg);
}

.map-link {
    position: absolute;
    bottom: var(--spacing-md);
    right: var(--spacing-md);
    background: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-base);
}

.map-link:hover {
    transform: scale(1.05);
}

.map-link a {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Contact Form */
.contact-form-wrapper {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-top: var(--spacing-xl);
}

.form-title {
    text-align: center;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-lg);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    padding: var(--spacing-sm);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: border-color var(--transition-base);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ========================================
   Footer
   ======================================== */

#footer {
    background-color: var(--bg-dark);
    color: white;
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-section h4 {
    color: white;
    margin-bottom: var(--spacing-md);
    font-size: 1.125rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.footer-logos {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.footer-logo {
    height: 40px;
    width: auto;
    opacity: 0.9;
    transition: opacity var(--transition-base);
}

.footer-logo:hover {
    opacity: 1;
}

.footer-links,
.footer-contact {
    list-style: none;
}

.footer-links li,
.footer-contact li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    transition: color var(--transition-base);
}

.footer-links a:hover {
    color: white;
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.footer-contact i {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* ========================================
   Scroll to Top Button
   ======================================== */

.scroll-to-top {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    :root {
        --spacing-xl: 2rem;
        --spacing-2xl: 3rem;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: var(--spacing-md);
        box-shadow: var(--shadow-lg);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all var(--transition-base);
    }
    
    .nav-menu.active {
        max-height: 500px;
        opacity: 1;
        padding: var(--spacing-md);
    }
    
    .nav-link {
        width: 100%;
        padding: var(--spacing-sm);
        text-align: center;
    }
    
    .btn-remote-assist {
        width: 100%;
        justify-content: center;
        margin-top: var(--spacing-xs);
    }
    
    .logo-section {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .logo-asp {
        height: 50px;
    }
    
    .logo-portugal {
        height: 40px;
    }
    
    #hero {
        min-height: 400px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-logos {
        justify-content: center;
    }
    
    .scroll-to-top {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .section {
        padding: var(--spacing-xl) 0;
    }
    
    .hero-content {
        padding: var(--spacing-md);
    }
    
    .service-card,
    .contact-card,
    .stat-card {
        padding: var(--spacing-md);
    }
    
    .contact-form-wrapper {
        padding: var(--spacing-md);
    }
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* ========================================
   Utility Classes
   ======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }