/* =============================================================
   Forma - Estilos da página pública (formulário de agendamento)
   Pensados para serem incorporados via iframe no WordPress.
   Tudo é prefixado por .forma-* / classes específicas para
   minimizar conflitos com o tema do WordPress.
   Paleta: #1E3239 (escuro), #00C55F (primária), #0FE08C (accent),
   fundo branco.
   ============================================================= */

/* Reset isolado dentro do app */
.forma-iframe-body, .forma-iframe-body * {
    box-sizing: border-box;
}
.forma-iframe-body {
    margin: 0;
    padding: 0;
    background: #ffffff;
    color: #1E3239;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.55;
}
/* Quando o documento NÃO está em iframe, garante altura mínima cheia. */
html:not(.forma-in-iframe) .forma-iframe-body { min-height: 100vh; }

.forma-app {
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 20px 56px;
}

/* ---------- Cabeçalho ---------- */
.forma-header { margin-bottom: 22px; }
.forma-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}
.forma-brand-icon {
    width: 50px; height: 50px;
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, #00C55F, #0FE08C);
    border: 1px solid rgba(0, 197, 95, .25);
    box-shadow: 0 8px 24px -12px rgba(0, 197, 95, .55);
}
.forma-brand-text { display: flex; flex-direction: column; }
.forma-eyebrow {
    text-transform: uppercase; letter-spacing: 1.6px;
    font-size: 11px; color: #00C55F; font-weight: 700;
}
.forma-title {
    margin: 2px 0 0; font-size: 26px; font-weight: 700; color: #1E3239;
    letter-spacing: -.2px;
}
.forma-subtitle {
    color: #5a6b72; font-size: 15px; margin: 0; max-width: 60ch;
}

/* ---------- Card ---------- */
.forma-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 12px 32px -16px rgba(30, 50, 57, .12);
}

/* ---------- Stepper ---------- */
.forma-stepper {
    list-style: none; margin: 0 0 22px; padding: 0;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.forma-stepper .step {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: #6b7c83;
    border-radius: 10px;
    padding: 10px 12px;
    background: #f7f9fa;
    border: 1px solid #e5e7eb;
    transition: all .2s ease;
}
.forma-stepper .step span {
    width: 22px; height: 22px; border-radius: 999px;
    background: #e5e7eb; color: #1E3239;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
}
.forma-stepper .step.is-active {
    color: #1E3239; border-color: #00C55F;
    background: rgba(15, 224, 140, .10);
}
.forma-stepper .step.is-active span {
    background: #00C55F; color: #fff;
}
.forma-stepper .step.is-done span {
    background: #00C55F; color: #fff;
}

/* ---------- Etapas ---------- */
.forma-step.is-hidden { display: none; }

.forma-h2 {
    color: #1E3239; font-size: 20px; margin: 0 0 6px; letter-spacing: -.2px;
}
.forma-help {
    color: #5a6b72; font-size: 14px; margin: 0 0 18px;
}

/* ---------- Calendário ---------- */
.forma-calendar {
    display: flex; flex-direction: column; gap: 12px;
    background: #f7f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
}
.cal-head {
    display: flex; align-items: center; justify-content: space-between;
}
.cal-title {
    font-weight: 600; color: #1E3239; font-size: 15px;
    text-transform: capitalize;
}
.cal-nav button {
    background: #ffffff; border: 1px solid #d1d5db;
    color: #1E3239; border-radius: 10px; padding: 8px 10px;
    cursor: pointer; transition: all .15s ease;
}
.cal-nav button:hover:not(:disabled) {
    color: #00C55F; border-color: #00C55F; background: rgba(0, 197, 95, .06);
}
.cal-nav button:disabled { opacity: .35; cursor: not-allowed; }

.cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.cal-dow {
    font-size: 11px; text-align: center; color: #6b7c83;
    text-transform: uppercase; letter-spacing: 1px; padding: 6px 0;
    font-weight: 600;
}
.cal-day {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; cursor: pointer;
    color: #1E3239;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
    font-weight: 500;
}
.cal-day:hover:not(.is-disabled):not(.is-empty) {
    border-color: #00C55F;
    background: rgba(15, 224, 140, .10);
    color: #1E3239;
}
.cal-day.is-empty { background: transparent; border: 0; cursor: default; }
.cal-day.is-disabled {
    color: #b8c2c6; cursor: not-allowed;
    background: #f3f4f6; border-color: #e5e7eb;
}
.cal-day.is-today {
    border-color: #0FE08C; color: #1E3239; font-weight: 700;
}
.cal-day.is-selected {
    background: linear-gradient(135deg, #00C55F, #0FE08C);
    color: #fff; border-color: transparent;
    transform: scale(1.04);
    box-shadow: 0 8px 22px -8px rgba(0, 197, 95, .55);
}

/* ---------- Slots ---------- */
.forma-slots {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    min-height: 60px;
}
.slot-btn {
    background: #ffffff;
    color: #1E3239;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 12px 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    font-variant-numeric: tabular-nums;
}
.slot-btn:hover {
    border-color: #00C55F; color: #1E3239;
    background: rgba(15, 224, 140, .10);
}
.slot-btn.is-selected {
    background: linear-gradient(135deg, #00C55F, #0FE08C);
    color: #fff; border-color: transparent;
    box-shadow: 0 8px 22px -10px rgba(0, 197, 95, .55);
}
.slot-empty {
    grid-column: 1 / -1;
    text-align: center; color: #6b7c83; font-size: 14px; padding: 22px;
    background: #f7f9fa; border-radius: 12px;
    border: 1px dashed #d1d5db;
}

/* ---------- Form ---------- */
.grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 14px 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.field-sm { max-width: 130px; }

.field label {
    font-size: 13px; color: #1E3239; font-weight: 600;
    display: inline-flex; gap: 6px; align-items: center;
}
.field .muted { color: #6b7c83; font-weight: 400; }
.field input, .field select, .field textarea {
    width: 100%;
    background: #ffffff;
    color: #1E3239;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
/* Checkbox/radio não devem esticar — sobrescreve o width:100% acima. */
.field input[type="checkbox"],
.field input[type="radio"] {
    width: auto;
    flex: 0 0 auto;
    accent-color: #00C55F;
}

/* Honeypot anti-bot — invisível para humanos, mas presente no DOM
   (não usar display:none, que alguns bots detectam e ignoram). */
.forma-hp {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: #00C55F;
    box-shadow: 0 0 0 3px rgba(0, 197, 95, .18);
}
.field input.is-invalid, .field select.is-invalid, .field textarea.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,.18);
}
.field-error {
    color: #b91c1c; font-size: 12px; margin-top: 2px;
}

.check-field { margin-top: 4px; }
.check {
    display: inline-flex; gap: 10px; align-items: flex-start;
    cursor: pointer; color: #1E3239; font-size: 14px;
}
.check input { margin-top: 4px; }
.check a { color: #00C55F; text-decoration: underline; font-weight: 600; }

/* ---------- Botões / ações ---------- */
.forma-actions {
    display: flex; align-items: center; gap: 10px;
    margin-top: 22px;
    flex-wrap: wrap;
}
.forma-spacer { flex: 1; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 16px; border-radius: 11px;
    font-size: 14px; font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
    font-family: inherit;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, #00C55F, #0FE08C);
    color: #ffffff;
    box-shadow: 0 14px 26px -14px rgba(0, 197, 95, .55);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px -14px rgba(0, 197, 95, .65);
}
.btn-ghost {
    color: #1E3239;
    background: #ffffff;
    border-color: #d1d5db;
}
.btn-ghost:hover { color: #00C55F; border-color: #00C55F; }

/* ---------- Sucesso ---------- */
.forma-success { text-align: center; padding: 12px 0; }
.success-icon {
    width: 88px; height: 88px; border-radius: 999px;
    margin: 0 auto 16px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(15, 224, 140, .15);
    color: #00C55F;
    border: 1px solid rgba(0, 197, 95, .35);
}
.success-summary {
    margin: 16px auto 22px;
    background: #f7f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    max-width: 460px;
    text-align: left;
    color: #1E3239; font-size: 14px;
}
.success-summary strong { color: #1E3239; }

/* ---------- Footer ---------- */
.forma-footer {
    margin-top: 22px; text-align: center;
    color: #6b7c83; font-size: 12px;
}

/* ---------- Modal ---------- */
.forma-modal[hidden] { display: none; }
.forma-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.forma-modal-backdrop {
    position: absolute; inset: 0; background: rgba(30, 50, 57, .55);
    backdrop-filter: blur(4px);
}
.forma-modal-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 560px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    max-height: 80vh;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 48px -16px rgba(30, 50, 57, .35);
}
.forma-modal-card header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid #e5e7eb;
}
.forma-modal-card h3 { margin: 0; color: #1E3239; font-size: 16px; }
.modal-close {
    background: transparent; border: 0; color: #1E3239; font-size: 26px;
    cursor: pointer; line-height: 1; padding: 0 6px;
}
.modal-close:hover { color: #00C55F; }
.forma-modal-body {
    padding: 18px; overflow: auto; color: #1E3239; font-size: 14px;
    white-space: pre-wrap;
}

/* ---------- Toast ---------- */
.forma-toast[hidden] { display: none; }
.forma-toast {
    position: fixed; bottom: 18px; left: 50%;
    transform: translateX(-50%);
    background: #1E3239; color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid rgba(239,68,68,.5);
    box-shadow: 0 18px 35px -18px rgba(30, 50, 57, .5);
    font-size: 14px; z-index: 1100;
    max-width: 90%;
}
.forma-toast.is-info { border-color: rgba(15, 224, 140, .55); }
.forma-toast.is-success { border-color: #0FE08C; }

/* ---------- Loading ---------- */
.is-loading {
    pointer-events: none; opacity: .6;
}
.btn .spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: forma-spin .8s linear infinite;
}
@keyframes forma-spin { to { transform: rotate(360deg); } }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
    .forma-app { padding: 18px 14px 36px; }
    .forma-card { padding: 18px; border-radius: 14px; }
    .forma-stepper { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .forma-stepper .step { font-size: 11px; padding: 8px; }
    .forma-stepper .step span { width: 18px; height: 18px; font-size: 10px; }
    .grid { grid-template-columns: 1fr; }
    .field-sm { max-width: none; }
    .forma-title { font-size: 22px; }
    .forma-subtitle { font-size: 14px; }
}
