/* =====================================================================
   Agrobalsas Inscrições — formulário público
   Padrão visual extraído do kit Elementor do site (post-7.css)
   --------------------------------------------------------------------- */

.agro-form-wrapper {
    --agro-primary: #005E32;
    --agro-primary-dark: #004D29;
    --agro-secondary: #6DDE54;
    --agro-accent: #FFB400;
    --agro-text: #232222;
    --agro-muted: #6b6b6b;
    --agro-border: #E8E8E8;
    --agro-bg: #FFFFFF;
    --agro-bg-soft: #F7FAF7;
    --agro-error: #c22424;
    --agro-radius: 10px;
    --agro-shadow: 0 6px 24px rgba(0, 94, 50, 0.08);

    font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--agro-text);
    line-height: 1.5;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 24px 12px;
    box-sizing: border-box;
}

.agro-form-wrapper *,
.agro-form-wrapper *::before,
.agro-form-wrapper *::after {
    box-sizing: border-box;
}

.agro-form-card {
    width: 100%;
    max-width: 720px;
    background: var(--agro-bg);
    border: 1px solid var(--agro-border);
    border-top: 4px solid var(--agro-primary);
    border-radius: var(--agro-radius);
    box-shadow: var(--agro-shadow);
    padding: 32px;
}

@media (max-width: 600px) {
    .agro-form-card { padding: 22px 18px; }
}

/* ---------- Cabeçalho ---------- */
.agro-form-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--agro-border);
}
.agro-form-title {
    margin: 0 0 6px;
    font-weight: 700;
    font-size: 26px;
    color: var(--agro-primary);
    line-height: 1.2;
}
.agro-form-subtitle {
    margin: 0;
    color: var(--agro-muted);
    font-size: 15px;
}

/* ---------- Sucesso ---------- */
.agro-form-success {
    text-align: center;
    padding: 24px 0;
}
.agro-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--agro-primary);
    color: #fff;
    font-size: 36px;
    line-height: 64px;
    margin: 0 auto 16px;
    font-weight: 700;
}
.agro-form-success h3 {
    color: var(--agro-primary);
    margin: 0 0 8px;
    font-weight: 700;
    font-size: 22px;
}
.agro-success-numero {
    display: inline-block;
    background: var(--agro-accent);
    color: var(--agro-text);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: 1px;
    padding: 10px 22px;
    border-radius: 6px;
    margin: 12px 0 16px;
    font-family: 'Poppins', monospace;
}
.agro-success-msg {
    color: var(--agro-muted);
    font-size: 14px;
    max-width: 480px;
    margin: 8px auto 0;
}

/* ---------- Honeypot ---------- */
.agro-hp {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Campos ---------- */
.agro-field {
    margin-bottom: 18px;
}
.agro-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
@media (max-width: 540px) {
    .agro-row { grid-template-columns: 1fr; gap: 0; }
}

.agro-field label,
.agro-fieldset legend {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--agro-text);
    margin-bottom: 6px;
}
.agro-required {
    color: var(--agro-error);
}

.agro-field input[type="text"],
.agro-field input[type="email"],
.agro-field input[type="tel"],
.agro-field input[type="date"],
.agro-field select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--agro-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    color: var(--agro-text);
    background: var(--agro-bg);
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.agro-field select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23005E32' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

.agro-field input:focus,
.agro-field select:focus {
    outline: none;
    border-color: var(--agro-primary);
    box-shadow: 0 0 0 3px rgba(0, 94, 50, 0.15);
}

.agro-field.has-error input,
.agro-field.has-error select {
    border-color: var(--agro-error);
}
.agro-field.has-error input:focus,
.agro-field.has-error select:focus {
    box-shadow: 0 0 0 3px rgba(194, 36, 36, 0.15);
}

.agro-error {
    display: none;
    color: var(--agro-error);
    font-size: 13px;
    margin-top: 6px;
}
.agro-field.has-error .agro-error {
    display: block;
}

/* ---------- Fieldset de eventos ---------- */
.agro-fieldset {
    border: 1.5px solid var(--agro-border);
    border-radius: 8px;
    padding: 18px;
    margin: 0 0 18px;
}
.agro-fieldset legend {
    padding: 0 8px;
    color: var(--agro-primary);
    font-weight: 700;
    font-size: 16px;
}
.agro-hint {
    margin: 0 0 14px;
    color: var(--agro-muted);
    font-size: 13px;
}

.agro-day-group + .agro-day-group {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed var(--agro-border);
}
.agro-day-title {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--agro-primary-dark);
    text-transform: uppercase;
    letter-spacing: .4px;
}
.agro-events {
    display: grid;
    gap: 8px;
}

.agro-event {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid var(--agro-border);
    border-radius: 8px;
    cursor: pointer;
    background: var(--agro-bg);
    transition: border-color .15s, background .15s;
}
.agro-event:hover { border-color: var(--agro-secondary); background: var(--agro-bg-soft); }
.agro-event input { margin-top: 3px; accent-color: var(--agro-primary); width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
.agro-event input:checked ~ .agro-event-content .agro-event-titulo { color: var(--agro-primary); }
.agro-event:has(input:checked) { border-color: var(--agro-primary); background: var(--agro-bg-soft); }

.agro-event-content { display: flex; flex-direction: column; gap: 2px; }
.agro-event-titulo { font-weight: 600; font-size: 14.5px; color: var(--agro-text); line-height: 1.35; }
.agro-event-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--agro-muted); font-size: 13px; }
.agro-event-horario::before { content: "🕒 "; }

.agro-event.is-esgotado { opacity: 0.55; cursor: not-allowed; }
.agro-event.is-esgotado:hover { border-color: var(--agro-border); background: var(--agro-bg); }

.agro-event-tag {
    background: var(--agro-error);
    color: #fff;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
}

/* ---------- LGPD ---------- */
.agro-field-checkbox { margin-top: 8px; }
.agro-lgpd {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400 !important;
    font-size: 14px !important;
    color: var(--agro-text);
    cursor: pointer;
}
.agro-lgpd input { margin-top: 3px; accent-color: var(--agro-primary); width: 16px; height: 16px; flex-shrink: 0; }
.agro-lgpd a { color: var(--agro-primary); text-decoration: underline; }

/* ---------- Botão ---------- */
.agro-form-footer {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}
.agro-btn {
    border: 0;
    border-radius: 999px;
    padding: 14px 36px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background .15s, transform .1s;
    letter-spacing: .3px;
}
.agro-btn-primary {
    background: var(--agro-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 94, 50, 0.25);
}
.agro-btn-primary:hover:not(:disabled) {
    background: var(--agro-primary-dark);
}
.agro-btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}
.agro-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

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

/* ---------- Erro global ---------- */
.agro-form-error {
    margin-top: 16px;
    padding: 12px 14px;
    background: #fdeded;
    border: 1px solid #f5c2c2;
    border-radius: 8px;
    color: var(--agro-error);
    font-size: 14px;
}
.agro-empty { color: var(--agro-muted); font-style: italic; }
