/* RED Forms v1.1.0 — Frontend CSS */

/* ── Wrapper e form ── */
.redf-wrapper { width: 100%; }
.redf-form    { width: 100%; }

/* ── Steps: só o ativo visível ── */
.redf-step        { display: none; }
.redf-step.active { display: block; }

/* ── Elementor editor: mostrar todos com opacidade ── */
.elementor-editor-active .redf-step        { display: block !important; opacity: .4; pointer-events: none; }
.elementor-editor-active .redf-step.active { opacity: 1; pointer-events: auto; }

/* ── Layout de campos ── */
.redf-row   { display: flex; flex-wrap: wrap; gap: 10px; }
.redf-field { box-sizing: border-box; min-width: 0; }

/* ── Label ── */
.redf-label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; }
.redf-req   { color: #e11d48; margin-left: 2px; }

/* ── Inputs ── */
.redf-input {
    width: 100%; box-sizing: border-box;
    padding: 12px 16px; font-size: 14px; font-family: inherit;
    border: 1px solid #ddd; border-radius: 4px;
    background: #fff; color: #333;
    transition: border-color .2s, box-shadow .2s;
    line-height: 1.5;
}
.redf-input:focus { outline: none; border-color: #e11d48; box-shadow: 0 0 0 3px rgba(225,29,72,.12); }

textarea.redf-input { min-height: 120px; resize: vertical; }
select.redf-input   { cursor: pointer; }

/* ── Date / Time com flatpickr ── */
input[type="date"].redf-input,
input[type="time"].redf-input { cursor: pointer; }

/* ── Flatpickr — base (não sobrepõe os controlos do Elementor) ── */
.redf-fp.flatpickr-calendar { font-family: inherit; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.15); border: 1px solid #f1f5f9; overflow: hidden; }
.redf-fp .flatpickr-months  { background: #e11d48; padding: 6px 0; }
.redf-fp .flatpickr-months .flatpickr-month,
.redf-fp .flatpickr-current-month,
.redf-fp .flatpickr-current-month input.cur-year { color: #fff; fill: #fff; }
.redf-fp .flatpickr-current-month .flatpickr-monthDropdown-months { color: #fff; background: transparent; }
.redf-fp .flatpickr-months .flatpickr-prev-month,
.redf-fp .flatpickr-months .flatpickr-next-month { color: #fff; fill: #fff; }
.redf-fp .flatpickr-months .flatpickr-prev-month:hover,
.redf-fp .flatpickr-months .flatpickr-next-month:hover { background: rgba(255,255,255,.15); border-radius: 6px; }
.redf-fp .flatpickr-weekdays { background: #fff0f3; }
.redf-fp .flatpickr-weekday  { color: #e11d48; font-weight: 700; font-size: 12px; }
.redf-fp .flatpickr-days     { border: none; }
.redf-fp .dayContainer       { padding: 6px; }
.redf-fp .flatpickr-day      { border-radius: 8px; font-size: 13px; color: #1e293b; border: none; height: 36px; line-height: 36px; margin: 1px; }
.redf-fp .flatpickr-day:hover { background: #fff0f3; color: #e11d48; }
.redf-fp .flatpickr-day.today { border: 2px solid #e11d48 !important; color: #e11d48; font-weight: 700; background: transparent; }
.redf-fp .flatpickr-day.today:hover { background: #fff0f3; }
.redf-fp .flatpickr-day.selected,
.redf-fp .flatpickr-day.selected:hover { background: #e11d48; color: #fff; border-color: #e11d48; font-weight: 700; }
.redf-fp .flatpickr-day.prevMonthDay,
.redf-fp .flatpickr-day.nextMonthDay { color: #cbd5e1; }

/* ── Checkbox / Radio ── */
.redf-checkgroup,
.redf-radiogroup { display: flex; flex-direction: column; gap: 8px; }
.redf-opt-label  { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.redf-check,
.redf-radio      { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: #e11d48; flex-shrink: 0; }

/* ── Botões ── */
.redf-btn-wrap { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.redf-wa-sep   { margin-top: 10px; display: flex; }

.redf-btn {
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 600;
    border: 1px solid transparent; border-radius: 4px; padding: 12px 28px;
    transition: background-color .2s, color .2s, border-color .2s, transform .1s;
    line-height: 1.4; white-space: nowrap;
}
.redf-btn:active { transform: scale(.98); }

.redf-btn-submit { background: #e11d48; color: #fff; border-color: #e11d48; flex: 1; }
.redf-btn-submit:hover    { background: #be123c; border-color: #be123c; }
.redf-btn-submit:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.redf-btn-next   { background: #e11d48; color: #fff; border-color: #e11d48; flex: 1; }
.redf-btn-next:hover { background: #be123c; }
.redf-btn-prev   { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.redf-btn-prev:hover { background: #e2e8f0; }
.redf-btn-wa     { background: #25d366; color: #fff; border-color: #25d366; flex: 1; gap: 0; }
.redf-btn-wa:hover { background: #128c7e; border-color: #128c7e; }
.redf-btn-wa svg   { fill: #fff; }

/* Loading spinner */
.redf-btn-submit.loading { position: relative; pointer-events: none; color: transparent; }
.redf-btn-submit.loading::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 18px; height: 18px; margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
    border-radius: 50%; animation: redf-spin .7s linear infinite;
}
@keyframes redf-spin { to { transform: rotate(360deg); } }

/* ── Mensagem de sucesso/erro ──
   display:none por defeito — aparece via JS com opacity
   NÃO usa slideDown/slideUp para evitar efeito sanfona ── */
.redf-message {
    display: none;
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}
.redf-message.ok  { background: #d4edda; color: #1d8a4e; border: 1px solid #c3e6cb; }
.redf-message.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Steps Indicator ── */
.redf-indicator { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; overflow: hidden; }
.redf-step-item { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.redf-step-bullet {
    width: 32px; height: 32px; border-radius: 50%;
    background: #e2e8f0; color: #94a3b8;
    font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: background-color .3s, color .3s;
}
.redf-step-item.active    .redf-step-bullet { background: #e11d48; color: #fff; }
.redf-step-item.completed .redf-step-bullet { background: #10b981; color: #fff; font-size: 0; }
.redf-step-item.completed .redf-step-bullet::before { content: '✓'; font-size: 14px; }
.redf-step-label { font-size: 12px; color: #94a3b8; text-align: center; white-space: nowrap; transition: color .3s; }
.redf-step-item.active    .redf-step-label { color: #1e293b; font-weight: 600; }
.redf-step-item.completed .redf-step-label { color: #10b981; }
.redf-step-line { flex: 1; height: 1px; background: #e2e8f0; min-width: 20px; margin-bottom: 18px; }

/* ── Responsive ── */
@media (max-width: 767px) {
    .redf-field    { flex: 0 0 100% !important; max-width: 100% !important; }
    .redf-step-label { display: none; }
    .redf-btn-wrap { flex-direction: column; }
    .redf-btn      { width: 100%; }
}

