/**
 * Ideal Formulários — CSS
 * Todos os seletores começam com .ideal- para evitar conflito com o tema.
 */

.ideal-forms-wrapper {
    /* Cores oficiais Ideal */
    --ideal-azul: #1b2a59;
    --ideal-azul-suave: #4a5878;
    --ideal-azul-bg: rgba(27, 42, 89, 0.04);
    --ideal-amarelo: #e9ac00;
    --ideal-laranja: #ea5a0c;
    --ideal-laranja-suave: rgba(234, 90, 12, 0.08);
    --ideal-verde: #5da231;
    --ideal-verde-hover: #4d8a28;
    --ideal-verde-suave: rgba(93, 162, 49, 0.08);

    /* Neutros */
    --ideal-branco: #ffffff;
    --ideal-cinza-50: #fafbfc;
    --ideal-cinza-100: #f4f5f8;
    --ideal-cinza-200: #e6e8ed;
    --ideal-cinza-300: #d2d6dd;
    --ideal-cinza-500: #8b92a3;
    --ideal-cinza-700: #4a5878;

    /* Estados */
    --ideal-erro: #dc2626;
    --ideal-erro-bg: #fef2f2;

    /* Sombras */
    --ideal-shadow-xs: 0 1px 2px rgba(27, 42, 89, 0.04);
    --ideal-shadow-md: 0 8px 24px rgba(27, 42, 89, 0.08);
    --ideal-shadow-verde: 0 4px 14px rgba(93, 162, 49, 0.3);

    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ideal-azul);
    line-height: 1.5;
    font-weight: 400;
}

.ideal-forms-wrapper *,
.ideal-forms-wrapper *::before,
.ideal-forms-wrapper *::after {
    box-sizing: border-box;
}

.ideal-form {
    max-width: 560px;
    margin: 0 auto;
    background: var(--ideal-branco);
    border-radius: 14px;
    box-shadow: var(--ideal-shadow-md);
    overflow: hidden;
    animation: idealFadeIn 0.3s ease;
}

@keyframes idealFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==== Faixa de marca: 4 blocos sólidos ==== */
.ideal-forms-wrapper .ideal-brand-strip {
    height: 6px;
    background: linear-gradient(
        to right,
        var(--ideal-laranja) 0%, var(--ideal-laranja) 25%,
        var(--ideal-amarelo) 25%, var(--ideal-amarelo) 50%,
        var(--ideal-verde) 50%, var(--ideal-verde) 75%,
        var(--ideal-azul) 75%, var(--ideal-azul) 100%
    );
}

.ideal-forms-wrapper .ideal-form-inner {
    padding: 28px 28px 24px;
}

/* ==== Header ==== */
.ideal-forms-wrapper .ideal-form-header {
    margin-bottom: 24px;
}

.ideal-forms-wrapper .ideal-eyebrow {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ideal-laranja);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.ideal-forms-wrapper .ideal-form-header h2 {
    color: var(--ideal-azul);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.ideal-forms-wrapper .ideal-form-header p {
    color: var(--ideal-cinza-700);
    font-size: 13px;
    font-weight: 400;
    margin: 0;
}

/* ==== Linhas / colunas ==== */
.ideal-forms-wrapper .ideal-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
    align-items: start;
}

.ideal-forms-wrapper .ideal-form-row.row-uf-cidade {
    grid-template-columns: 1fr 2fr;
}

.ideal-forms-wrapper .ideal-form-row.full {
    grid-template-columns: 1fr;
}

/* ==== Campos ==== */
.ideal-forms-wrapper .ideal-field {
    display: flex;
    flex-direction: column;
    position: relative;
}

.ideal-forms-wrapper .ideal-field label {
    color: var(--ideal-azul);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.ideal-forms-wrapper .ideal-field label svg {
    width: 14px;
    height: 14px;
    color: var(--ideal-cinza-500);
    flex-shrink: 0;
}

.ideal-forms-wrapper .ideal-field label .ideal-required {
    color: var(--ideal-laranja);
    margin-left: 2px;
    font-weight: 700;
}

.ideal-forms-wrapper .ideal-field input[type="text"],
.ideal-forms-wrapper .ideal-field input[type="email"],
.ideal-forms-wrapper .ideal-field input[type="tel"],
.ideal-forms-wrapper .ideal-field select,
.ideal-forms-wrapper .ideal-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--ideal-cinza-200);
    border-radius: 8px;
    font-size: 13.5px;
    font-family: 'Poppins', sans-serif;
    color: var(--ideal-azul);
    background: var(--ideal-branco);
    transition: all 0.15s;
    outline: none;
    font-weight: 400;
    line-height: 1.4;
}

.ideal-forms-wrapper .ideal-field input,
.ideal-forms-wrapper .ideal-field select { height: 40px; }

.ideal-forms-wrapper .ideal-field textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.55;
}

.ideal-forms-wrapper .ideal-field input:hover,
.ideal-forms-wrapper .ideal-field select:hover,
.ideal-forms-wrapper .ideal-field textarea:hover {
    border-color: var(--ideal-cinza-300);
}

.ideal-forms-wrapper .ideal-field input:focus,
.ideal-forms-wrapper .ideal-field select:focus,
.ideal-forms-wrapper .ideal-field textarea:focus {
    border-color: var(--ideal-azul);
    box-shadow: 0 0 0 3px var(--ideal-azul-bg);
}

.ideal-forms-wrapper .ideal-field input::placeholder,
.ideal-forms-wrapper .ideal-field textarea::placeholder {
    color: var(--ideal-cinza-500);
    font-weight: 400;
    opacity: 1;
}

/* ==== Estados de erro ==== */
.ideal-forms-wrapper .ideal-field input.has-error,
.ideal-forms-wrapper .ideal-field select.has-error,
.ideal-forms-wrapper .ideal-field textarea.has-error {
    border-color: var(--ideal-erro) !important;
    background-color: var(--ideal-erro-bg);
}

.ideal-forms-wrapper .ideal-field input.has-error:focus,
.ideal-forms-wrapper .ideal-field select.has-error:focus,
.ideal-forms-wrapper .ideal-field textarea.has-error:focus {
    border-color: var(--ideal-erro) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

.ideal-forms-wrapper .ideal-field-error {
    color: var(--ideal-erro);
    font-size: 11.5px;
    margin-top: 5px;
    font-weight: 500;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ideal-forms-wrapper .ideal-field-error:empty { display: none; }

.ideal-forms-wrapper .ideal-field-error::before {
    content: '⚠';
    font-size: 11px;
}

/* ==== Tom Select ==== */
.ideal-forms-wrapper .ts-wrapper {
    width: 100% !important;
}

.ideal-forms-wrapper .ts-wrapper.single .ts-control {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3e%3cpath d='M1 1L5 5L9 1' stroke='%231b2a59' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 32px !important;
}

.ideal-forms-wrapper .ts-control {
    border: 1.5px solid var(--ideal-cinza-200) !important;
    border-radius: 8px !important;
    padding: 7px 12px !important;
    min-height: 40px !important;
    font-size: 13.5px !important;
    background-color: var(--ideal-branco) !important;
    transition: all 0.15s !important;
    box-shadow: none !important;
    font-family: 'Poppins', sans-serif !important;
}

.ideal-forms-wrapper .ts-control input {
    font-family: 'Poppins', sans-serif !important;
    font-size: 13.5px !important;
    color: var(--ideal-azul) !important;
}

.ideal-forms-wrapper .ts-control:hover { border-color: var(--ideal-cinza-300) !important; }

.ideal-forms-wrapper .ts-wrapper.focus .ts-control {
    border-color: var(--ideal-azul) !important;
    box-shadow: 0 0 0 3px var(--ideal-azul-bg) !important;
}

.ideal-forms-wrapper .ts-control input::placeholder {
    color: var(--ideal-cinza-500) !important;
}

.ts-dropdown {
    border: 1.5px solid var(--ideal-cinza-200, #e6e8ed) !important;
    border-radius: 8px !important;
    margin-top: 4px !important;
    box-shadow: 0 8px 24px rgba(27, 42, 89, 0.08) !important;
    overflow: hidden;
    font-family: 'Poppins', sans-serif !important;
}

.ts-dropdown .option {
    padding: 9px 12px !important;
    font-size: 13.5px !important;
    color: var(--ideal-azul, #1b2a59) !important;
    font-weight: 400 !important;
}

.ts-dropdown .option:hover,
.ts-dropdown .active {
    background: var(--ideal-laranja-suave, rgba(234, 90, 12, 0.08)) !important;
    color: var(--ideal-azul, #1b2a59) !important;
    font-weight: 500 !important;
}

.ts-dropdown .no-results {
    padding: 12px;
    color: var(--ideal-cinza-500, #8b92a3);
    font-size: 12.5px;
    text-align: center;
}

/* ==== File upload ==== */
.ideal-forms-wrapper .ideal-file-wrapper {
    position: relative;
    width: 100%;
}

.ideal-forms-wrapper .ideal-file-display {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px dashed var(--ideal-cinza-300);
    border-radius: 8px;
    text-align: left;
    color: var(--ideal-cinza-500);
    cursor: pointer;
    background: var(--ideal-cinza-50);
    font-size: 13.5px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    font-weight: 400;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
}

.ideal-forms-wrapper .ideal-file-display:hover {
    border-color: var(--ideal-azul);
    border-style: solid;
    color: var(--ideal-azul);
    background: var(--ideal-azul-bg);
}

.ideal-forms-wrapper .ideal-file-display.has-file {
    border-style: solid;
    border-color: var(--ideal-verde);
    color: var(--ideal-azul);
    background: var(--ideal-verde-suave);
    font-weight: 500;
}

.ideal-forms-wrapper .ideal-file-display .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.ideal-forms-wrapper .ideal-file-display .text { flex: 1; }

.ideal-forms-wrapper .ideal-file-display .badge {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ideal-cinza-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--ideal-branco);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--ideal-cinza-200);
}

.ideal-forms-wrapper .ideal-file-display.has-file .badge {
    background: var(--ideal-verde);
    color: var(--ideal-branco);
    border-color: var(--ideal-verde);
}

.ideal-forms-wrapper .ideal-file-display input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ideal-forms-wrapper .ideal-field-hint {
    color: var(--ideal-cinza-500);
    font-size: 11px;
    margin-top: 4px;
    font-weight: 400;
}

/* ==== Submit ==== */
.ideal-forms-wrapper .ideal-submit-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--ideal-cinza-200);
    gap: 12px;
}

.ideal-forms-wrapper .ideal-submit-info {
    color: var(--ideal-cinza-500);
    font-size: 11px;
    font-weight: 400;
    flex: 1;
}

.ideal-forms-wrapper button[type="submit"] {
    background: var(--ideal-verde);
    color: var(--ideal-branco);
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Poppins', sans-serif;
    box-shadow: var(--ideal-shadow-xs);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    letter-spacing: 0.01em;
    line-height: 1;
}

.ideal-forms-wrapper button[type="submit"]:hover:not(:disabled) {
    background: var(--ideal-verde-hover);
    box-shadow: var(--ideal-shadow-verde);
    transform: translateY(-1px);
}

.ideal-forms-wrapper button[type="submit"]:active:not(:disabled) {
    transform: translateY(0);
}

.ideal-forms-wrapper button[type="submit"]:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.ideal-forms-wrapper button[type="submit"] svg {
    width: 14px;
    height: 14px;
    transition: transform 0.15s;
}

.ideal-forms-wrapper button[type="submit"]:hover:not(:disabled) svg {
    transform: translateX(2px);
}

/* ==== Honeypot — invisível para humanos ==== */
.ideal-forms-wrapper .ideal-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
    height: 0;
    width: 0;
}

/* ==== Feedback de envio ==== */
.ideal-forms-wrapper .ideal-form-feedback {
    margin-top: 16px;
    padding: 0;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
    min-height: 0;
}

.ideal-forms-wrapper .ideal-form-feedback.success {
    color: var(--ideal-verde-hover);
    background: var(--ideal-verde-suave);
    border: 1px solid var(--ideal-verde);
    padding: 12px 14px;
    border-radius: 8px;
}

.ideal-forms-wrapper .ideal-form-feedback.error {
    color: var(--ideal-erro);
    background: var(--ideal-erro-bg);
    border: 1px solid var(--ideal-erro);
    padding: 12px 14px;
    border-radius: 8px;
}

/* ==== Mobile ==== */
@media (max-width: 600px) {
    .ideal-forms-wrapper .ideal-form-inner { padding: 22px 18px 20px; }
    .ideal-forms-wrapper .ideal-form-row,
    .ideal-forms-wrapper .ideal-form-row.row-uf-cidade {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .ideal-forms-wrapper .ideal-form-header h2 { font-size: 19px; }
    .ideal-forms-wrapper .ideal-submit-row {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 12px;
    }
    .ideal-forms-wrapper .ideal-submit-info { text-align: center; }
    .ideal-forms-wrapper button[type="submit"] {
        width: 100%;
        justify-content: center;
    }
}
