/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    /* Allow horizontal scroll if something still overflows so content isn't clipped; we'll fix sources instead */
    overflow-x: auto;
}

/* Ensure images never force layout wider than their container */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Custom Properties */
:root {
    --success-color: #10B981;
    --success-dark: #0F766E;
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #f59e0b;
    --accent-color: #10b981;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --header-height: 120px;
    /* default header height, will be reduced in mobile */
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    /* only animate background and shadow to avoid accidental height transitions */
    transition: background 0.2s ease, box-shadow 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    height: var(--header-height) !important;
    min-height: var(--header-height);
    box-sizing: border-box;
    overflow: visible;
}

/* Ensure header logo is always proportional to header height
   - Use the existing --header-height variable as the source of truth
   - Prevent .navbar-brand from flex-growing so the brand area doesn't expand
   - Make the image size driven by max-height (keeps aspect ratio) */
.navbar {
    align-items: center; /* ensure vertical centering */
}

.navbar .navbar-brand {
    flex: 0 0 auto !important; /* do not grow */
    display: flex !important;
    align-items: center !important;
}

.navbar .navbar-brand .header-image {
    width: auto !important; /* don't force width: allow aspect ratio */
    height: auto !important;
    /* keep logo at most a percentage of header height so it never overflows */
    max-height: calc(var(--header-height) * 0.78) !important;
    object-fit: contain !important;
    display: block !important;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    position: relative;
}

.header-image-container {
    position: relative;
    left: 0;
    top: 0;
    transform: none;
    z-index: 3;
    /* increased default size to make logo slightly larger on most viewports */
    width: clamp(96px, 9vw, 180px);
    height: clamp(96px, 9vw, 180px);
    margin: 1rem 1rem 1rem 0;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.header-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* preserve logo aspect and avoid forced cropping */
    border-radius: 0; /* remove circular mask */
    border: none; /* remove white border */
    box-shadow: none; /* remove white-ish drop shadow */
    background: transparent; /* ensure no background is added by CSS */
    transition: var(--transition);
}

/* Larger header logo when used inside the navbar brand */
.navbar .navbar-brand .header-image {
    width: clamp(64px, 12vw, 120px);
    height: clamp(64px, 12vw, 120px);
}

/* .header-image:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
} */



.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin-left: auto;
    margin-right: 0;
    align-items: center;
    height: 100%;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

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

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

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


/* Bootstrap provides toggler; custom toggle removed to avoid conflicts */

/* Hero Section */
.hero {
    min-height: 100vh;
    height: auto;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    padding-top: calc(var(--header-height) + 20px);
    /* Ajustado para a nova altura do header */
}

.hero-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding-top: calc(var(--header-height));
    /* Ajustado para a nova altura do header */
    box-sizing: border-box;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.8" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.6" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
    height: 100%;
    min-height: 600px;
}

.hero-content {
    color: white;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
}

.highlight {
    background: linear-gradient(45deg, var(--secondary-color), #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

/* Custom button helper (do not override Bootstrap .btn) */
.btn-custom {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.btn-secondary-custom {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary-custom:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.hero-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Phone Mockup */
.phone-mockup {
    width: min(300px, 45vw);
    height: auto;
    aspect-ratio: 300 / 600;
    background: var(--bg-white);
    border-radius: 30px;
    padding: 15px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    margin: 0 auto;
    position: relative;
}

/* On larger screens make the phone mockup a bit narrower so text column can breathe */
@media (min-width: 992px) {

    /* On large screens align the phone mockup to the right of its column
       while keeping it centered on smaller screens (default .phone-mockup uses margin:0 auto). */
    .hero-image-col {
        text-align: right;
    }

    .hero-image-col .phone-mockup,
    .phone-mockup {
        width: 320px;
        /* fixed-ish width on large screens */
        margin-left: auto;
        /* push to right */
        margin-right: 0;
    }

    /* Ensure Bootstrap utility classes (e.g. mx-lg-0) or other rules don't override
       the right alignment — use higher cascade priority with !important for large screens. */
    .hero-image-col .phone-mockup {
        margin-left: auto !important;
        margin-right: 0 !important;
        display: block;
        /* ensure block-level for margin auto to take effect */
    }

    /* Slightly reduce phone shadow so it doesn't dominate */
    .phone-mockup {
        box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.22);
    }
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.app-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    text-align: center;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.app-content {
    padding: 1rem;
    height: calc(100% - 60px);
    overflow-y: auto;
}

.match-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.team {
    text-align: center;
    flex: 1;
}

.team-logo {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.vs {
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 1rem;
}

.match-prediction {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.ranking-preview {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.ranking-preview h4 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.rank-item:last-child {
    border-bottom: none;
}

.rank-pos {
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.rank-points {
    font-weight: 600;
    color: var(--accent-color);
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

/* Download logo inside phone mockup */
.download-phone {
    width: min(320px, 40vw);
    height: auto;
    border-radius: 28px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    margin: 0 auto;
    box-shadow: var(--shadow);
}

.download-logo {
    width: 80%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Mobile / Responsive adjustments */
@media (max-width: 991px) {

    /* Use 78px header height on mobile to match expected spacing */
    :root {
        --header-height: 78px;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .hero {
        padding-top: calc(var(--header-height) + 12px);
    }

    .hero-wrapper {
        padding-top: calc(var(--header-height) - 2px);
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        min-height: auto;
        padding: 0 1rem;
    }

    .hero-title {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .hero-stats {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .phone-mockup {
        width: min(260px, 45vw);
    }

    .header-image {
        /* increase header logo size on smaller viewports so it's more visible */
        width: clamp(64px, 12vw, 96px);
        height: clamp(64px, 12vw, 96px);
    }
    /* stronger override in case other selectors override this: force navbar-brand image size on mobile */
    .navbar .navbar-brand .header-image {
        width: clamp(72px, 14vw, 120px) !important;
        height: clamp(72px, 14vw, 120px) !important;
        max-width: none !important;
        display: block !important;
    }

    .navbar .navbar-brand .ms-2 {
        display: none;
    }

    /* Mobile: add background and padding to navbar collapse so menu is readable */
    .navbar .navbar-collapse {
        background: rgba(255, 255, 255, 0.98);
        padding: 0.75rem 1rem;
        margin-top: 0.5rem;
        border-radius: 0.5rem;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }

    .navbar .navbar-collapse .nav-link {
        padding: 0.5rem 0;
        width: 100%;
    }

    /* Shift page content down so fixed header doesn't overlap on mobile */
    body {
        /* keep body padding equal to header height to avoid gaps */
        padding-top: calc(var(--header-height));
    }

    /* Ensure phone mockup has breathing space from banner bottom on mobile */
    .hero-image-col .phone-mockup,
    .phone-mockup {
        margin-bottom: 0.75rem;
    }

    /* Ensure navbar brand/logo is vertically centered in the header on mobile */
    .navbar {
        height: var(--header-height);
    }

    .nav-container {
        align-items: center;
    }

    .navbar-brand {
        height: var(--header-height);
        display: flex;
        align-items: center;
        padding-top: 0;
        padding-bottom: 0;
    }

    .navbar-brand .header-image {
        margin-bottom: 0;
        /* remove any bottom pushing */
        /* nudge slightly up: keep previous percent-based nudge and add 5px more on mobile */
        transform: translateY(calc(-6% - 5px));
    }
}

@media (max-width: 560px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* Transform nav links into primary buttons on large screens (>=992px)
   Keep them as regular links in mobile (collapse) for accessibility and layout. */
@media (min-width: 992px) {
    .navbar .nav-link.btn-nav {
        display: inline-block;
        padding: 0.5rem 0.9rem;
        margin-left: 0.5rem;
        margin-right: 0;
        background: var(--primary-color);
        color: #fff !important;
        border-radius: 8px;
        border: none;
        box-shadow: 0 6px 20px rgba(37, 99, 235, 0.18);
        font-weight: 600;
        transition: background 0.18s ease, transform 0.12s ease;
    }

    .navbar .nav-link.btn-nav:hover,
    .navbar .nav-link.btn-nav:focus {
        background: var(--primary-dark);
        color: #fff !important;
        transform: translateY(-1px);
        text-decoration: none;
    }

    .navbar .nav-link.btn-nav-app {
        display: inline-block;
        padding: 0.5rem 0.9rem;
        margin-left: 0.5rem;
        margin-right: 0;
        background: var(--success-color);
        color: #fff !important;
        border-radius: 8px;
        border: none;
        box-shadow: 0 6px 20px rgba(37, 99, 235, 0.18);
        font-weight: 600;
        transition: background 0.18s ease, transform 0.12s ease;
    }

    .navbar .nav-link.btn-nav-app:hover,
    .navbar .nav-link.btn-nav-app:focus {
        background: var(--success-dark);
        color: #fff !important;
        transform: translateY(-1px);
        text-decoration: none;
    }

    /* remove underline pseudo-element for button appearance */
    .navbar .nav-link.btn-nav::after {
        display: none;
    }

    .navbar .nav-link.btn-nav-app::after {
        display: none;
    }
}

/* On smaller screens keep the collapsed menu layout and full-width links */
@media (max-width: 991px) {
    .navbar .nav-link.btn-nav {
        background: transparent !important;
        color: var(--text-dark) !important;
        padding: 0.5rem 0 !important;
        margin-left: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}

.scroll-indicator {
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    position: relative;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
}

/* Sections */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

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

/* Features Section */
.features {
    padding: 8rem 0;
    background: var(--bg-light);
    padding-top: 10rem;
    /* Compensação extra pelo header com imagem */
}

.features-grid {
    display: grid;
    /* allow smaller min column on narrow screens to avoid horizontal overflow */
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-white);
    padding: 2.5rem;
    padding-bottom: 4.5rem; /* espaço extra na base para separar do botão */
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 220px; /* evita que cards curtos tenham o botão sobre o texto */
    display: flex;
    flex-direction: column;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

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

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.feature-icon i {
    font-size: 2rem;
    color: white;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem; /* garante espaçamento entre parágrafo e botão absoluted */
}

/* 'Saiba Mais' button positioned bottom-right inside feature cards
   Use flexbox so the button is pushed to the bottom without overlapping text. */
.feature-card .learn-more {
    position: static;
    align-self: flex-end; /* keep at the right */
    margin-top: auto; /* push to the bottom of the card */
    z-index: 5; /* keep above any pseudo-elements */
}

/* Keep button in the bottom-right even on small screens, but make it slightly smaller
   to avoid overlapping text; if you prefer center on very small devices we can change it. */
@media (max-width: 767px) {
    .feature-card {
        padding-bottom: 3.2rem; /* a little less on small screens */
    }

    .feature-card .learn-more .btn {
        font-size: 0.78rem;
        padding: 0.28rem 0.6rem;
        margin-top: 0.25rem; /* leve espaçamento caso o conteúdo fique próximo */
    }
}

/* How It Works Section */
.how-it-works {
    padding: 8rem 0;
    background: var(--bg-white);
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 800px;
    margin: 0 auto;
}

.step {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.step:hover {
    background: white;
    box-shadow: var(--shadow);
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.step-content p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Testimonials Section */
.testimonials {
    padding: 8rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.testimonials .section-title {
    color: white;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.testimonial-content {
    margin-bottom: 1.5rem;
}

.testimonial-content p {
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.author-info h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.author-info span {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Download Section */
.download {
    padding: 8rem 0;
    background: var(--bg-light);
}

.download-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.download-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.download-text p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.download-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-store {
    background: var(--bg-white);
    color: var(--text-dark);
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 120px;
}

.btn-store:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-store i {
    font-size: 1.5rem;
}

.btn-store div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.btn-store span {
    font-size: 0.8rem;
    opacity: 0.8;
}

.btn-store strong {
    font-size: 1rem;
}

/* Download block: show the logo directly on the section background (no circular mask) */
.download-phone {
    width: 260px;
    height: auto; /* let logo/image define the height */
    background: transparent; /* let the section background show through */
    border-radius: 0; /* remove circular container */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: none; /* keep it clean */
    overflow: visible;
    padding: 0.15rem; /* small breathing space */
}

/* logo inside the download area: no border, no circle, scale responsively and a bit larger */
.download-phone .download-logo {
    width: 96%;
    max-width: 340px;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    border: none;
    box-shadow: none;
    display: block;
    background: transparent;
}

/* responsive: smaller on narrow screens */
@media (max-width: 768px) {
    .download-phone {
        width: 200px;
        height: auto;
        padding: 0.1rem;
    }

    .download-phone .download-logo {
        width: 88%;
        max-width: 220px;
    }
}

/* Larger screens: make the logo noticeably bigger and keep it centered */
@media (min-width: 992px) {
    .download-phone {
        width: auto;
        padding: 0.4rem;
    }

    .download-phone .download-logo {
        width: clamp(220px, 18vw, 420px);
        max-width: none;
    }
}

/* Make download/content and other two-column grids single-column on smaller screens to avoid cut-off */
@media (max-width: 991px) {
    .download-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .features {
        padding: 4rem 0;
    }

    .download {
        padding: 4rem 0;
    }
}

@media (max-width: 560px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .download-content {
        padding: 0 0.75rem;
    }
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
}

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

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #d1d5db;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
}

.footer-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-logo i {
    font-size: 2rem;
    margin-right: 0.5rem;
    color: var(--secondary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
    color: #9ca3af;
}

/* Responsive Design */

/* Mobile navigation (hamburger) */
@media (max-width: 900px) {
    .nav-toggle {
        display: flex;
        gap: 6px;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border-radius: 8px;
        margin-left: 1rem;
    }

    .nav-menu {
        position: fixed;
        top: 120px;
        /* below the navbar height */
        right: 0;
        left: 0;
        background: rgba(255, 255, 255, 0.98);
        z-index: 999;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.32s ease;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0 1rem;
    }

    .nav-menu.active {
        max-height: 320px;
        /* enough to show links */
    }

    .nav-menu .nav-link {
        display: block;
        padding: 1rem 0;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        font-size: 1.05rem;
        background: transparent;
    }

    .nav-menu .nav-link:last-child {
        border-bottom: none
    }

    /* reduce header image size on small screens */
    .header-image-container {
        /* make header container slightly larger on small screens to allow bigger logo */
        width: 84px;
        height: 84px;
        margin: 0.5rem;
    }

    .header-image {
        border-width: 3px
    }

    /* adjust navbar layout for mobile */
    .nav-container {
        padding: 0 1rem;
        align-items: center
    }
}

@media (min-width: 1025px) {
    .hero-wrapper {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        padding-top: 80px;
        box-sizing: border-box;
    }

    .hero-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
        align-items: center;
    }

    .hero-content {
        order: 1;
        text-align: left;
        max-width: 100%;
        overflow-wrap: break-word;
    }

    .hero-image {
        order: 2;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
}

/* On large screens move the fixed navbar slightly down from the top so it doesn't touch the viewport edge */
@media (min-width: 1025px) {
    .navbar {
        top: 12px; /* descola da borda superior */
        transition: top 0.18s ease;
    }

    /* add a little extra top padding so content aligns visually with moved navbar */
    body {
        padding-top: calc(var(--header-height) + 12px);
    }
}

/* Strong overrides for large screens in case other rules are more specific */
@media (min-width: 1025px) {
    .custom-navbar.fixed-top {
        top: 12px !important;
    }

    body {
        padding-top: calc(var(--header-height) + 12px) !important;
    }

    /* make logo visibly larger on large screens but prevent it from stretching to fill the navbar */
    .header-image-container {
        width: clamp(140px, 6.5vw, 240px) !important;
        height: clamp(140px, 6.5vw, 240px) !important;
        /* never allow the container to be taller than the navbar header area */
        max-height: calc(var(--header-height) - 12px) !important;
    }

    /* Prevent the brand from flex-growing and force a sensible clamp for the img */
    .navbar .navbar-brand {
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
    }

    .navbar .navbar-brand .header-image {
        width: clamp(140px, 6vw, 220px) !important;
        height: auto !important;
        object-fit: contain !important;
        max-width: none !important;
        /* ensure the image never exceeds the header height */
        max-height: calc(var(--header-height) - 12px) !important;
        align-self: center !important;
    }
}

@media (max-width: 1024px) {
    .hero-container {
        gap: 2rem;
        padding: 0 1.5rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .phone-mockup {
        width: 280px;
        height: 560px;
    }

    /* Keep navbar height stable when the banner reflows at this breakpoint
       Prevent nav items wrapping and remove vertical margins that can push the navbar taller */
    .navbar {
        height: var(--header-height) !important;
        min-height: var(--header-height) !important;
        overflow: hidden !important;
        align-items: center !important;
    }

    .nav-container {
        padding: 0 1rem !important;
        align-items: center !important;
        height: 100% !important;
    }

    /* reduce vertical margins/padding in brand area so it doesn't force extra height */
    .header-image-container {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        max-height: calc(var(--header-height) - 4px) !important;
        display: flex !important;
        align-items: center !important;
    }

    /* keep nav items on a single row where possible to avoid wrapping */
    .navbar .navbar-nav {
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 0.5rem;
    }

    .navbar .nav-link {
        padding-top: 0.35rem !important;
        padding-bottom: 0.35rem !important;
        line-height: 1 !important;
    }

    /* Keep navbar links/buttons at a stable height across this breakpoint
       Prevent the flex line from shrinking when the layout reflows */
    .navbar .nav-link,
    .navbar .nav-link .btn,
    .navbar .nav-link.btn-nav,
    .navbar .nav-link.btn-nav-app {
        min-height: 44px !important; /* approximate previous 41.6px */
        height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}

@media (max-width: 768px) {
    .hero {
        height: auto;
        min-height: 100vh;
    }

    .hero-wrapper {
        padding-top: 70px;
        height: auto;
        min-height: 100vh;
    }

    .hero {
        padding-top: 100px;
        /* Menos espaço em telas pequenas */
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
        padding: 2rem 1rem;
        min-height: auto;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-content {
        order: 2;
        text-align: center;
    }

    .hero-image {
        order: 1;
        margin-bottom: 2rem;
        display: flex;
        justify-content: center;
    }

    .phone-mockup {
        width: 250px;
        height: 500px;
    }

    .hero-scroll {
        display: none;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    /* Responsive header image for mobile: increase a bit more to improve visibility */
    .header-image-container {
        width: clamp(70px, 12vw, 96px);
        height: clamp(70px, 12vw, 96px);
    }

    .header-image {
        border: 3px solid var(--bg-white);
    }

    .nav-toggle {

        .nav-menu.active {
            left: 0;
        }

        .nav-toggle {
            display: flex;
        }

        .hero-container {
            grid-template-columns: 1fr;
            text-align: center;
            gap: 2rem;
        }

        .hero-title {
            font-size: 2.5rem;
        }

        .hero-buttons {
            justify-content: center;
            flex-wrap: wrap;
        }

        .hero-stats {
            justify-content: center;
        }

        .features-grid {
            grid-template-columns: 1fr;
        }

        .download-content {
            grid-template-columns: 1fr;
            text-align: center;
        }

        .download-buttons {
            justify-content: center;
        }

        .step {
            flex-direction: column;
            text-align: center;
        }

        --- .footer-content {
            grid-template-columns: 1fr;
            text-align: center;
        }
    }

    /* Correções para Hero Section em telas pequenas */
    @media (max-width: 768px) {
        .hero {
            height: auto;
            min-height: 100vh;
            padding-top: 70px;
        }

        .hero-container {
            grid-template-columns: 1fr;
            text-align: center;
            gap: 2rem;
            padding: 2rem 1rem;
            min-height: auto;
        }

        .hero-title {
            font-size: 2.5rem;
        }

        .hero-content {
            order: 2;
            /* Conteúdo embaixo na mobile */
        }

        .hero-image {
            order: 1;
            /* Imagem em cima na mobile */
            margin-bottom: 2rem;
        }

        .phone-mockup {
            width: 250px;
            height: 500px;
        }

        .hero-scroll {
            display: none;
            /* Esconder scroll indicator no mobile */
        }
    }

    @media (max-width: 480px) {
        .hero {
            min-height: 100vh;
            height: auto;
            padding-top: 60px;
        }

        .hero-container {
            padding: 1rem;
            gap: 1.5rem;
        }

        .hero-title {
            font-size: 2rem;
            line-height: 1.2;
        }

        .hero-description {
            font-size: 1rem;
        }

        .section-title {
            font-size: 2rem;
        }

        .hero-buttons {
            flex-direction: column;
            align-items: center;
            gap: 1rem;
        }

        .hero-buttons .btn {
            width: 100%;
            max-width: 280px;
            justify-content: center;
        }

        .phone-mockup {
            width: 200px;
            height: 400px;
        }

        .hero-stats {
            flex-direction: column;
            gap: 1rem;
        }

        .stat {
            margin: 0.5rem 0;
        }

        /* Header image for very small screens */
        .header-image-container {
            width: clamp(50px, 15vw, 70px);
            height: clamp(50px, 15vw, 70px);
        }

        .header-image {
            border: 2px solid var(--bg-white);
        }
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Additional fixes for small screens */
@media (max-height: 700px) {
    .hero {
        height: auto;
        min-height: 100vh;
        padding-top: 70px;
    }

    .hero-container {
        min-height: auto;
        padding: 1rem;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero-description {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .hero-buttons {
        margin-bottom: 2rem;
    }

    .phone-mockup {
        width: 200px;
        height: 400px;
    }

    .hero-scroll {
        display: none;
    }
}

/* Fix for very small screens */
@media (max-width: 360px) {
    .hero {
        padding-top: 60px;
    }

    .hero-container {
        padding: 1rem 0.5rem;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .phone-mockup {
        width: 180px;
        height: 360px;
    }
}

/* CloudControl logo in footer */
.footer .cloud-logo {
    width: 140px;
    max-width: 140px; /* enforce a maximum so high-res images don't overflow */
    height: auto;
    display: block;
    margin: 1rem auto; /* center horizontally on all screen sizes and add top spacing */
}

@media (max-width: 576px) {
    .footer .cloud-logo {
        width: 100px !important; /* reduzido para mobile conforme solicitado */
        max-width: 100px !important;
        height: auto;
        margin-top: 1.25rem; /* mais espaço no mobile */
        margin-left: auto; /* centraliza horizontalmente */
        margin-right: auto;
        padding-top: 0.5rem; /* espaço extra acima do logo na linha */
    }
}

/* Ensure header logo displays the source image without added white circle/border
   Override any previous rules that force circular mask, borders or shadows. */
/* Strong final override: make header logo size driven by header height variable
   so it changes only when the header height changes (not when viewport width changes).
   This block intentionally uses high specificity + !important to defeat earlier width-based clamps. */
.navbar {
    height: var(--header-height) !important;
    align-items: center !important;
}

.navbar .navbar-brand {
    flex: 0 0 auto !important; /* do not grow */
    display: flex !important;
    align-items: center !important;
}

.header-image-container {
    /* allow container to size naturally but never exceed header height
       reduce the vertical padding so the logo can fill more of the header */
    width: auto !important;
    height: auto !important;
    max-height: calc(var(--header-height) - 4px) !important;
    display: flex !important;
    align-items: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.navbar .navbar-brand .header-image,
.header-image {
    width: auto !important; /* preserve natural aspect ratio */
    height: auto !important;
    /* size the logo relative to header height (change only when header height changes) */
    max-height: calc(var(--header-height) * 0.9) !important;
    object-fit: contain !important;
    display: block !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* fallback safety: ensure no leftover width/height clamps remain active */
.navbar .navbar-brand .header-image[width],
.navbar .navbar-brand .header-image[height] {
    width: auto !important;
    height: auto !important;
}

/* End of strong override for header logo */

.header-image,
.navbar .navbar-brand .header-image {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    object-fit: contain !important; /* preserve original aspect */
}
