/*
---
TABLE OF CONTENTS
---
1.  VARIABLES & RESET
2.  GLOBAL STYLES & TYPOGRAPHY
3.  REUSABLE COMPONENTS (Buttons, Containers, etc.)
4.  PRELOADER
5.  HEADER & NAVIGATION
6.  FOOTER
7.  HERO SECTION (Home & Page Headers)
8.  SERVICES SECTION
9.  ABOUT SECTION
10. CALCULATOR SECTION
11. TESTIMONIALS SECTION
12. CTA SECTION
13. CONTACT PAGE
14. LEGAL PAGES
15. ANIMATIONS & KEYFRAMES
16. RESPONSIVE MEDIA QUERIES
---
*/

/* 1. VARIABLES & RESET */
:root {
    --primary-color: #0B132B;
    --secondary-color: #1C2541;
    --accent-color: #00A6FB;
    --accent-hover: #0088cc;
    --text-light: #F0F0F0;
    --text-dark: #3A506B;
    --bg-light: #FFFFFF;
    --bg-medium: #F8F9FA;
    --border-color: #3a506b33;
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Montserrat', sans-serif;
    --header-height: 80px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

section {
    position: relative;
    overflow: hidden;
}

.section-padding {
    padding: 100px 0;
}

/* 2. GLOBAL STYLES & TYPOGRAPHY */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-secondary);
    color: var(--primary-color);
    line-height: 1.2;
    font-weight: 700;
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

p {
    margin-bottom: 1rem;
    max-width: 650px;
}

.text-center {
    text-align: center;
}

.text-center p {
    margin-left: auto;
    margin-right: auto;
}

.subtitle {
    display: inline-block;
    color: var(--accent-color);
    font-family: var(--font-secondary);
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-header {
    margin-bottom: 60px;
}

/* 3. REUSABLE COMPONENTS */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--bg-light);
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 166, 251, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--bg-light);
    border-color: var(--primary-color);
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--accent-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-size: 1.2rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--accent-hover);
    transform: scale(1.1);
}

/* 4. PRELOADER */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.preloader.fade-out {
    opacity: 0;
}

.preloader .loader-logo {
    margin-bottom: 20px;
}

.preloader .loader-logo img {
    width: 150px;
    filter: brightness(0) invert(1);
    animation: pulse 1.5s infinite ease-in-out;
}

.preloader .loader-bar {
    width: 200px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loader-bar::before {
    content: '';
    display: block;
    width: 0;
    height: 100%;
    background-color: var(--accent-color);
    animation: loading 2s linear infinite;
}

/* 5. HEADER & NAVIGATION */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 0;
    background-color: var(--primary-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    background-color: var(--primary-color);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-logo img {
    height: 70px;
    transition: height 0.3s ease;
    filter: brightness(0) invert(1);
}


.nav-menu {
    display: flex;
    gap: 40px;
}

.nav-link {
    color: var(--text-light);
    font-weight: 500;
    position: relative;
    padding: 10px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-light);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* 6. FOOTER */
.footer {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 80px 0 30px;
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 50px;
    margin-bottom: 60px;
}

.footer-logo img {
    height: 70px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.footer-about p {
    color: rgba(255, 255, 255, 0.7);
    max-width: 100%;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
}

.footer-links h3,
.footer-contact h3 {
    margin-bottom: 25px;
    font-size: 1.2rem;
    color: white;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links ul li a {
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    padding-left: 15px;
}

.footer-links ul li a::before {
    content: '\f0da';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.footer-links ul li a:hover {
    color: var(--accent-color);
    padding-left: 20px;
}

.footer-links ul li a:hover::before {
    opacity: 1;
}

.footer-contact ul li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.7);
}

.footer-contact ul li i {
    color: var(--accent-color);
    margin-right: 15px;
    margin-top: 5px;
    width: 20px;
    text-align: center;
}

.footer-contact ul li a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-contact ul li a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid var(--secondary-color);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.5);
}

.footer-legal a {
    margin: 0 10px;
    color: rgba(255, 255, 255, 0.5);
}

.footer-legal a:hover {
    color: var(--accent-color);
}

/* 7. HERO SECTION (Home & Page Headers) */
.hero-section {
    background-color: var(--secondary-color);
    color: var(--text-light);
    padding: 180px 0 120px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.hero-bg-shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    filter: blur(80px);
}

.hero-bg-shape.shape-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.hero-bg-shape.shape-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -50px;
    animation: float 10s ease-in-out infinite reverse;
}

.hero-bg-shape.shape-3 {
    width: 200px;
    height: 200px;
    bottom: 20%;
    right: 30%;
    opacity: 0.5;
    animation: float 6s ease-in-out infinite;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    color: var(--bg-light);
    margin-bottom: 25px;
}

.hero-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.hero-buttons .btn-secondary {
    color: var(--text-light);
    border-color: rgba(255, 255, 255, 0.5);
}

.hero-buttons .btn-secondary:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
    border-color: var(--bg-light);
}

.page-header-section {
    background-color: var(--secondary-color);
    color: var(--text-light);
    padding: 160px 0 100px;
    text-align: center;
}

.page-header-section h1 {
    color: white;
}

/* 8. SERVICES SECTION */
.services-section {
    background-color: var(--bg-medium);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.service-card {
    perspective: 1000px;
}

.service-card-inner {
    position: relative;
    width: 100%;
    height: 280px;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.service-card:hover .service-card-inner {
    transform: rotateY(180deg);
}

.service-card-front,
.service-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    padding: 40px;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.service-card-front {
    background-color: var(--bg-light);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.service-card-back {
    background-color: var(--primary-color);
    color: var(--text-light);
    transform: rotateY(180deg);
}

.service-card-back h3 {
    color: var(--bg-light);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

/* 9. ABOUT SECTION */
.about-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    align-items: center;
}

.about-image {
    position: relative;
}

.about-image img {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

.about-image-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--accent-color);
    border-radius: var(--border-radius);
    top: -20px;
    left: -20px;
    z-index: 0;
}

.about-features {
    margin-top: 30px;
    padding-left: 0;
}

.about-features li {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.about-features i {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-right: 15px;
}

/* 10. CALCULATOR SECTION */
.calculator-section {
    background-color: var(--bg-medium);
}

.calculator-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    background-color: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.calculator-form .form-group {
    margin-bottom: 25px;
}

.calculator-form .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
}

.calculator-form .form-group input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.calculator-form .form-group span {
    display: inline-block;
    margin-left: 15px;
    font-weight: 700;
    color: var(--accent-color);
    font-family: var(--font-secondary);
}

.calculator-results {
    background-color: var(--secondary-color);
    color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
}

.calculator-results h3 {
    color: white;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.result-item:last-of-type {
    border-bottom: none;
}

.result-item strong {
    font-size: 1.2rem;
    font-weight: 700;
}

.roi-highlight {
    background-color: var(--accent-color);
    color: white;
    margin: 10px -30px 0;
    padding: 15px 30px;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.roi-highlight span,
.roi-highlight strong {
    font-size: 1.3rem;
}

.calculator-results .btn {
    margin-top: auto;
    text-align: center;
}

/* 11. TESTIMONIALS SECTION */
.testimonial-slider-wrapper {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.testimonial-slider {
    position: relative;
    overflow: hidden;
    height: 350px;
}

.testimonial-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.5s ease, transform 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.testimonial-slide.active {
    opacity: 1;
    transform: translateX(0);
}

.testimonial-slide.exit {
    transform: translateX(-100%);
}

.testimonial-content {
    background-color: var(--bg-medium);
    padding: 40px;
    border-radius: var(--border-radius);
    position: relative;
    margin-bottom: 30px;
}

.testimonial-content i {
    font-size: 2rem;
    color: var(--accent-color);
    position: absolute;
    top: 20px;
    left: 30px;
    opacity: 0.5;
}

.testimonial-content p {
    font-style: italic;
    font-size: 1.1rem;
    margin: 0;
}

.testimonial-author {
    display: flex;
    align-items: center;
}

.testimonial-author img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 20px;
    border: 3px solid var(--accent-color);
}

.author-info h4 {
    margin: 0;
}

.author-info span {
    color: var(--text-dark);
}

.slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 110%;
    left: -5%;
    display: flex;
    justify-content: space-between;
}

.slider-controls button {
    background-color: white;
    border: 1px solid var(--border-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.slider-controls button:hover {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* 12. CTA SECTION */
.cta-section {
    background: linear-gradient(rgba(11, 19, 43, 0.9), rgba(11, 19, 43, 0.9)), url('https://images.unsplash.com/photo-1519389950473-47ba0277781c?q=80&w=2070&auto=format&fit=crop') no-repeat center center/cover;
    padding: 100px 0;
    color: var(--text-light);
}

.cta-content h2 {
    color: white;
}

.cta-content p {
    max-width: 600px;
    margin: 20px auto 40px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

/* 13. CONTACT PAGE */
.contact-page-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    background-color: white;
    padding: 50px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.contact-info-block h3 {
    margin-bottom: 20px;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.info-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--bg-medium);
    color: var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    margin-right: 20px;
    flex-shrink: 0;
}

.info-text h4 {
    margin-bottom: 5px;
}

.info-text p,
.info-text a {
    margin: 0;
    color: var(--text-dark);
}

.info-text a:hover {
    color: var(--accent-color);
}

.contact-form .form-row {
    display: flex;
    gap: 20px;
}

.contact-form .form-group {
    margin-bottom: 20px;
    width: 100%;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 166, 251, 0.2);
}

.contact-form textarea {
    resize: vertical;
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
    position: relative;
    max-width: 400px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.popup.show .popup-content {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

.popup-icon {
    font-size: 4rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.popup-content h3 {
    margin-bottom: 10px;
}

.popup-content p {
    margin-bottom: 30px;
}

/* 14. LEGAL PAGES */
.legal-content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 50px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.legal-content-wrapper h2 {
    margin-top: 40px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.legal-content-wrapper p,
.legal-content-wrapper li {
    line-height: 1.8;
}

.legal-content-wrapper ul {
    list-style: disc;
    padding-left: 20px;
    margin-top: 1rem;
}

.legal-content-wrapper ul li {
    margin-bottom: 10px;
}

/* 15. ANIMATIONS & KEYFRAMES */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes loading {
    0% {
        width: 0;
    }

    100% {
        width: 100%;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

.animate-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    transition-delay: var(--delay, 0s);
}

/* --- THIS IS THE FIX --- */
/* The class should be combined, not nested. */
.animate-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* 16. RESPONSIVE MEDIA QUERIES */
@media (max-width: 1024px) {
    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.2rem;
    }

    .section-padding {
        padding: 80px 0;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-wrapper {
        grid-template-columns: 1fr;
    }

    .about-image {
        max-width: 500px;
        margin: 0 auto 40px;
    }

    .calculator-wrapper {
        grid-template-columns: 1fr;
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
    }

    .footer-about {
        grid-column: 1 / -1;
    }

    .contact-page-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        flex-direction: column;
        background-color: var(--primary-color);
        width: 100%;
        height: calc(100vh - var(--header-height));
        text-align: center;
        transition: 0.3s;
        gap: 20px;
        padding-top: 40px;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 16px 0;
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .header-actions .btn {
        display: none;
    }

    .hero-section {
        padding: 150px 0 100px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-card-inner {
        height: auto;
        min-height: 250px;
    }

    .slider-controls {
        display: none;
    }

    .testimonial-slider {
        height: auto;
    }

    .footer-main {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
    }

    .contact-form .form-row {
        flex-direction: column;
        gap: 0;
    }

    .contact-page-wrapper,
    .legal-content-wrapper {
        padding: 30px 20px;
    }
}