/* ============================================================
   Kommo Lead Capture — Form Styles
   Alta especificidade via .klc-form-wrap.klc-form-wrap
   ============================================================ */

.klc-form-wrap.klc-form-wrap {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #333;
    box-sizing: border-box;
}

.klc-form-wrap.klc-form-wrap *,
.klc-form-wrap.klc-form-wrap *::before,
.klc-form-wrap.klc-form-wrap *::after {
    box-sizing: border-box;
}

/* ── Linha 1: Nome | Sobrenome ─────────────── */
.klc-form-wrap.klc-form-wrap .klc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

/* ── Linha 2: [E-mail / Telefone] | [Mensagem] ─ */
.klc-form-wrap.klc-form-wrap .klc-row--mid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
    align-items: stretch;
}

.klc-form-wrap.klc-form-wrap .klc-col-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.klc-form-wrap.klc-form-wrap .klc-col-right {
    display: flex;
    flex-direction: column;
}

/* Mensagem ocupa toda a altura da coluna direita */
.klc-form-wrap.klc-form-wrap .klc-col-right .klc-field--message {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.klc-form-wrap.klc-form-wrap .klc-col-right .klc-field--message textarea {
    flex: 1;
    resize: none !important;
    min-height: 0 !important;
}

/* ── Submit ─────────────────────────────────── */
.klc-form-wrap.klc-form-wrap .klc-row--submit {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

/* ── Campo genérico ─────────────────────────── */
.klc-form-wrap.klc-form-wrap .klc-field {
    position: relative;
    display: flex;
    flex-direction: column;
}

.klc-form-wrap.klc-form-wrap .klc-field input[type="text"],
.klc-form-wrap.klc-form-wrap .klc-field input[type="email"],
.klc-form-wrap.klc-form-wrap .klc-field input[type="tel"],
.klc-form-wrap.klc-form-wrap .klc-field textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid #d0d5dd !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    color: #333 !important;
    background: #fff !important;
    box-shadow: none !important;
    outline: none;
    font-family: inherit;
    transition: border-color .18s, box-shadow .18s;
    margin: 0;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
}

.klc-form-wrap.klc-form-wrap .klc-field input::placeholder,
.klc-form-wrap.klc-form-wrap .klc-field textarea::placeholder {
    color: #adb5bd !important;
    opacity: 1;
}

.klc-form-wrap.klc-form-wrap .klc-field input:focus,
.klc-form-wrap.klc-form-wrap .klc-field textarea:focus {
    border-color: #066aab !important;
    box-shadow: 0 0 0 3px rgba(6,106,171,.12) !important;
    outline: none !important;
}

.klc-form-wrap.klc-form-wrap .klc-field input.klc-invalid,
.klc-form-wrap.klc-form-wrap .klc-field textarea.klc-invalid {
    border-color: #dc3545 !important;
}

.klc-form-wrap.klc-form-wrap .klc-field input.klc-invalid:focus,
.klc-form-wrap.klc-form-wrap .klc-field textarea.klc-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220,53,69,.12) !important;
}

.klc-form-wrap.klc-form-wrap .klc-field-error {
    display: none;
    font-size: 12px;
    color: #dc3545;
    margin-top: 4px;
    line-height: 1.3;
}

/* ── Campo de telefone ──────────────────────── */
.klc-form-wrap.klc-form-wrap .klc-phone-wrap {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    border: 1.5px solid #d0d5dd !important;
    border-radius: 6px !important;
    overflow: visible;
    background: #fff !important;
    transition: border-color .18s, box-shadow .18s;
    padding: 0 !important;
    margin: 0 !important;
}

.klc-form-wrap.klc-form-wrap .klc-phone-wrap:focus-within {
    border-color: #066aab !important;
    box-shadow: 0 0 0 3px rgba(6,106,171,.12) !important;
}

.klc-form-wrap.klc-form-wrap .klc-phone-wrap.klc-invalid {
    border-color: #dc3545 !important;
}

.klc-form-wrap.klc-form-wrap .klc-phone-wrap .klc-flag-btn {
    all: unset !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 0 10px 0 12px !important;
    background: transparent !important;
    border: none !important;
    border-right: 1.5px solid #d0d5dd !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    font-size: 20px !important;
    line-height: 1 !important;
    color: #555 !important;
    flex-shrink: 0 !important;
    min-height: 44px !important;
    width: auto !important;
    box-shadow: none !important;
    text-decoration: none !important;
    transition: background .15s !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    outline: none !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

.klc-form-wrap.klc-form-wrap .klc-phone-wrap .klc-flag-btn:hover {
    background: #f5f7fa !important;
}

.klc-form-wrap.klc-form-wrap .klc-phone-wrap .klc-flag-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.klc-form-wrap.klc-form-wrap .klc-phone-wrap .klc-flag-emoji {
    font-size: 20px !important;
    line-height: 1 !important;
    display: inline-block !important;
}

.klc-form-wrap.klc-form-wrap .klc-phone-wrap .klc-chevron {
    width: 10px !important;
    height: 6px !important;
    color: #888 !important;
    transition: transform .2s !important;
    flex-shrink: 0 !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.5px !important;
}

.klc-form-wrap.klc-form-wrap .klc-phone-wrap .klc-chevron.open {
    transform: rotate(180deg) !important;
}

.klc-form-wrap.klc-form-wrap .klc-phone-wrap input[type="tel"] {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    flex: 1 !important;
    padding: 13px 14px !important;
    font-size: 15px !important;
    outline: none !important;
    background: transparent !important;
    min-width: 0;
    margin: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* ── Dropdown de países ─────────────────────── */
.klc-form-wrap.klc-form-wrap .klc-country-dropdown {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    left: 0 !important;
    width: 300px !important;
    background: #fff !important;
    border: 1.5px solid #d0d5dd !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.14) !important;
    z-index: 99999 !important;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

.klc-form-wrap.klc-form-wrap .klc-country-search {
    display: block !important;
    width: 100% !important;
    padding: 10px 14px !important;
    border: none !important;
    border-bottom: 1px solid #eee !important;
    border-radius: 0 !important;
    font-size: 14px !important;
    outline: none !important;
    box-shadow: none !important;
    background: #fff !important;
    color: #333 !important;
    margin: 0 !important;
}

.klc-form-wrap.klc-form-wrap .klc-country-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 4px 0 !important;
    max-height: 220px !important;
    overflow-y: auto !important;
}

.klc-form-wrap.klc-form-wrap .klc-country-list li {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 9px 14px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    color: #333 !important;
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    list-style: none !important;
    transition: background .1s !important;
}

.klc-form-wrap.klc-form-wrap .klc-country-list li:hover,
.klc-form-wrap.klc-form-wrap .klc-country-list li.active {
    background: #f0f6fb !important;
}

.klc-form-wrap.klc-form-wrap .klc-country-list li .klc-li-flag {
    font-size: 20px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

.klc-form-wrap.klc-form-wrap .klc-country-list li .klc-li-name {
    flex: 1 !important;
    color: #333 !important;
}

.klc-form-wrap.klc-form-wrap .klc-country-list li .klc-li-dial {
    color: #888 !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
}

/* ── Botão de envio ─────────────────────────── */
.klc-form-wrap.klc-form-wrap #klc-submit-btn {
    all: unset !important;
    display: inline-block !important;
    padding: 14px 40px !important;
    background: #066aab !important;
    color: #fff !important;
    border: none !important;
    border-radius: 50px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    font-family: inherit !important;
    box-shadow: none !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.klc-form-wrap.klc-form-wrap #klc-submit-btn:disabled {
    opacity: .65 !important;
    cursor: not-allowed !important;
}

/* ── Mensagens ──────────────────────────────── */
.klc-form-wrap.klc-form-wrap #klc-success-msg {
    padding: 16px 20px !important;
    background: #f0faf4 !important;
    border: 1.5px solid #b7e4c7 !important;
    border-radius: 8px !important;
    margin-bottom: 16px !important;
}

.klc-form-wrap.klc-form-wrap .klc-success-inner {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.klc-form-wrap.klc-form-wrap .klc-success-inner svg {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0 !important;
}

.klc-form-wrap.klc-form-wrap .klc-success-inner p {
    margin: 0 !important;
    font-size: 15px !important;
    color: #1a6b3a !important;
}

.klc-form-wrap.klc-form-wrap #klc-error-msg {
    padding: 12px 16px !important;
    background: #fff5f5 !important;
    border: 1.5px solid #fcc !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #c0392b !important;
    margin-bottom: 12px !important;
}

/* ── Responsivo ─────────────────────────────── */
@media (max-width: 520px) {
    .klc-form-wrap.klc-form-wrap .klc-row,
    .klc-form-wrap.klc-form-wrap .klc-row--mid {
        grid-template-columns: 1fr !important;
    }
    .klc-form-wrap.klc-form-wrap .klc-col-right .klc-field--message textarea {
        min-height: 90px !important;
    }
}
