/* =========================================================
   Forms Incantato · CSS para projetos Kodety
   Coloque este arquivo no projeto Kodety (ex.: css/forms-incantato.css)
   e linke no <head>. Ele faz duas coisas:
   1. desenha o bloco de pré-visualização dentro do editor do Kodety,
      onde o CSS do plugin não é carregado;
   2. no site publicado, as mesmas regras continuam valendo sobre o
      formulário real (mesmas classes .bfc-*).
   Personalize pelas variáveis --bfc-* no seletor .bfc-kodety (ou numa
   classe sua no bloco). Sem !important: o Kodety não permite.
   ========================================================= */

.bfc-kodety {
  --bfc-container-bg: transparent;
  --bfc-container-padding: 0px;
  --bfc-radius: 8px;
  --bfc-field-gap: 16px;
  --bfc-label-color: #1f2937;
  --bfc-input-bg: #ffffff;
  --bfc-input-color: #111827;
  --bfc-placeholder-color: #6b7280;
  --bfc-input-border: #d1d5db;
  --bfc-input-focus: #2563eb;
  --bfc-button-bg: #2563eb;
  --bfc-button-hover-bg: #1d4ed8;
  --bfc-button-text: #ffffff;
  --bfc-button-radius: 8px;
  --bfc-error-color: #dc2626;
  --bfc-icon-color: #111827;
  --bfc-icon-secondary: #e5e7eb;
  --bfc-icon-size: 22px;
  --bfc-icon-padding: 7px;
  --bfc-icon-gap: 10px;
  --bfc-icon-border-width: 1px;
  display: block;
  width: 100%;
}

.bfc-kodety .bfc-form-container {
  background: var(--bfc-container-bg);
  border-radius: var(--bfc-radius);
  box-sizing: border-box;
  padding: var(--bfc-container-padding);
  width: 100%;
}

.bfc-kodety .bfc-form {
  display: flex;
  flex-direction: column;
  gap: var(--bfc-field-gap);
  margin: 0;
}

.bfc-kodety .bfc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.bfc-kodety .bfc-field label {
  color: var(--bfc-label-color);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.bfc-kodety .bfc-input-shell {
  position: relative;
  width: 100%;
}

.bfc-kodety .bfc-input-shell > input,
.bfc-kodety .bfc-input-shell > .iti > input {
  background: var(--bfc-input-bg);
  border: 1px solid var(--bfc-input-border);
  border-radius: var(--bfc-input-radius, var(--bfc-radius));
  box-sizing: border-box;
  color: var(--bfc-input-color);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  min-height: 48px;
  padding: var(--bfc-input-padding-top, 12px) var(--bfc-input-padding-right, 14px) var(--bfc-input-padding-bottom, 12px) var(--bfc-input-padding-left, 14px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.bfc-kodety .bfc-input-shell > input::placeholder,
.bfc-kodety .bfc-input-shell > .iti > input::placeholder {
  color: var(--bfc-placeholder-color);
  opacity: 1;
}

.bfc-kodety .bfc-input-shell > input:focus,
.bfc-kodety .bfc-input-shell > .iti > input:focus {
  border-color: var(--bfc-input-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bfc-input-focus) 18%, transparent);
  outline: none;
}

/* ícones dos campos */
.bfc-kodety .bfc-field-icon {
  align-items: center;
  color: var(--bfc-icon-color);
  display: inline-flex;
  font-size: var(--bfc-icon-size);
  justify-content: center;
  left: var(--bfc-input-padding-left, 14px);
  line-height: 1;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
}

.bfc-kodety .bfc-field-phone .bfc-field-icon {
  left: auto;
  right: var(--bfc-input-padding-right, 14px);
}

.bfc-kodety .bfc-icon-view-stacked,
.bfc-kodety .bfc-icon-view-framed { padding: var(--bfc-icon-padding); }
.bfc-kodety .bfc-icon-view-stacked { background-color: var(--bfc-icon-secondary); }
.bfc-kodety .bfc-icon-view-framed { border: var(--bfc-icon-border-width) solid var(--bfc-icon-secondary); }
.bfc-kodety .bfc-icon-shape-circle { border-radius: 50%; }
.bfc-kodety .bfc-icon-shape-square { border-radius: 4px; }

.bfc-kodety .bfc-input-with-icon > input {
  padding-left: calc(var(--bfc-input-padding-left, 14px) + var(--bfc-icon-size) + var(--bfc-icon-gap));
}
.bfc-kodety .bfc-has-icon-view-stacked > input {
  padding-left: calc(var(--bfc-input-padding-left, 14px) + var(--bfc-icon-size) + (var(--bfc-icon-padding) * 2) + var(--bfc-icon-gap));
}
.bfc-kodety .bfc-has-icon-view-framed > input {
  padding-left: calc(var(--bfc-input-padding-left, 14px) + var(--bfc-icon-size) + (var(--bfc-icon-padding) * 2) + var(--bfc-icon-gap) + (var(--bfc-icon-border-width) * 2));
}
/* no telefone o ícone fica à direita (à esquerda entra o seletor de país) */
.bfc-kodety .bfc-field-phone .bfc-input-with-icon > input {
  padding-left: var(--bfc-input-padding-left, 14px);
  padding-right: calc(var(--bfc-input-padding-right, 14px) + var(--bfc-icon-size) + var(--bfc-icon-gap));
}

/* botão */
.bfc-kodety .bfc-submit {
  align-items: center;
  background: var(--bfc-button-bg);
  border: 0;
  border-radius: var(--bfc-button-radius);
  box-sizing: border-box;
  color: var(--bfc-button-text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  justify-content: center;
  line-height: 1.2;
  min-height: 50px;
  padding: 14px 18px;
  text-align: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
  width: 100%;
}
.bfc-kodety .bfc-submit:hover,
.bfc-kodety .bfc-submit:focus-visible { background: var(--bfc-button-hover-bg); }

.bfc-kodety .bfc-error-message { color: var(--bfc-error-color); font-size: 13px; line-height: 1.35; }
.bfc-kodety .bfc-loading { color: var(--bfc-label-color); padding: 24px 8px; text-align: center; }
.bfc-kodety .bfc-loading p { margin: 0; }

/* ---------------------------------------------------------
   Ícones só na pré-visualização. A fonte Hugeicons vem do plugin
   e só carrega no site publicado; no editor desenhamos o ícone
   com máscara SVG. Depois que o plugin troca o bloco pelo
   formulário real (data-fi-rendered), a fonte assume.
   --------------------------------------------------------- */
.bfc-kodety:not([data-fi-rendered]) .bfc-field-icon i {
  background-color: currentColor;
  display: block;
  height: 1em;
  -webkit-mask: var(--fi-icon) center / contain no-repeat;
  mask: var(--fi-icon) center / contain no-repeat;
  width: 1em;
}
.bfc-kodety .hgi-user { --fi-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4.5 20.5c1.3-3.7 4.1-5.6 7.5-5.6s6.2 1.9 7.5 5.6'/%3E%3C/svg%3E"); }
.bfc-kodety .hgi-user-circle,
.bfc-kodety .hgi-user-account { --fi-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3Cpath d='M6.5 18.5c1.2-2.3 3.2-3.5 5.5-3.5s4.3 1.2 5.5 3.5'/%3E%3C/svg%3E"); }
.bfc-kodety .hgi-mail-01,
.bfc-kodety .hgi-mail-open { --fi-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'%3E%3Crect x='2.5' y='5' width='19' height='14' rx='3'/%3E%3Cpath d='m3 7.5 9 6 9-6'/%3E%3C/svg%3E"); }
.bfc-kodety .hgi-mail-at-sign-01 { --fi-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M16 8v5.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-3.6 7.2'/%3E%3C/svg%3E"); }
.bfc-kodety .hgi-whatsapp { --fi-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M3.2 20.8 4.6 16A8.7 8.7 0 1 1 8 19.4l-4.8 1.4Z'/%3E%3Cpath d='M9.2 8.4c-.6.4-.9 1-.8 1.7.4 2.4 2.8 4.8 5.2 5.2.7.1 1.3-.2 1.7-.8l.3-.6-2-1-.9.8a4 4 0 0 1-2.4-2.4l.8-.9-1-2-.9 0Z'/%3E%3C/svg%3E"); }
.bfc-kodety .hgi-call { --fi-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M4 4.5c0-.6.4-1 1-1h3l1.5 4-2 1.5a11 11 0 0 0 7.5 7.5l1.5-2 4 1.5v3c0 .6-.4 1-1 1C10.8 20 4 13.2 4 4.5Z'/%3E%3C/svg%3E"); }
.bfc-kodety .hgi-smart-phone-01 { --fi-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'%3E%3Crect x='6' y='2.5' width='12' height='19' rx='3'/%3E%3Cpath d='M11 18.5h2'/%3E%3C/svg%3E"); }

/* pré-visualização do DDI (+55) antes do seletor de país real */
.bfc-kodety:not([data-fi-rendered]) .bfc-field-phone .bfc-input-shell > input {
  padding-left: calc(var(--bfc-input-padding-left, 14px) + 44px);
}
.bfc-kodety:not([data-fi-rendered]) .bfc-field-phone .bfc-input-shell::before {
  color: var(--bfc-placeholder-color);
  content: "+55";
  font-size: 16px;
  left: var(--bfc-input-padding-left, 14px);
  line-height: 1;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
