*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --blue: #00b4fe;
    --blue-dark: #0077cc;
    --blue-deeper: #005fa3;
    --blue-soft: #e6f7ff;
    --blue-mid: #b3e8ff;
    --white: #ffffff;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-300: #cbd5e0;
    --gray-500: #718096;
    --gray-700: #4a5568;
    --gray-900: #1a202c;
    --success: #16a34a;
    --error: #e53e3e;
    --radius: 14px;
    --shadow-sm: 0 2px 8px rgba(0, 180, 254, .1);
    --shadow-md: 0 8px 32px rgba(0, 180, 254, .15);
    --shadow-lg: 0 20px 60px rgba(0, 180, 254, .2);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sora', sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    min-height: 100vh;
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--blue);
    border-radius: 99px;
}

/* ============================================================
       NAVEGAÇÃO (igual ao index, reutilizável)
    ============================================================ */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: 68px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 180, 254, .12);
    padding: 0 5%;
    box-shadow: 0 2px 12px rgba(0, 180, 254, .08);
}

.nav-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--gray-900);
}

.logo-mark {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 180, 254, .4);
}

.logo-mark svg {
    width: 20px;
    height: 20px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-text strong {
    font-size: .92rem;
    font-weight: 800;
    letter-spacing: -.3px;
}

.logo-text span {
    font-size: .65rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--blue);
}

.nav-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    font-weight: 500;
    color: var(--gray-500);
    text-decoration: none;
    padding: .45rem .9rem;
    border-radius: 8px;
    transition: background .2s, color .2s;
}

.nav-back:hover {
    background: var(--blue-soft);
    color: var(--blue);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border-radius: 8px;
}

.hamburger:hover {
    background: var(--blue-soft);
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all .3s;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    z-index: 199;
    background: white;
    border-bottom: 1px solid var(--gray-100);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .08);
    padding: 1rem 5%;
    display: none;
    flex-direction: column;
    gap: .25rem;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    display: block;
    padding: .85rem 1rem;
    font-size: .95rem;
    font-weight: 500;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 10px;
    transition: background .2s;
}

.mobile-menu a:hover {
    background: var(--blue-soft);
    color: var(--blue);
}

/* ============================================================
       LAYOUT DA PÁGINA DE FORMULÁRIO
    ============================================================ */
.page-wrap {
    min-height: 100vh;
    padding-top: 68px;
    display: flex;
}

/* Coluna esquerda: info/contexto */
.sidebar {
    width: 380px;
    flex-shrink: 0;
    background: linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 60%, #004d99 100%);
    padding: 3rem 2.5rem;
    position: sticky;
    top: 68px;
    height: calc(100vh - 68px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.sidebar-brand {
    position: relative;
    z-index: 1;
}

.sidebar-brand h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.6rem;
    font-weight: 900;
    color: white;
    line-height: 1.2;
    margin-bottom: .5rem;
}

.sidebar-brand p {
    color: rgba(255, 255, 255, .7);
    font-size: .85rem;
    line-height: 1.65;
    font-weight: 300;
}

.sidebar-steps {
    position: relative;
    z-index: 1;
    flex: 1;
}

.sidebar-steps h4 {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .5);
    margin-bottom: 1.2rem;
}

.sidebar-step {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    margin-bottom: 1.2rem;
    position: relative;
}

.sidebar-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 14px;
    top: 32px;
    width: 1px;
    height: calc(100% + .5rem);
    background: rgba(255, 255, 255, .15);
}

.ss-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, .5);
    transition: all .4s;
    position: relative;
    z-index: 1;
    background: transparent;
}

.ss-dot.active {
    background: white;
    border-color: white;
    color: var(--blue);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .2);
}

.ss-dot.done {
    background: rgba(255, 255, 255, .15);
    border-color: rgba(255, 255, 255, .5);
    color: white;
}

.ss-info {
    padding-top: .2rem;
}

.ss-label {
    font-size: .82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .5);
    transition: color .4s;
}

.ss-label.active {
    color: white;
}

.ss-label.done {
    color: rgba(255, 255, 255, .75);
}

.ss-desc {
    font-size: .72rem;
    color: rgba(255, 255, 255, .4);
    margin-top: .15rem;
    line-height: 1.4;
    font-weight: 300;
}

.sidebar-trust {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    padding: 1rem;
}

.trust-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .8rem;
    color: rgba(255, 255, 255, .75);
    margin-bottom: .6rem;
}

.trust-row:last-child {
    margin-bottom: 0;
}

.trust-row span {
    font-size: 1rem;
}

/* Coluna principal: formulário */
.form-main {
    flex: 1;
    padding: 3rem;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* ── Indicador de progresso (mobile) ── */
.progress-mobile {
    display: none;
    margin-bottom: 1.5rem;
}

.progress-mobile-bar {
    height: 4px;
    background: var(--gray-100);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: .5rem;
}

.progress-mobile-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--blue-dark));
    border-radius: 99px;
    transition: width .4s ease;
}

.progress-mobile-label {
    font-size: .75rem;
    color: var(--gray-500);
    font-weight: 500;
}

.progress-mobile-label span {
    color: var(--blue);
    font-weight: 700;
}

/* ── Cards dos steps ── */
.step-panel {
    display: none;
    animation: fadeUp .35s ease;
}

.step-panel.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

.step-header {
    margin-bottom: 2rem;
}

.step-num {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: .4rem;
}

.step-header h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--gray-900);
    margin-bottom: .4rem;
}

.step-header p {
    color: var(--gray-500);
    font-size: .9rem;
    line-height: 1.65;
    font-weight: 300;
}

/* ── Campos do formulário ── */
.form-row {
    margin-bottom: 1.1rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.form-grid.g2 {
    grid-template-columns: 1fr 1fr;
}

.form-grid.g3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.field label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: .7px;
    margin-bottom: .45rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    background: var(--white);
    border: 1.5px solid var(--gray-100);
    border-radius: 10px;
    color: var(--gray-900);
    padding: .8rem 1rem;
    font-size: .92rem;
    font-family: 'Sora', sans-serif;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    appearance: none;
    -webkit-appearance: none;
}

.field input:focus,
.field select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 180, 254, .12);
}

.field input::placeholder {
    color: var(--gray-300);
}

.field input.error,
.field select.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(229, 62, 62, .1);
}

.field .error-msg {
    font-size: .72rem;
    color: var(--error);
    margin-top: .3rem;
    display: none;
}

.field .error-msg.visible {
    display: block;
}

/* Select customizado */
.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2300b4fe' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.8rem;
    cursor: pointer;
}

.field select option {
    background: white;
    color: var(--gray-900);
}

/* Campo com prefixo de moeda */
.input-prefix-wrap {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .85rem;
    font-weight: 700;
    color: var(--blue);
    pointer-events: none;
}

.input-prefix-wrap input {
    padding-left: 3.2rem;
}

/* ── Radio options estilizadas ── */
.radio-group {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.radio-opt {
    flex: 1;
    min-width: 130px;
    background: var(--white);
    border: 1.5px solid var(--gray-100);
    border-radius: 10px;
    padding: .8rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .65rem;
    transition: all .2s;
    user-select: none;
}

.radio-opt:hover {
    border-color: var(--blue-mid);
    background: var(--blue-soft);
}

.radio-opt.selected {
    border-color: var(--blue);
    background: var(--blue-soft);
    box-shadow: 0 0 0 3px rgba(0, 180, 254, .12);
}

.radio-opt input[type="radio"] {
    display: none;
}

.radio-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.radio-dot::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blue);
    opacity: 0;
    transform: scale(0);
    transition: all .2s;
}

.radio-opt.selected .radio-dot {
    border-color: var(--blue);
}

.radio-opt.selected .radio-dot::after {
    opacity: 1;
    transform: scale(1);
}

.radio-opt-text {
    font-size: .88rem;
    font-weight: 500;
    color: var(--gray-700);
}

.radio-opt.selected .radio-opt-text {
    color: var(--blue-dark);
    font-weight: 600;
}

/* ── Campo condicional (aparece/desaparece) ── */
.conditional-field {
    display: none;
    margin-top: .5rem;
    animation: fadeUp .3s ease;
}

.conditional-field.visible {
    display: block;
}

/* ── Navegação do formulário ── */
.form-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-100);
}

.btn-back-form {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: transparent;
    border: 1.5px solid var(--gray-300);
    color: var(--gray-500);
    padding: .75rem 1.4rem;
    border-radius: 99px;
    font-family: 'Sora', sans-serif;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}

.btn-back-form:hover {
    border-color: var(--blue-mid);
    color: var(--blue);
    background: var(--blue-soft);
}

.btn-back-form:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.btn-back-form:disabled:hover {
    border-color: var(--gray-300);
    color: var(--gray-500);
    background: transparent;
}

.btn-next-form {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: white;
    padding: .75rem 1.8rem;
    border-radius: 99px;
    font-family: 'Sora', sans-serif;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    box-shadow: 0 6px 20px rgba(0, 180, 254, .35);
    transition: transform .2s, box-shadow .2s;
}

.btn-next-form:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(0, 180, 254, .45);
}

.btn-submit-form {
    background: linear-gradient(135deg, #16a34a, #15803d);
    box-shadow: 0 6px 20px rgba(22, 163, 74, .3);
}

.btn-submit-form:hover {
    box-shadow: 0 10px 28px rgba(22, 163, 74, .4);
}

/* ── Tela de sucesso ── */
.success-panel {
    display: none;
    text-align: center;
    padding: 3rem 1rem;
    animation: fadeUp .5s ease;
}

.success-panel.visible {
    display: block;
}

.success-anim {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.8rem;
    font-size: 2.5rem;
    box-shadow: 0 0 0 16px rgba(0, 180, 254, .1), 0 16px 48px rgba(0, 180, 254, .25);
    animation: popIn .5s cubic-bezier(.175, .885, .32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-panel h2 {
    font-family: 'Fraunces', serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--gray-900);
    margin-bottom: .7rem;
}

.success-panel p {
    color: var(--gray-500);
    font-size: .95rem;
    line-height: 1.7;
    max-width: 420px;
    margin: 0 auto 2rem;
    font-weight: 300;
}

.success-ref {
    display: inline-block;
    background: var(--blue-soft);
    border: 1px solid var(--blue-mid);
    color: var(--blue-dark);
    font-weight: 700;
    padding: .4rem 1rem;
    border-radius: 99px;
    font-size: .82rem;
    margin-bottom: 2rem;
}

.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-novo {
    /* reutiliza btn-primary */
}

/* ============================================================
       RODAPÉ MINI
    ============================================================ */
.footer-mini {
    text-align: center;
    padding: 1.5rem;
    color: var(--gray-300);
    font-size: .75rem;
    border-top: 1px solid var(--gray-100);
    margin-top: auto;
}

/* ============================================================
       RESPONSIVO
    ============================================================ */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .form-main {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }

    .progress-mobile {
        display: block;
    }

    .form-grid.g3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .form-grid.g2 {
        grid-template-columns: 1fr;
    }

    .form-grid.g3 {
        grid-template-columns: 1fr;
    }

    .form-nav {
        flex-direction: column-reverse;
        gap: .75rem;
    }

    .btn-back-form,
    .btn-next-form {
        width: 100%;
        justify-content: center;
    }

    .nav-back span {
        display: none;
    }

    .hamburger {
        display: flex;
    }
}