:root {
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-4xl: 5rem;
    --space-5xl: 8rem;
    --gold-600: #d4af37;
    --neutral-100: #f0f0f0;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-2xl: 16px;
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --transition-normal: 0.3s ease-out;
}

/* ===== Estilos Gerais para Componentes ===== */

.expert-image .image-frame,
#expert-slider .slides {
    position: relative;
    height: clamp(280px, 60vw, 400px);
    border-radius: var(--radius-2xl);
    overflow: hidden;
}

#expert-slider .slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    backface-visibility: hidden;
    will-change: opacity;
}

#expert-slider .slide.active {
    opacity: 1;
}

#expert-slider .carousel-btn,
#expert-slider .carousel-dots {
    position: absolute;
    z-index: 2;
}

#expert-slider .carousel-btn.prev {
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

#expert-slider .carousel-btn.next {
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

#expert-slider .carousel-dots {
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
}

/* ===== Media Query para Telas Grandes (Desktop First) ===== */
@media (min-width: 769px) {
    .navbar {
        min-height: 80px;
        padding: var(--space-lg) 0;
    }

    .logo .logo-img {
        height: 60px;
    }
}

@media (min-width: 768px) {
    .header .logo .logo-img {
        height: 60px;
    }

    .expert-image .image-frame,
    #expert-slider .slides,
    .image-slider .slides {
        height: 500px;
    }
}

/* ===== Media Query Principal para Tablets e Mobile (max-width: 768px) ===== */
@media (max-width: 768px) {

    /* --- Variáveis e Layout Base --- */
    :root {
        --space-5xl: 4rem;
        --space-4xl: 3rem;
    }

    .container {
        padding: 0 12px;
        /* Unificado e simplificado */
    }

    /* --- Header e Navegação --- */
    .navbar {
        min-height: 64px;
        padding: 6px 0;
    }

    .header .logo .logo-img {
        height: 84px !important;
        width: auto;
        padding-left: 15px;
    }

    .mobile-menu-toggle {
        display: flex;
        margin-right: 0;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(0, 27, 58, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: var(--space-xl);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform var(--transition-normal), opacity var(--transition-normal), visibility var(--transition-normal);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        box-shadow: var(--shadow-2xl);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        animation: slideDown 0.3s ease-out;
    }

    /* --- Seção Hero --- */
    .hero {
        min-height: 80vh;
        padding-top: 100px;
        padding-bottom: 120px;
        /* Espaço para o scroll indicator */
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    /* --- Carrossel de Sucesso --- */
    .success-card.active {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .success-image {
        order: -1;
        margin-bottom: var(--space-md);
    }

    .success-image img {
        margin: 0 auto;
    }

    .success-carousel .carousel-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(10px);
        border-radius: 50%;
    }

    .success-carousel .carousel-dots {
        display: flex;
        gap: var(--space-sm);
    }

    .success-carousel .dot,
    .success-carousel .carousel-dots .dot {
        display: inline-block !important;
        width: 8px !important;
        height: 8px !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.4) !important;
        cursor: pointer;
        transition: background-color var(--transition-normal);
        transform: none !important;
    }

    .success-carousel .dot.active,
    .success-carousel .carousel-dots .dot.active {
        background: var(--gold-600) !important;
        transform: scale(1.2);
    }

    /* --- Grids e Layouts de Seção --- */
    .earnings-grid,
    .benefits-grid,
    .content-grid,
    .calculator-container,
    .expert-content,
    .contact-content,
    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-content,
    .expert-content {
        text-align: center;
    }

    /* --- Componentes Específicos --- */
    .steps-timeline::before {
        left: 40px;
    }

    .step-number {
        left: 40px;
        width: 60px;
        height: 60px;
    }

    .step-content {
        width: calc(100% - 80px);
        margin-left: 80px !important;
    }

    .expert-achievements {
        grid-template-columns: 1fr;
    }

    .social-links {
        justify-content: center;
    }

    .exam-banner {
        padding: 8px 0;
    }

    .scroll-indicator {
        left: 50%;
        transform: translateX(-50%);
        bottom: 24px;
        font-size: 0.8rem;
    }

    .scroll-mouse {
        width: 20px;
        height: 32px;
    }

    .scroll-wheel {
        width: 2px;
        height: 6px;
    }

    .cta-mobile-only {
        display: inline-flex;
        margin-top: var(--space-xl);
        width: 100%;
        justify-content: center;
    }

    .contact-info .pricing {
        width: 100%;
    }

    /* --- Usabilidade e Acessibilidade Mobile (Touch) --- */
    .cta-btn,
    .nav-link,
    .carousel-btn,
    .dot,
    .faq-question,
    button {
        min-height: 44px;
        min-width: 44px;
    }

    .success-carousel,
    .calculator-container,
    .faq-container {
        -webkit-overflow-scrolling: touch;
    }

    .success-carousel {
        touch-action: pan-x;
    }

    .cta-btn,
    .nav-link,
    button {
        -webkit-tap-highlight-color: rgba(212, 175, 55, 0.3);
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"] {
        font-size: 16px;
        /* Previne zoom automático no iOS */
    }

    .form-group input {
        border-radius: var(--radius-md);
        border: 2px solid rgba(255, 255, 255, 0.1);
        transition: border-color var(--transition-normal);
    }

    .form-group input:focus {
        border-color: var(--gold-600);
        outline: none;
    }

    :focus-visible {
        outline: 2px solid var(--gold-600);
        outline-offset: 2px;
    }

    /* --- Melhorias de Contraste e Feedback --- */
    .hero-subtitle,
    .stat-note,
    .legal-note {
        color: rgba(255, 255, 255, 0.9);
    }

    .error-message {
        font-size: 0.8rem;
        margin-top: var(--space-xs);
    }

    .loading-progress {
        height: 3px;
    }

    /* --- Animações e Telas de Carregamento --- */
    @keyframes slideDown {
        from {
            transform: translateY(-20px);
            opacity: 0;
        }

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

    .loading-screen {
        padding: var(--space-lg);
    }

    .loading-content {
        max-width: 280px;
    }

    .loading-logo {
        font-size: 3rem;
    }

    .loading-text {
        font-size: 1rem;
    }
}

/* ===== Media Query para Telas Pequenas (Mobile Pequeno) ===== */

@media (max-width: 480px) {
    :root {
        --space-xs: 0.125rem;
        --space-sm: 0.25rem;
        --space-md: 0.5rem;
        --space-lg: 0.75rem;
        --space-xl: 1rem;
        --space-2xl: 1.5rem;
        --space-4xl: 2rem;
        --space-5xl: 3rem;
    }

    html {
        font-size: 14px;
    }

    .container {
        padding: 0 var(--space-md);
    }

    /* --- Header --- */
    .header .logo .logo-img {
        height: 50px;
    }

    .navbar {
        padding: var(--space-sm) 0;
        min-height: 60px;
    }

    .mobile-menu-toggle {
        width: 30px;
        height: 30px;
        gap: 4px;
    }

    .mobile-menu-toggle span {
        height: 2px;
    }

    /* --- Hero --- */
    .hero {
        padding: 80px 0 var(--space-4xl);
        min-height: 70vh;
    }

    .hero-title {
        font-size: 1.75rem;
        line-height: 1.2;
        margin-bottom: var(--space-lg);
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: var(--space-xl);
    }

    .hero-cta {
        flex-direction: column;
        gap: var(--space-md);
        align-items: stretch;
    }

    .cta-btn {
        padding: var(--space-md) var(--space-lg);
        font-size: 0.9rem;
        text-align: center;
        justify-content: center;
    }

    .hero-stats {
        margin-top: var(--space-xl);
    }

    .stat-number {
        font-size: 2rem;
    }

    /* --- Outras Seções --- */
    .exam-banner {
        padding: var(--space-sm) 0;
    }

    .exam-info {
        flex-direction: column;
        text-align: center;
        gap: var(--space-xs);
        font-size: 0.8rem;
    }

    .exam-info .sep {
        display: none;
    }

    .pill {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.7rem;
    }

    .success-card {
        padding: var(--space-lg);
    }

    .success-content blockquote {
        font-size: 0.9rem;
        margin-bottom: var(--space-md);
    }

    .success-content cite {
        font-size: 0.8rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .stat-card {
        padding: var(--space-lg);
    }

    .stat-value {
        font-size: 2.5rem;
    }

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

    .stat-note {
        font-size: 0.8rem;
    }

    .calculator-container {
        padding: var(--space-lg);
    }

    .calculator-form {
        gap: var(--space-lg);
    }

    .input-group label {
        font-size: 0.9rem;
    }

    .input-group input[type="number"],
    .input-group input[type="range"] {
        font-size: 1rem;
        padding: var(--space-md);
    }

    .radio-group {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .calculator-result {
        padding: var(--space-lg);
    }

    .result-values {
        gap: var(--space-md);
    }

    .result-item .value {
        font-size: 1.1rem;
    }

    .expert-container {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .expert-images {
        order: -1;
    }

    .expert-credentials {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .credential {
        font-size: 0.8rem;
    }

    .content-module {
        padding: var(--space-lg);
    }

    .module-header h3 {
        font-size: 1.1rem;
    }

    .module-duration {
        font-size: 0.8rem;
    }

    .module-content ul li {
        font-size: 0.9rem;
    }

    .faq-question {
        padding: var(--space-md);
        font-size: 0.9rem;
    }

    .faq-answer p {
        font-size: 0.85rem;
        padding: var(--space-md);
    }

    .contact-info {
        order: 1;
        text-align: center;
    }

    .contact-form {
        order: -1;
    }

    .contact-features {
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--space-md);
    }

    .feature {
        font-size: 0.8rem;
    }

    .pricing {
        margin: var(--space-lg) 0;
    }

    .price-tag {
        padding: var(--space-lg);
    }

    .old-price {
        font-size: 1rem;
    }

    .new-price {
        font-size: 1.8rem;
    }

    .price-note {
        font-size: 0.8rem;
    }

    .form {
        padding: var(--space-lg);
    }

    .form-group {
        margin-bottom: var(--space-lg);
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .form-group input {
        padding: var(--space-md);
        font-size: 1rem;
    }

    .footer-links {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-lg);
    }

    .link-group h4 {
        font-size: 0.9rem;
    }

    .link-group a {
        font-size: 0.8rem;
    }

    .footer-bottom {
        text-align: center;
        font-size: 0.8rem;
    }
}

/* ===== Media Query para Tablets em modo Retrato ===== */

@media (min-width: 481px) and (max-width: 767px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 0 var(--space-lg);
    }

    .header .logo .logo-img {
        height: 55px;
    }

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

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

    .hero-cta {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

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

    .contact-content {
        gap: var(--space-2xl);
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Media Query para modo Paisagem em Dispositivos Móveis ===== */

@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 60px 0 var(--space-2xl);
        min-height: 60vh;
    }

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

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: var(--space-lg);
    }

    .hero-stats {
        grid-template-columns: 1fr 1fr;
        margin-top: var(--space-lg);
    }

    .exam-banner {
        padding: var(--space-xs) 0;
    }

    .exam-info {
        font-size: 0.8rem;
    }
}

/* ===== Media Queries de Preferência do Usuário e do Sistema ===== */

/* --- Modo de Cores Escuro (Dark Mode) --- */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .form-group input {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--neutral-100);
    }

    .calculator-container {
        background: rgba(0, 0, 0, 0.3);
    }

    .success-card {
        background: rgba(0, 0, 0, 0.2);
    }
}

/* --- Movimento Reduzido --- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* --- Alta Densidade de Pixels (Retina) --- */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .header .logo .logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* --- Estilos de Impressão --- */
@media print {

    .header,
    .exam-banner,
    .back-to-top,
    .loading-screen,
    footer,
    #contato .cta-btn {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .container {
        max-width: none !important;
        padding: 0 !important;
    }
}