/* CBEM Formulário de Contato - Frontend */

/* Escopo e tokens */
.cbem-form {
    --blue: #03569A;
    --text: #1E1E1E;
    --soft: #8b8d8c;
    --err: #B81C1D;
    --bd: rgba(209, 209, 209, .4);
    font-family: 'Montserrat', Arial, sans-serif;
    width: 100%;
    max-width: 100%;
    display: block;
}

.cbem-form * {
    box-sizing: border-box;
}

/* Container conforme Figma (px:22, py:48, radius:20, bg overlay 0.4) */
.cbem-form .shell {
    width: 100%;
    padding: 48px 22px;
    border-radius: 20px;
    background: linear-gradient(90deg, rgba(209, 209, 209, .4), rgba(209, 209, 209, .4)), #fff;
}

/* Abas */
.cbem-form .tabs {
    display: flex;
    gap: 16px;
    margin: 0 0 24px;
}

.cbem-form .tab {
    appearance: none;
    border: 1px solid var(--blue);
    color: var(--blue);
    background: #fff;
    border-radius: 999px;
    padding: 12px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cbem-form .tab:hover {
    background: rgba(3, 86, 154, 0.1);
}

.cbem-form .tab[aria-selected="true"] {
    background: var(--blue);
    color: #fff;
}

/* Grid de campos (duas colunas quando couber) */
.cbem-form .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(246px, 1fr));
    gap: 24px;
}

@media (min-width: 1025px) {
    .cbem-form .grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Campo (label + input) */
.cbem-form .field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cbem-form .label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 16px;
    color: var(--text);
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    opacity: .8;
}

.cbem-form .req {
    color: var(--err);
    font: 600 13px/20px 'Source Sans Pro', Arial;
}

.cbem-form .control {
    background: #fff;
    border: 1px solid var(--bd);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 16px;
    line-height: 24px;
    transition: border-color 0.3s ease;
}

.cbem-form .control:focus {
    outline: none;
    border-color: var(--blue);
}

.cbem-form textarea.control {
    min-height: 96px;
    resize: vertical;
    font-family: 'Montserrat', Arial, sans-serif;
}

.cbem-form .hint {
    color: var(--soft);
    font-size: 12px;
    line-height: 18px;
    padding: 0 16px;
}

/* Arquivo */
.cbem-form .file {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cbem-form .file .btn {
    background: var(--blue);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.cbem-form .file .btn:hover {
    background: #024a85;
}

.cbem-form input[type=file] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.cbem-form .file-name {
    color: var(--soft);
    font-size: 14px;
    word-break: break-word;
}

.cbem-form .error {
    color: var(--err);
    font-size: 13px;
    line-height: 20px;
    padding: 0 16px;
}

/* Rodapé */
.cbem-form .actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

.cbem-form .submit {
    background: var(--blue);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 14px 22px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 16px;
}

.cbem-form .submit:hover {
    background: #024a85;
}

.cbem-form .submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Mensagens de feedback */
.cbem-form .form-message {
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.cbem-form .form-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.cbem-form .form-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Responsivo: mobile/tablet empilhado naturalmente pelo grid */
@media (max-width: 767px) {
    .cbem-form .tabs {
        flex-wrap: wrap;
    }

    .cbem-form .grid {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .cbem-form .shell {
        max-width: 100%;
        overflow-x: hidden;
        padding: 32px 16px;
    }

    .cbem-form .file-name {
        word-break: break-word;
    }

    .cbem-form .tab {
        font-size: 14px;
        padding: 10px 14px;
    }
}

