:root {
    --primary: #f59e0b;
    --primary-dark: #d97706;
    --primary-glow: rgba(245, 158, 11, 0.4);
    --bg-color: #000000;
    --surface: #0a0a0a;
    --surface-border: #1f1f1f;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --error: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.app-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

/* Ambient glow effects for modern feel */
.bg-glow {
    position: absolute;
    width: 60vw;
    height: 60vw;
    max-width: 600px;
    max-height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
    animation: float 10s infinite ease-in-out alternate;
}

.top-glow {
    top: -20%;
    right: -10%;
    background: var(--primary);
}

.bottom-glow {
    bottom: -20%;
    left: -10%;
    background: var(--primary-dark);
    animation-delay: -5s;
}

.app-container {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.8s ease;
}

.logo {
    max-width: 220px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.form-container {
    background: var(--surface);
    padding: 3rem 2.5rem;
    border-radius: 24px;
    border: 1px solid var(--surface-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.02);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease;
    backdrop-filter: blur(10px);
}

/* Progress Bar */
.progress-wrapper {
    margin-bottom: 3rem;
}

.progress-bar {
    height: 6px;
    background: #1f1f1f;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress {
    height: 100%;
    background: var(--primary);
    width: 25%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.progress-glow {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: #fff;
    filter: blur(5px);
    opacity: 0.5;
    animation: pulseGlow 2s infinite;
}

.progress-steps {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Steps */
.step {
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s ease;
}

.step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
    animation: slideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.question {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 2.5rem;
    line-height: 1.3;
    color: var(--text-main);
}

.question .highlight {
    font-weight: 700;
    color: var(--primary);
}

/* Floating Label Inputs */
.input-group {
    position: relative;
    margin-bottom: 2.5rem;
}

input {
    width: 100%;
    padding: 1.25rem 1rem;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus, input:not(:placeholder-shown) {
    border-color: var(--primary);
    background: #1a1a1a;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.input-group label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #71717a;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

input:focus + label, input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 0.85rem;
    color: var(--primary);
    background: var(--surface);
    padding: 0 0.5rem;
    font-weight: 600;
}

/* Error State */
input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}
.error-msg {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: -2rem;
    margin-bottom: 2rem;
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Buttons */
.btn-container {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

.btn {
    padding: 1.1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.next-btn, .submit-btn {
    background: var(--primary);
    color: #000;
    flex: 1;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.next-btn:hover, .submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.next-btn:active, .submit-btn:active {
    transform: translateY(-1px);
}

.prev-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid #3f3f46;
}

.prev-btn:hover {
    background: #1f1f1f;
    color: #fff;
    border-color: #52525b;
}

.arrow {
    transition: transform 0.3s ease;
}

.next-btn:hover .arrow {
    transform: translateX(4px);
}

.hidden {
    display: none !important;
}

/* Loading State */
#loading {
    text-align: center;
    padding: 3rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #1f1f1f;
    border-radius: 50%;
    border-left-color: var(--primary);
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin-bottom: 2rem;
}

.loading-title {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.loading-text {
    color: var(--text-muted);
}

/* Tela de confirmação (campanhas sem redirecionamento) */
#form-success {
    text-align: center;
    padding: 3rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    animation: fadeInUp .5s cubic-bezier(0.16, 1, 0.3, 1);
}
.success-badge {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.75rem;
    color: var(--primary);
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.06);
    animation: popIn .45s cubic-bezier(0.34, 1.56, 0.64, 1) .1s both;
}
#form-success .loading-text { max-width: 340px; line-height: 1.55; }

/* Animations */
@keyframes popIn { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes float { 0% { transform: translate(0, 0); } 100% { transform: translate(20px, 20px); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulseGlow { 0% { opacity: 0.2; width: 10px; } 50% { opacity: 0.8; width: 30px; } 100% { opacity: 0.2; width: 10px; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Perguntas customizadas: textarea */
.q-textarea {
    width: 100%;
    padding: 1.1rem 1rem;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    color: #fff;
    font-size: 1.05rem;
    line-height: 1.5;
    outline: none;
    resize: vertical;
    min-height: 110px;
    transition: all 0.3s ease;
}
.q-textarea:focus {
    border-color: var(--primary);
    background: #1a1a1a;
    box-shadow: 0 0 0 4px var(--primary-glow);
}
.q-textarea.error {
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

/* Perguntas customizadas: seleção única (radio) e múltipla (checkbox) */
.choices {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}
.choice {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.05rem;
    color: var(--text-main);
    transition: all 0.25s ease;
}
.choice:hover {
    border-color: #3f3f46;
    background: #1a1a1a;
}
/* Override do estilo global de input (que aplica padding/width grandes) */
.choice input[type="radio"],
.choice input[type="checkbox"] {
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--primary);
    cursor: pointer;
    box-shadow: none;
}
.choice:has(input:checked) {
    border-color: var(--primary);
    background: rgba(245, 158, 11, 0.08);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Asterisco de campo obrigatório */
.question .req { color: var(--error); }

/* =======================================================================
   Modelo 2 — Lista (todas as perguntas em uma única página)
   Ativado por .form-list no <form>; o modelo passo a passo segue intacto.
   ======================================================================= */

/* Conteúdo longo: alinha ao topo para não cortar o início da página */
body:has(.form-list) { align-items: flex-start; }
body:has(.form-list) .app-wrapper { align-items: flex-start; }
.form-container:has(.form-list) { padding: 2.25rem 2rem; }
.form-container:has(.form-list) .progress-wrapper { margin-bottom: 1.75rem; }

.form-list { display: block; animation: fadeIn .4s ease; }

.list-intro { margin-bottom: 1.75rem; }
.list-title { font-size: 1.55rem; font-weight: 400; line-height: 1.3; }

/* Seções ---------------------------------------------------------------- */
.list-section { margin-bottom: 1.5rem; }
.list-section-head { display: flex; align-items: baseline; justify-content: space-between;
    gap: .75rem; padding-bottom: .6rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--surface-border); }
.list-section-title { font-size: .78rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--primary); }
.list-section-hint { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }

/* Campos ---------------------------------------------------------------- */
.list-field { margin-bottom: 1.15rem; }
.list-field:last-child { margin-bottom: 0; }
.list-label { display: block; margin-bottom: .45rem; font-size: .88rem; font-weight: 600; color: var(--text-main); }

/* Sem floating label: o rótulo fica acima e o placeholder é visível */
.input-group.plain { margin-bottom: 0; }
.form-list input, .form-list .q-textarea { padding: .9rem 1rem; font-size: 1rem; border-radius: 10px; }
.form-list .q-textarea { min-height: 84px; }
.form-list input::placeholder, .form-list .q-textarea::placeholder { color: #52525b; }
/* Preenchido mas sem foco volta ao neutro (evita a tela toda em âmbar) */
.form-list input:not(:focus):not(:placeholder-shown) {
    border-color: #2a2a2a; background: #141414; box-shadow: none; }
.form-list input:focus { border-color: var(--primary); background: #1a1a1a; box-shadow: 0 0 0 3px var(--primary-glow); }

/* Seleções mais compactas no modelo em lista */
.form-list .choices { gap: .5rem; margin-bottom: 0; }
.form-list .choice { padding: .8rem .95rem; font-size: .95rem; }

/* Erros: sem o deslocamento negativo usado no passo a passo */
.form-list .error-msg { margin-top: .4rem; margin-bottom: 0; }
.form-list input.error, .form-list .q-textarea.error { border-color: var(--error); }

/* Ação final ------------------------------------------------------------ */
.list-actions { margin-top: 2rem; }
.list-actions .submit-btn { width: 100%; }
.list-foot { margin-top: 1rem; text-align: center; font-size: .75rem; color: var(--text-muted); }

/* Mobile optimization */
@media (max-width: 480px) {
    .form-container {
        padding: 2.5rem 1.5rem;
        border-radius: 20px;
    }
    /* Modelo em lista: respiro menor para caber mais campos na tela */
    .form-container:has(.form-list) { padding: 1.75rem 1.25rem; }
    .list-title { font-size: 1.3rem; }
    .list-section-hint { display: none; }
    .question {
        font-size: 1.5rem;
    }
    .btn {
        padding: 1rem 1.2rem;
        font-size: 0.95rem;
    }
    .btn-container {
        flex-direction: column-reverse;
    }
    .prev-btn {
        width: 100%;
    }
}
