/* ============================================================================
   INPUTS.CSS - Estilo Voa+ / flytap: label estática em cima, input outlined.
   Baseado em site/evento.html + site/assets/css/style.css (.field).
   ============================================================================ */

/* --- Container do campo (label fora, em cima do input) --- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-bottom: 20px;
}

/* --- Label: fora do input, acima --- *
   O stepEngine coloca .field-label dentro de .field-box; usamos
   display:contents em .field-box pra "achatar" o box e deixar o label
   soltar como filho direto de .field, igual ao site/style.css. */
.field-box {
  display: contents;
}

.field-label {
  order: 0;
  font-size: 16px;
  font-weight: 400;
  color: #424045;
  margin: 0 0 2px 2px;
  display: block;
  cursor: text;
  pointer-events: auto;
  transition: color 0.2s ease;
}

.field-box.is-active .field-label { color: var(--text-strong, #0e0d10); }
.field-box.is-invalid .field-label { color: var(--error, #d41820); }

/* --- Input: borda, radius, padding (quem desenha o quadro agora) --- */
.field-input {
  order: 1;
  background: #fff;
  border: 2px solid var(--surface-bold, #e0dfe2);
  border-radius: 6px;
  outline: none;
  font-size: 16px;
  font-weight: 400;
  font-family: inherit;
  padding: 12px 16px;
  width: 100%;
  min-height: 48px;
  color: var(--text-strong, #0e0d10);
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.field-input::placeholder {
  color: #a4a6a8;
  font-weight: 400;
}

.field-input:focus,
.field-box.is-active .field-input {
  border-color: var(--secondary, #65c922);
}

.field-box.is-invalid .field-input {
  border-color: var(--error, #d41820);
}

/* select: usa a mesma borda do input e desenha o caret com SVG */
.field-input--select {
  padding-right: 44px;
  cursor: pointer;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%230e0d10' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.field-input--select:invalid { color: #a4a6a8; }

/* --- Toggle (olho) sobreposto no canto direito do input --- */
.field-toggle-icon {
  order: 2;
  position: relative;
  align-self: flex-end;
  margin: -40px 8px 0 auto;
  width: 24px;
  height: 24px;
  color: var(--text-muted, #6b6a70);
  cursor: pointer;
  transition: color 0.2s ease;
  display: none;
}

.field-box.is-active .field-toggle-icon { display: block; }
.field-toggle-icon:hover { color: var(--secondary, #65c922); }

/* .field-box-content não é mais usado pra layout -- deixado neutro */
.field-box-content { display: contents; }

/* --- Mensagem de erro: fica embaixo do input --- */
.field-message {
  order: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--error, #d41820);
}

.field-message.hidden { display: none; }

.field-message-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.field-message-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  margin-top: 2px;
}

/* --- Helper text --- */
.field-helper-text {
  font-size: 12px;
  color: var(--text-muted, #6b6a70);
  margin-top: 4px;
}

/* --- Checkbox/switch "lembrar" --- */
.remember-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  width: 100%;
}

.remember-label {
  font-size: 15px;
  cursor: pointer;
  font-weight: 400;
  color: var(--text, #424045);
}

.checkbox-container {
  position: relative;
  width: 48px;
  height: 28px;
}

.remember-checkbox {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
}

.checkbox-toggle {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #e4e4e4;
  transition: background 0.3s ease;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.checkbox-ball {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  left: 3px;
  transition: left 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}

.remember-checkbox:checked ~ .checkbox-toggle {
  background: var(--secondary, #65c922);
}

.remember-checkbox:checked ~ .checkbox-toggle .checkbox-ball {
  left: 23px;
}
