/* Design Tokens & Variáveis */
:root {
    --primary-green: #0b7f4b;
    --light-green: #11a966;
    --dark-green: #065331;
    --accent-teal: #00d2c4;
    --accent-blue: #0047ba;
    --hover-blue: #00368e;
    --bg-gradient: radial-gradient(circle at 70% 10%, #108d53 0%, #034426 100%);
    --text-white: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --input-placeholder: rgba(255, 255, 255, 0.35);
    --border-white: rgba(255, 255, 255, 0.2);
    --border-active: #00d2c4;
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    --glass-blur: blur(12px);
    
    /* Fontes */
    --font-primary: 'Outfit', sans-serif;
    --font-secondary: 'Plus Jakarta Sans', sans-serif;
}

/* Reset Geral */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-gradient);
    color: var(--text-white);
    min-height: 100vh;
    min-height: -webkit-fill-available; /* Suporte iOS Safari */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

html {
    height: 100%;
}

/* Background Wave Vector Decorativo */
.bg-waves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.wave {
    position: absolute;
    border-radius: 43%;
    background: rgba(255, 255, 255, 0.02);
}

.wave1 {
    width: 800px;
    height: 800px;
    top: -300px;
    right: -200px;
    animation: rotateWave 25s infinite linear;
}

.wave2 {
    width: 900px;
    height: 900px;
    bottom: -400px;
    left: -300px;
    background: rgba(0, 210, 196, 0.015);
    animation: rotateWave 35s infinite linear;
}

@keyframes rotateWave {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* App Container Principal */
.app-container {
    width: 100%;
    max-width: 680px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px 24px;
    z-index: 1;
    position: relative;
}

/* Barra de Progresso */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-teal);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.1, 0.8, 0.25, 1);
    box-shadow: 0 0 8px var(--accent-teal);
}

/* Form Wrapper & Cards de Passos */
.form-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

.step-card {
    position: absolute;
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: transform 0.5s cubic-bezier(0.1, 0.8, 0.25, 1), 
                opacity 0.4s ease, 
                visibility 0.4s ease;
    display: flex;
    flex-direction: column;
}

/* Custom scrollbar para o slide caso precise rolar no mobile */
.step-card::-webkit-scrollbar {
    width: 4px;
}
.step-card::-webkit-scrollbar-track {
    background: transparent;
}
.step-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.step-card.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Tela de Boas-vindas */
.welcome-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 0;
}

.logo-area {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
}

.logo-img {
    max-width: 240px;
    height: auto;
    object-fit: contain;
}

.welcome-title {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
    font-family: var(--font-secondary);
}

.welcome-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 30px;
    max-width: 500px;
}

.welcome-benefits {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 35px;
    text-align: left;
    width: 100%;
    max-width: 440px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.benefit-item i {
    color: var(--accent-teal);
    font-size: 1.1rem;
}

.btn-start {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
    background-color: var(--accent-blue);
    border: none;
    border-radius: 30px;
    padding: 16px 40px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 71, 186, 0.3);
    transition: all 0.3s cubic-bezier(0.1, 0.8, 0.25, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-start:hover {
    background-color: var(--hover-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 71, 186, 0.4);
}

.btn-start:active {
    transform: translateY(0);
}

.security-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Estrutura das Perguntas (Estilo Typeform) */
.question-container {
    width: 100%;
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-teal);
    background: rgba(0, 210, 196, 0.1);
    border: 1px solid rgba(0, 210, 196, 0.2);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.question-title {
    font-size: 1.45rem;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: 8px;
    color: var(--text-white);
    font-family: var(--font-secondary);
}

.question-help {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Wrapper de Input */
.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1.5px solid var(--border-white);
    color: var(--text-white);
    font-family: var(--font-primary);
    font-size: 1.6rem;
    font-weight: 400;
    padding: 10px 0;
    transition: border-color 0.3s ease;
}

.input-wrapper input:focus {
    border-color: var(--border-active);
}

.input-wrapper input::placeholder {
    color: var(--input-placeholder);
    opacity: 1;
}

/* Mensagens de Erro */
.error-message {
    color: #ff6b6b;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

.error-message::before {
    content: "\f071";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

/* Opções de Cartão (Sim/Não e Multipla Escolha) */
.options-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.option-card {
    cursor: pointer;
    width: 100%;
    display: block;
}

.hidden-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.option-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--border-white);
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s ease;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-white);
    border: 1px solid var(--border-white);
    border-radius: 4px;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.option-text {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-white);
}

/* Estados de Hover e Check nas opções */
.option-card:hover .option-content {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.hidden-radio:checked + .option-content {
    background: rgba(0, 210, 196, 0.1);
    border-color: var(--border-active);
    box-shadow: 0 0 10px rgba(0, 210, 196, 0.15);
}

.hidden-radio:checked + .option-content .option-letter {
    background: var(--accent-teal);
    border-color: var(--accent-teal);
    color: var(--dark-green);
}

/* Grupo de Input WhatsApp com DDI */
.whatsapp-input-group {
    display: flex;
    align-items: center;
    width: 100%;
    border-bottom: 1.5px solid var(--border-white);
    transition: border-color 0.3s ease;
}

.whatsapp-input-group:focus-within {
    border-color: var(--border-active);
}

.country-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 12px;
    border-right: 1px solid var(--border-white);
    height: 100%;
    margin-right: 15px;
    user-select: none;
}

.flag-img {
    width: 24px;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.country-code {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-muted);
}

.whatsapp-input-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-white);
    font-family: var(--font-primary);
    font-size: 1.6rem;
    font-weight: 400;
    padding: 10px 0;
}

/* Tela de Redirecionamento (Loading) */
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 0;
}

.spinner {
    width: 55px;
    height: 55px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--accent-teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 25px;
    box-shadow: 0 0 10px rgba(0, 210, 196, 0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    font-family: var(--font-secondary);
}

.loading-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 400px;
    line-height: 1.5;
}

/* Rodapé de Navegação (Bottom Bar) */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
    margin-top: 20px;
}

.btn-nav {
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: all 0.2s cubic-bezier(0.1, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-back {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
    width: 48px;
    height: 48px;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-ok {
    background: var(--accent-blue);
    color: var(--text-white);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0 24px;
    height: 48px;
    gap: 8px;
}

.btn-ok:hover {
    background: var(--hover-blue);
    transform: scale(1.02);
}

.btn-ok:active {
    transform: scale(0.98);
}

.keyboard-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 10px;
    display: none; /* Oculto no mobile, exibido apenas no desktop */
}

.keyboard-hint strong {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    padding: 2px 6px;
    font-weight: 500;
}

/* Responsividade (Desktop / Tablet) */
@media (min-width: 768px) {
    .app-container {
        padding: 40px 0;
    }
    
    .welcome-title {
        font-size: 2.2rem;
    }
    
    .question-title {
        font-size: 1.7rem;
    }
    
    .input-wrapper input {
        font-size: 1.9rem;
    }
    
    .whatsapp-input-group input {
        font-size: 1.9rem;
    }
    
    .keyboard-hint {
        display: inline-block;
    }

    .options-wrapper {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .option-card {
        flex: 1 1 calc(50% - 6px); /* Dividir em 2 colunas */
    }
}

/* Ajustes finos para telas menores/portraits longos */
@media (max-height: 600px) {
    .app-container {
        padding: 15px 15px;
    }
    .welcome-title {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }
    .welcome-subtitle {
        margin-bottom: 15px;
    }
    .welcome-benefits {
        margin-bottom: 20px;
        gap: 6px;
    }
    .btn-start {
        padding: 12px 30px;
    }
}
