/* ==============================================================
   needs-form.css — Formulário de levantamento de necessidade
   Escopo: .needs-form (página projetos-solucoes-personalizadas)
   ============================================================== */

.needs-form {
    position: relative;
    padding: 110px 0;
    background: linear-gradient(155deg, #0A2C4A 0%, #0A3A68 55%, #1F6FAA 100%);
    border-top: 1px solid rgba(45, 182, 222, 0.15);
    border-bottom: 1px solid rgba(31, 111, 170, 0.22);
    color: #fff;
    isolation: isolate;
    overflow: hidden;
}

.needs-form::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 500px at 12% 8%, rgba(45, 182, 222, 0.18), transparent 60%),
        radial-gradient(700px 460px at 92% 92%, rgba(125, 211, 239, 0.12), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.needs-form > .container { position: relative; z-index: 1; }

.needs-form__wrap {
    max-width: 920px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid rgba(10, 58, 104, 0.08);
    border-radius: 24px;
    padding: 44px 44px 36px;
    box-shadow:
        0 1px 2px rgba(10, 58, 104, 0.03),
        0 24px 48px -24px rgba(10, 58, 104, 0.18);
}

.needs-form__header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px dashed rgba(10, 58, 104, 0.12);
}

.needs-form__eyebrow {
    display: inline-block;
    font-family: var(--title-font);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #1F6FAA;
    background: linear-gradient(135deg, rgba(45, 182, 222, 0.12) 0%, rgba(31, 111, 170, 0.08) 100%);
    border: 1px solid rgba(45, 182, 222, 0.3);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 18px;
}

.needs-form__title {
    font-family: var(--title-font);
    font-size: clamp(1.5rem, 1.05rem + 1.2vw, 2rem);
    font-weight: 800;
    color: var(--color-primary, #0A3A68);
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    line-height: 1.25;
}

.needs-form__title .accent {
    background: linear-gradient(135deg, #2DB6DE 0%, #1F6FAA 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.needs-form__lead {
    color: var(--color-gray, #5a6772);
    line-height: 1.6;
    margin: 0 auto;
    max-width: 580px;
}

.needs-form__form {
    display: grid;
    gap: 28px;
}

/* --------------------------------------------------------------
   Contador de etapas (Etapa X de 4)
   -------------------------------------------------------------- */
.needs-form__step-counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 0 4px;
}

.needs-form__step-counter-text {
    font-family: var(--title-font);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #1F6FAA;
}

.needs-form__step-counter-text strong {
    color: #0A3A68;
    font-weight: 800;
}

.needs-form__step-counter-progress {
    flex: 1;
    height: 4px;
    background: rgba(10, 58, 104, 0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.needs-form__step-counter-bar {
    position: absolute;
    inset: 0 auto 0 0;
    height: 100%;
    width: 25%;
    background: linear-gradient(90deg, #36C49E 0%, #2DB6DE 60%, #1F6FAA 100%);
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------
   Wizard — abas de etapas (com linha conectora)
   -------------------------------------------------------------- */
.needs-form__steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-bottom: 4px;
    position: relative;
    padding: 8px 4px 4px;
}

/* Linha base atrás dos números */
.needs-form__steps::before {
    content: "";
    position: absolute;
    top: 28px;
    left: calc(12.5% + 4px);
    right: calc(12.5% + 4px);
    height: 2px;
    background: rgba(10, 58, 104, 0.1);
    z-index: 0;
}

.needs-form__step-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 8px;
    background: transparent;
    border: none;
    cursor: not-allowed;
    transition: transform 0.25s ease, color 0.25s ease;
    font-family: var(--title-font);
    color: #8a96a3;
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 1;
}

.needs-form__step-tab.is-clickable { cursor: pointer; }
.needs-form__step-tab.is-clickable:hover {
    transform: translateY(-2px);
    color: #1F6FAA;
}

.needs-form__step-tab.is-active {
    color: #0A3A68;
}

.needs-form__step-tab.is-done {
    color: #176B53;
}

.needs-form__step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(10, 58, 104, 0.12);
    color: #8a96a3;
    font-weight: 800;
    font-size: 0.95rem;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.25s ease, box-shadow 0.3s ease;
    position: relative;
}

.needs-form__step-tab.is-active .needs-form__step-num {
    background: linear-gradient(135deg, #2DB6DE 0%, #1F6FAA 100%);
    border-color: #1F6FAA;
    color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 0 0 5px rgba(45, 182, 222, 0.16), 0 6px 14px -4px rgba(31, 111, 170, 0.5);
}

.needs-form__step-tab.is-done .needs-form__step-num {
    background: linear-gradient(135deg, #36C49E 0%, #2E8C7A 100%);
    border-color: #2E8C7A;
    color: #ffffff;
    box-shadow: 0 4px 12px -4px rgba(54, 196, 158, 0.45);
}

/* Checkmark para etapas concluídas */
.needs-form__step-tab.is-done .needs-form__step-num::before {
    content: "✓";
    font-size: 1.1rem;
    line-height: 1;
}

.needs-form__step-tab.is-done .needs-form__step-num-text {
    display: none;
}

.needs-form__step-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.25;
}

/* --------------------------------------------------------------
   Painéis de etapa
   -------------------------------------------------------------- */
.needs-form__panel {
    display: grid;
    gap: 20px;
    animation: nf-fade-in 0.3s ease;
}

.needs-form__panel[hidden] { display: none !important; }

@keyframes nf-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.needs-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.needs-form__field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.needs-form__field--full {
    grid-column: 1 / -1;
}

.needs-form__field label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #2f3a42;
    letter-spacing: 0.01em;
}

.needs-form__req {
    color: #E8431C;
    font-weight: 700;
}

/* Wrapper pra input com ícone */
.needs-form__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.needs-form__input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8a96a3;
    pointer-events: none;
    width: 16px;
    height: 16px;
    transition: color 0.25s ease;
    z-index: 2;
}

.needs-form__input-wrap:focus-within .needs-form__input-icon {
    color: #1F6FAA;
}

.needs-form__field input[type="text"],
.needs-form__field input[type="email"],
.needs-form__field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid rgba(10, 58, 104, 0.14);
    border-radius: 10px;
    font-size: 0.95rem;
    color: #1a2530;
    background: #f7fafc;
    font-family: inherit;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.needs-form__input-wrap input[type="text"],
.needs-form__input-wrap input[type="email"] {
    padding-left: 40px;
}

.needs-form__field input::placeholder,
.needs-form__field textarea::placeholder {
    color: #aab4bc;
}

.needs-form__field input:hover:not(:focus),
.needs-form__field textarea:hover:not(:focus),
.needs-form__select:hover:not(:focus) {
    border-color: rgba(45, 182, 222, 0.45);
    background: #ffffff;
}

.needs-form__field input:focus,
.needs-form__field textarea:focus {
    outline: none;
    border-color: #2DB6DE;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(45, 182, 222, 0.18);
}

.needs-form__field textarea {
    resize: vertical;
    min-height: 150px;
    line-height: 1.55;
}

/* Dropdown custom */
.needs-form__select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 11px 44px 11px 14px;
    border: 1.5px solid rgba(10, 58, 104, 0.14);
    border-radius: 10px;
    font-size: 0.95rem;
    color: #1a2530;
    background-color: #f7fafc;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F6FAA' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.needs-form__select:focus {
    outline: none;
    border-color: #2DB6DE;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(45, 182, 222, 0.18);
}

.needs-form__alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.needs-form__alert[hidden] { display: none; }

.needs-form__alert--success {
    background: rgba(46, 184, 145, 0.1);
    border: 1px solid rgba(46, 184, 145, 0.4);
    color: #176B53;
}

.needs-form__alert--error {
    background: rgba(232, 67, 28, 0.08);
    border: 1px solid rgba(232, 67, 28, 0.4);
    color: #B0331A;
}

/* --------------------------------------------------------------
   Navegação entre etapas (Voltar / Próximo / Enviar)
   -------------------------------------------------------------- */
.needs-form__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding-top: 22px;
    border-top: 1px dashed rgba(10, 58, 104, 0.12);
    margin-top: 4px;
}

.needs-form__nav-info {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--color-gray, #5a6772);
    font-size: 0.82rem;
}

.needs-form__nav-info svg {
    width: 14px;
    height: 14px;
    color: #1F6FAA;
    flex-shrink: 0;
}

.needs-form__nav-buttons {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.needs-form__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 11px;
    font-family: var(--title-font);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    border: 1.5px solid;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, gap 0.25s ease, background 0.25s ease, opacity 0.2s ease;
}

.needs-form__btn[hidden] { display: none !important; }

.needs-form__btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.needs-form__btn--prev {
    color: #1F6FAA;
    background: #ffffff;
    border-color: rgba(31, 111, 170, 0.4);
}

.needs-form__btn--prev:hover {
    background: rgba(45, 182, 222, 0.06);
    border-color: #2DB6DE;
    transform: translateX(-2px);
}

.needs-form__btn--next,
.needs-form__btn--submit {
    color: #ffffff;
    background: linear-gradient(135deg, #2DB6DE 0%, #1F6FAA 100%);
    border-color: #1F6FAA;
    box-shadow: 0 8px 18px -6px rgba(31, 111, 170, 0.45);
}

.needs-form__btn--next:hover:not(:disabled),
.needs-form__btn--submit:hover:not(:disabled) {
    transform: translateY(-2px);
    gap: 12px;
    box-shadow: 0 12px 24px -8px rgba(31, 111, 170, 0.6);
}

.needs-form__btn--next:hover:not(:disabled) svg,
.needs-form__btn--submit:hover:not(:disabled) svg {
    transform: translateX(2px);
}

.needs-form__btn:disabled {
    opacity: 0.7;
    cursor: progress;
    transform: none !important;
}

@media (max-width: 767.98px) {
    .needs-form { padding: 80px 0; }
    .needs-form__wrap { padding: 32px 24px 28px; border-radius: 20px; }
    .needs-form__row { grid-template-columns: 1fr; }
    .needs-form__form { gap: 24px; }
    .needs-form__steps {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .needs-form__step-tab { padding: 12px 8px 14px; }
    .needs-form__step-label { font-size: 0.72rem; }
    .needs-form__nav { flex-direction: column-reverse; align-items: stretch; gap: 14px; }
    .needs-form__nav-buttons { display: flex; }
    .needs-form__nav-buttons .needs-form__btn { flex: 1; justify-content: center; }
    .needs-form__nav-info { justify-content: center; }
}

@media (max-width: 419.98px) {
    .needs-form__steps { grid-template-columns: 1fr; }
}
