/* 1. Configurações Globais e Variáveis de Cor (Estilo Apple) */
:root {
    /* Tema Claro (Default) */
    --bg-color: #f5f5f7;
    --card-bg-color: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #515154;
    --text-tertiary: #86868b;
    --action-blue: #0071e3;
    --action-blue-hover: #0077ed;
    --border-color: #d2d2d7;
    --input-bg: #f5f5f7;
    --input-border: #d2d2d7;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --selected-shadow: 0 0 0 2px var(--action-blue);

    /* Transição de Esmaecimento */
    --theme-transition: all 0.3s ease-in-out;
}

body.dark-mode {
    /* Tema Escuro */
    --bg-color: #000000;
    --card-bg-color: #151516;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #6e6e73;
    --border-color: #3a3a3c;
    --input-bg: #1d1d1f;
    --input-border: #3a3a3c;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    --selected-shadow: 0 0 0 2px var(--action-blue);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    /* Remove o flash azul ao clicar em mobile */
}

html {
    scroll-behavior: smooth;
    /* Habilita rolagem suave para âncoras */
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    transition: var(--theme-transition);
    overflow-x: hidden;
}

.container {
    /* ATUALIZAÇÃO DESKTOP: Reduzido para melhor ajuste em laptops */
    max-width: 1024px;
    margin: 0 auto;
    padding: 20px 20px;
}

/* 2. Cabeçalho e Tema */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
}

header h1 {
    padding-left: 20px;
    font-size: 50px;
    font-weight: 600;
    flex-grow: 1;
    color: var(--text-primary);
    transition: var(--theme-transition);
}

.logo-header {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-header img {
    width: 120px;
}

.theme-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-switcher span {
    min-width: 44px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--theme-transition);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--action-blue);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--action-blue);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* 3. Seção de Planos */
.plans-section {
    text-align: center;
    /*height: 100vh;*/
}

.plans-section h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    transition: var(--theme-transition);
}

.plans-section .subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    transition: var(--theme-transition);
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* leve ajuste no minmax */
    gap: 24px;
    margin-bottom: 40px;
}

.plan-card {
    background-color: var(--card-bg-color);
    border-radius: 18px;
    padding: 20px 32px;
    text-align: left;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: var(--theme-transition);
    cursor: pointer;
}

.plan-card.selected {
    box-shadow: var(--selected-shadow);
    border-color: var(--action-blue);
}

.plan-card h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: var(--theme-transition);
}

.plan-card .description {
    font-size: 16px;
    color: var(--text-secondary);
    /*margin-bottom: 24px;*/
    min-height: 48px;
    /* Para alinhar os cards */
    transition: var(--theme-transition);
}

.plan-card .price {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: var(--theme-transition);
}

.plan-card .price-subtext {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 24px;
    transition: var(--theme-transition);
}

.plan-card .img-card {
    padding-bottom: 20px;
}

.plan-card ul {
    list-style: none;
    padding-left: 0;
}

.plan-card ul li {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    /*align-items: center;*/
    gap: 10px;
    transition: var(--theme-transition);
}

.plan-card ul li svg {
    fill: #34c759;
    /* Verde Apple */
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    /*margin-top: 2px;*/
}

.footer-note {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 40px;
    transition: var(--theme-transition);
}

.btn-primary {
    margin-bottom: 85px;
    display: inline-block;
    background-color: var(--action-blue);
    color: #ffffff;
    font-size: 17px;
    font-weight: 500;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 980px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-primary:active {
    transform: scale(0.98);
    /* Efeito de clique */
}

.btn-primary:hover {
    background-color: var(--action-blue-hover);
}

/* 4. Seção do Formulário */
#form-section-space {
    padding-top: 30px;
}

.form-container {
    max-width: 680px;
    margin: 0 auto;
    background-color: var(--card-bg-color);
    border-radius: 18px;
    padding: 32px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: var(--theme-transition);
}

.form-container h2 {
    font-size: 32px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
    transition: var(--theme-transition);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    transition: var(--theme-transition);
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    color: var(--text-primary);
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    appearance: none;
    -webkit-appearance: none;
    transition: var(--theme-transition);
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--action-blue);
    box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.3);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group .select-wrapper {
    position: relative;
}

.form-group .select-wrapper::after {
    content: '▼';
    font-size: 12px;
    color: var(--text-tertiary);
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: var(--theme-transition);
}

.form-group .placeholder {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-top: 8px;
    transition: var(--theme-transition);
}

.form-container .btn-primary {
    margin-bottom: 0;
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
}


/* 5. ATUALIZAÇÃO MOBILE: Media Query para responsividade */
@media (max-width: 768px) {
    .container {
        padding: 20px 24px;
        /* ALTERADO: Padding vertical reduzido */
    }

    header {
        padding-bottom: 0px;
        /* ALTERADO: Reduzido */
    }

    header h1 {
        padding-left: 0px;
        font-size: 30px;
        /* ALTERADO: Fonte menor no mobile */
    }

    .theme-switcher {
        gap: 2px;
    }

    .plans-section h2 {
        font-size: 20px;
        /* ALTERADO: Fonte menor no mobile */
    }

    .plans-section .subtitle {
        font-size: 16px;
        margin-bottom: 20px;
        /* ALTERADO: Reduzido */
    }

    .plans-section .price {
        margin: 20px 0;
        /* ALTERADO: Reduzido */
    }

    /* --- INÍCIO DO CÓDIGO DO CARROSSEL --- */
    .plans-grid {
        display: flex;
        /* Transforma em flex container */
        grid-template-columns: unset;
        /* Remove o grid de desktop */
        overflow-x: auto;
        /* Permite o scroll horizontal */
        scroll-snap-type: x mandatory;
        /* Habilita o "ímã" de scroll */
        gap: 16px;

        /* Truque para o carrossel parecer "de ponta a ponta" */
        margin: 0 -24px;
        padding: 4px 24px 4px 24px;
        /* Adiciona padding de volta */
        margin-bottom: 24px;
        /* ALTERADO: Reduzido */

        /* Esconde a barra de rolagem */
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE */
    }

    .plans-grid::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari */
    }

    .plan-card {
        flex: 0 0 85%;
        /* Cada card ocupa 85% da tela */
        scroll-snap-align: center;
        /* Alinha o card no centro */
        min-height: unset;
        /* Remove a altura mínima no mobile */
        padding: 24px;
        /* ALTERADO: Padding interno do card reduzido */
    }

    /* --- FIM DO CÓDIGO DO CARROSSEL --- */

    /* ALTERADO: Novas regras para reduzir fontes internas do card */
    .plan-card h3 {
        font-size: 22px;
    }

    .plan-card .description {
        font-size: 15px;
        min-height: unset;
    }

    .plan-card .price-subtext {
        margin-bottom: 20px;
    }

    .plan-card ul li {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .plan-card ul li svg {
        margin-top: -2px;
    }

    .footer-note {
        display: none;
        margin-bottom: 24px;
    }

    /* FIM DAS NOVAS REGRAS */


    .plan-card .price {
        font-size: 30px;
        /* ALTERADO: Reduzido */
    }

    #form-section-space {
        padding-top: 40px;
    }

    .form-container {
        padding: 24px;
    }

    .form-container h2 {
        font-size: 28px;
    }
}