/* ============================================================
   PRO FORMS — FRONTEND (Theme-Respectful Styles)
   Estilos mínimos que herdam do tema ativo. Não impomos
   cores ou fontes — apenas estrutura, estados e validação.
   ============================================================ */

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-4px);
    }
    40% {
        transform: translateX(4px);
    }
    60% {
        transform: translateX(-3px);
    }
    80% {
        transform: translateX(3px);
    }
}

.pro-forms-container {
    max-width: 100%;
    box-sizing: border-box;
}

/* --- Groups --- */
fieldset.pro-form-group {
    border: 0 !important;
    padding: 0 !important;
    margin: 0 0 20px 0 !important;
    min-width: 0 !important;
}

.pro-form-group {
    margin-bottom: 20px;
}

.pro-form-group label,
.pro-form-group legend {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    padding: 0 !important;
    border: 0 !important;
    width: 100%;
}

.pro-form-req {
    color: #dc2626;
    font-weight: 700;
}

/* Inputs estilizados para o plugin (Premium Look) */
.pro-forms-container input[type="text"],
.pro-forms-container input[type="email"],
.pro-forms-container input[type="tel"],
.pro-forms-container input[type="url"],
.pro-forms-container input[type="number"],
.pro-forms-container input[type="password"],
.pro-forms-container input[type="date"],
.pro-forms-container input[type="time"],
.pro-forms-container input[type="file"],
.pro-forms-container textarea,
.pro-forms-container select,
.pro-forms-container .ts-wrapper .ts-control {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
    color: #1e293b;
    transition: all 0.2s ease-in-out;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.pro-forms-container input[type="text"]:focus,
.pro-forms-container input[type="email"]:focus,
.pro-forms-container input[type="tel"]:focus,
.pro-forms-container input[type="url"]:focus,
.pro-forms-container input[type="number"]:focus,
.pro-forms-container input[type="password"]:focus,
.pro-forms-container input[type="date"]:focus,
.pro-forms-container input[type="time"]:focus,
.pro-forms-container input[type="file"]:focus,
.pro-forms-container textarea:focus,
.pro-forms-container select:focus,
.pro-forms-container .ts-wrapper.focus .ts-control {
    background-color: #ffffff;
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.pro-forms-container input:hover,
.pro-forms-container textarea:hover,
.pro-forms-container select:hover,
.pro-forms-container .ts-wrapper:hover .ts-control {
    border-color: #94a3b8;
}

/* --- Description (helper text) --- */
.pro-form-description {
    margin: 5px 0 0 0;
    font-size: 0.85em;
    color: #6b7280;
    line-height: 1.4;
}

/* --- Choices (radio/checkbox) --- */
.pro-form-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    cursor: pointer;
}

.pro-form-choice input[type="checkbox"],
.pro-form-choice input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    min-height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: #2271b1;
}

.pro-form-choice label {
    font-weight: 400;
    margin-bottom: 0;
    cursor: pointer;
    font-size: 1em;
    line-height: 1.4;
}

/* --- Submit Button --- */
.pro-form-submit-group {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pro-form-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    background-color: #2271b1;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        transform 0.1s ease;
    line-height: 1;
    letter-spacing: 0.3px;
}

.pro-form-submit-btn:hover {
    background-color: #135e96;
    transform: translateY(-1px);
}

.pro-form-submit-btn:active {
    transform: translateY(0);
}

.pro-form-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pro-form-spinner {
    font-size: 0.9em;
    color: #6b7280;
}

/* ============================================================
   VALIDAÇÃO VISUAL (Frontend + Backend)
   Usa seletores fortes para garantir prioridade sobre o tema.
   ============================================================ */

/* Estado de erro: borda vermelha nos inputs */
.pro-forms-container .pro-form-group.has-error input[type="text"],
.pro-forms-container .pro-form-group.has-error input[type="email"],
.pro-forms-container .pro-form-group.has-error input[type="tel"],
.pro-forms-container .pro-form-group.has-error input[type="url"],
.pro-forms-container .pro-form-group.has-error input[type="number"],
.pro-forms-container .pro-form-group.has-error input[type="password"],
.pro-forms-container .pro-form-group.has-error input[type="date"],
.pro-forms-container .pro-form-group.has-error input[type="time"],
.pro-forms-container .pro-form-group.has-error input[type="file"],
.pro-forms-container .pro-form-group.has-error textarea,
.pro-forms-container .pro-form-group.has-error select,
.pro-forms-container .pro-form-group.has-error .ts-wrapper .ts-control {
    border: 2px solid #dc2626 !important;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2) !important;
    outline: none !important;
}

.pro-form-condition-hidden {
    display: none !important;
}

/* Borda vermelha também nos checkboxes e radios */
.pro-forms-container .pro-form-group.has-error .pro-form-choice input[type="checkbox"],
.pro-forms-container .pro-form-group.has-error .pro-form-choice input[type="radio"] {
    outline: 2px solid #dc2626 !important;
    outline-offset: 1px;
}

/* Label/Legend do grupo em erro fica vermelho */
.pro-forms-container .pro-form-group.has-error > label,
.pro-forms-container .pro-form-group.has-error > legend {
    color: #dc2626;
}

/* Mensagem de erro inline */
.pro-form-field-error {
    display: block;
    margin-top: 5px;
    font-size: 0.84em;
    color: #dc2626;
    font-weight: 500;
    line-height: 1.3;
}

/* --- Feedback global (sucesso/erro pós-submit) --- */
.pro-form-feedback-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 0.9em;
    line-height: 1.4;
}

.pro-form-feedback-message.is-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.pro-form-feedback-message.is-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.pro-form-datetime-wrapper {
    display: flex !important;
    align-items: stretch !important;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: visible;
    background: #f8fafc;
    transition: all 0.2s ease-in-out;
    position: relative;
    padding: 0 !important;
}
.pro-form-datetime-wrapper:hover {
    border-color: #94a3b8;
}
.pro-form-datetime-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: #fff;
}
.pro-form-group.has-error .pro-form-datetime-wrapper {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}
.pro-form-datetime-wrapper input[type="text"] {
    flex: 1 !important;
    min-width: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: text;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: 0.5px !important;
    height: auto !important;
    outline: none !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
}
.pro-form-datetime-wrapper input[type="text"]:focus {
    border: none !important;
    box-shadow: none !important;
}

/* -- Icon addon — sits flush inside the wrapper border -- */
.pro-form-datetime-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    align-self: stretch !important;
    height: auto !important;
    min-height: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    font-size: 15px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-left: 1px solid #c7d2fe;
    color: #4f46e5;
    pointer-events: auto;
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
}
.pro-form-datetime-wrapper:hover .pro-form-datetime-icon {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4338ca;
    border-color: #a5b4fc;
}
.pro-form-datetime-wrapper:focus-within .pro-form-datetime-icon {
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
    color: #3730a3;
    border-color: #818cf8;
}

/* ============================================================
   CUSTOM DATE PICKER — Calendar Dropdown
   ============================================================ */
@keyframes proPickerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pro-datepicker,
.pro-timepicker {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 99999;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.06);
    padding: 16px;
    font-family:
        system-ui,
        -apple-system,
        "Segoe UI",
        sans-serif;
    animation: proPickerFadeIn 0.2s ease;
}
.pro-datepicker.open,
.pro-timepicker.open {
    display: block;
}
.pro-datepicker {
    min-width: 310px;
}
.pro-timepicker {
    min-width: 200px;
}
.pro-datetimepicker {
    min-width: 340px;
}

/* Header: nav + month + year */
.pro-dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 8px;
}
.pro-dp-nav {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
    padding: 0;
}
.pro-dp-nav:hover {
    background: #e0e7ff;
    color: #4338ca;
}
.pro-dp-selectors {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}
.pro-dp-month {
    padding: 5px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}
.pro-dp-month:focus {
    border-color: #818cf8;
}
.pro-dp-year {
    width: 68px;
    padding: 5px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    background: #fff;
    outline: none;
    -moz-appearance: textfield;
    transition: border-color 0.15s;
}
.pro-dp-year::-webkit-inner-spin-button,
.pro-dp-year::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.pro-dp-year:focus {
    border-color: #818cf8;
}

/* Weekday headers */
.pro-dp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 4px;
}
.pro-dp-weekdays span {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    padding: 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Day cells */
.pro-dp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.pro-dp-day {
    aspect-ratio: 1;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    transition: all 0.12s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-weight: 500;
    position: relative;
}
.pro-dp-day:hover:not(.other) {
    background: #eef2ff;
    color: #4338ca;
}
.pro-dp-day.other {
    color: #d1d5db;
    cursor: default;
    pointer-events: none;
}
.pro-dp-day.today {
    background: #f0f9ff;
    font-weight: 700;
    color: #4f46e5;
}
.pro-dp-day.today::after {
    content: "";
    position: absolute;
    bottom: 4px;
    width: 5px;
    height: 5px;
    background: #4f46e5;
    border-radius: 50%;
}
.pro-dp-day.selected {
    background: #4f46e5 !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.pro-dp-day.selected::after {
    display: none;
}

/* Footer */
.pro-dp-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}
.pro-dp-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.pro-dp-clear {
    color: #64748b;
}
.pro-dp-clear:hover {
    background: #fef2f2;
    color: #ef4444;
}
.pro-dp-today {
    color: #4f46e5;
}
.pro-dp-today:hover {
    background: #eef2ff;
}

/* ============================================================
   CUSTOM TIME PICKER — Hour / Minute Columns
   ============================================================ */
.pro-tp-header {
    display: flex;
    justify-content: space-around;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 8px;
}
.pro-tp-header span {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pro-tp-columns {
    display: flex;
    gap: 6px;
}
.pro-tp-column {
    flex: 1;
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
    padding: 2px;
}
.pro-tp-column::-webkit-scrollbar {
    width: 4px;
}
.pro-tp-column::-webkit-scrollbar-track {
    background: transparent;
}
.pro-tp-column::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}
.pro-tp-column::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.pro-tp-option {
    display: block;
    width: 100%;
    padding: 7px 0;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    text-align: center;
    transition: all 0.12s;
    margin-bottom: 1px;
}
.pro-tp-option:hover {
    background: #eef2ff;
    color: #4338ca;
}
.pro-tp-option.selected {
    background: #4f46e5;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.pro-tp-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

/* DateTime combined: time section separator */
.pro-dt-time-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}
.pro-dt-time-section .pro-tp-columns {
    max-height: 140px;
}
.pro-dt-time-section .pro-tp-column {
    max-height: 130px;
}

/* --- Mobile Responsiveness for Pickers --- */
@media (max-width: 600px) {
    .pro-datepicker,
    .pro-timepicker {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: calc(100vw - 32px);
        max-width: 380px;
        min-width: 0;
        box-sizing: border-box;
        box-shadow:
            0 20px 60px rgba(0, 0, 0, 0.2),
            0 0 0 2000px rgba(15, 23, 42, 0.45);
        animation: proPickerModalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        padding: 20px;
        z-index: 9999999;
    }

    @keyframes proPickerModalScale {
        from {
            opacity: 0;
            transform: translate(-50%, -45%) scale(0.95) !important;
        }
        to {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1) !important;
        }
    }

    /* Increase Touch Targets for Mobile */
    .pro-dp-nav {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    .pro-dp-month,
    .pro-dp-year {
        padding: 8px 10px;
        font-size: 15px;
    }
    .pro-dp-day {
        font-size: 15px;
    }
    .pro-tp-option {
        padding: 10px 0;
        font-size: 15px;
    }
    .pro-dp-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ============================================================
   FILE UPLOAD — Professional Dropzone + File List
   ============================================================ */
.pro-form-file-wrapper {
    position: relative;
    width: 100%;
}
.pro-forms-container input[type="file"].pro-form-file-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    appearance: none !important;
    caret-color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

/* Dropzone label */
.pro-forms-container label.pro-form-file-dropzone {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 28px 20px !important;
    background-color: #f8fafc !important;
    border: 2px dashed #94a3b8 !important;
    border-radius: 10px !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 0 !important;
    min-height: 120px !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    user-select: none !important;
}
.pro-forms-container label.pro-form-file-dropzone *,
.pro-forms-container label.pro-form-file-dropzone span {
    cursor: pointer !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    caret-color: transparent !important;
}
.pro-forms-container label.pro-form-file-dropzone:hover,
.pro-forms-container label.pro-form-file-dropzone.is-dragover {
    border-color: #3b82f6 !important;
    background-color: #eff6ff !important;
}
.pro-forms-container label.pro-form-file-dropzone.is-full {
    border-color: #94a3b8 !important;
    background-color: #f1f5f9 !important;
    cursor: default !important;
    opacity: 0.7 !important;
}

/* Icon */
.pro-forms-container .pro-form-file-icon {
    color: #64748b;
    margin-bottom: 10px;
    transition: all 0.25s ease;
    line-height: 1;
}
.pro-forms-container label.pro-form-file-dropzone:hover .pro-form-file-icon {
    color: #2563eb;
    transform: translateY(-3px);
}

/* Title & subtitle */
.pro-forms-container .pro-form-file-title {
    display: block !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    margin-bottom: 4px !important;
    line-height: 1.4 !important;
}
.pro-forms-container label.pro-form-file-dropzone:hover .pro-form-file-title {
    color: #1e40af !important;
}
.pro-forms-container .pro-form-file-text {
    display: block !important;
    font-size: 13px !important;
    color: #94a3b8 !important;
    line-height: 1.4 !important;
}

/* Focus ring */
.pro-forms-container input[type="file"].pro-form-file-input:focus + label.pro-form-file-dropzone {
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

/* Error state */
.pro-forms-container .pro-form-group.has-error label.pro-form-file-dropzone {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}
.pro-forms-container .pro-form-group.has-error .pro-form-file-icon {
    color: #ef4444;
}

/* --- File List --- */
.pro-form-file-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pro-form-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
    transition: all 0.15s ease;
    animation: proFormFileIn 0.2s ease;
}
@keyframes proFormFileIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.pro-form-file-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.pro-form-file-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
}
.pro-form-file-item-icon.is-pdf {
    background: #ef4444;
}
.pro-form-file-item-icon.is-image {
    background: #8b5cf6;
}
.pro-form-file-item-icon.is-doc {
    background: #3b82f6;
}
.pro-form-file-item-icon.is-other {
    background: #64748b;
}

.pro-form-file-item-info {
    flex: 1;
    min-width: 0;
}
.pro-form-file-item-name {
    display: block;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.pro-form-file-item-size {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.3;
}
.pro-form-file-item-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.15s ease;
    padding: 0;
    line-height: 1;
}
.pro-form-file-item-remove:hover {
    background: #fef2f2;
    color: #ef4444;
}
.pro-form-file-item-remove svg {
    width: 14px;
    height: 14px;
}

/* Counter */
.pro-form-file-counter {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    text-align: right;
}
.pro-form-file-counter.is-full {
    color: #f59e0b;
    font-weight: 600;
}

/* Inline validation */
.pro-form-file-error {
    font-size: 13px;
    color: #ef4444;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: proFormFileIn 0.2s ease;
}

/* === REPEATER (LISTA DINÂMICA) === */
.pro-repeater-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pro-repeater-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pro-repeater-row {
    display: flex;
    gap: 8px;
    align-items: center;
    animation: proFormIn 0.2s ease-out;
}
.pro-repeater-row input {
    flex: 1;
    min-width: 0;
}
.pro-repeater-remove-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.pro-repeater-remove-btn:hover,
.pro-repeater-remove-btn:focus {
    border-color: #ef4444;
    background: #fef2f2;
    color: #ef4444;
    outline: none;
}
.pro-repeater-add-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.pro-repeater-add-btn:hover,
.pro-repeater-add-btn:focus {
    background: #e2e8f0;
    color: #0f172a;
    outline: none;
}
.pro-repeater-add-btn svg {
    width: 16px;
    height: 16px;
}

/* === ALERTS (FEEDBACK MESSAGE) === */
.pro-alert {
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
    animation: proFormIn 0.3s ease-out;
}
.pro-alert-content {
    word-break: break-word;
}
.pro-alert-success {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.pro-alert-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.pro-alert-warning {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}
.pro-alert-info {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* === ALERTS AS DIALOGS (PREMIUM DESIGN) === */
.pro-dialog-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.pro-alert.pro-dialog-box {
    position: relative;
    max-width: 480px;
    width: 100%;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 24px;
    padding: 48px 40px;
    text-align: center;
    box-shadow:
        0 25px 50px -12px rgba(15, 23, 42, 0.25),
        0 0 0 1px rgba(15, 23, 42, 0.05);
    animation: proFormZoomIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    color: #334155;
}

/* Specific Dialog Variants */
.pro-alert-success.pro-dialog-box {
    border-top: 6px solid #10b981;
}
.pro-alert-error.pro-dialog-box {
    border-top: 6px solid #ef4444;
}
.pro-alert-warning.pro-dialog-box {
    border-top: 6px solid #f59e0b;
}
.pro-alert-info.pro-dialog-box {
    border-top: 6px solid #3b82f6;
}

/* Dialog Typography */
.pro-dialog-box h2,
.pro-dialog-box h3 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}
.pro-dialog-box p {
    font-size: 16px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 12px;
}
.pro-dialog-box p:last-child {
    margin-bottom: 0;
}
.pro-dialog-box strong {
    color: #1e293b;
    font-weight: 600;
}

/* Close Button */
.pro-dialog-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}
.pro-dialog-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

@keyframes proFormZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================================
   Upload de Arquivo (File Dropzone)
   ========================================= */
.pro-form-file-wrapper {
    position: relative;
    width: 100%;
}

.pro-form-file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.pro-form-file-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.pro-form-file-dropzone:hover,
.pro-form-file-dropzone:focus-within {
    border-color: #94a3b8;
    background-color: #f1f5f9;
}

.pro-form-file-dropzone.is-dragover {
    border-color: #2563eb;
    background-color: #eff6ff;
}

.pro-form-file-icon {
    color: #64748b;
    margin-bottom: 8px;
}

.pro-form-file-icon svg {
    width: 32px;
    height: 32px;
}

.pro-form-file-text {
    font-weight: 500;
    color: #334155;
    margin-bottom: 4px;
    font-size: 14px;
    display: block;
}

.pro-form-file-sub {
    font-size: 12px;
    color: #64748b;
    display: block;
}

/* Lista de arquivos selecionados */
.pro-form-file-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pro-form-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #f1f5f9;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    color: #334155;
}

.pro-form-file-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85%;
}

.pro-form-file-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
}

.pro-form-file-item-remove:hover {
    background-color: #fee2e2;
}

.pro-form-file-item-remove svg {
    width: 16px;
    height: 16px;
}

.pro-datepicker,
.pro-timepicker {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 280px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    display: none;
    padding: 16px;
    font-family: inherit;
    animation: proFadeIn 0.2s ease;
}

.pro-timepicker {
    width: 200px;
    text-align: center;
}

@keyframes proFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pro-datepicker.open,
.pro-timepicker.open {
    display: block;
}

/* Header */
.pro-dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pro-dp-nav {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}

.pro-dp-nav:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.pro-dp-selectors {
    display: flex;
    gap: 4px;
}

.pro-dp-month,
.pro-dp-year {
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    background: transparent;
    cursor: pointer;
}

.pro-dp-month:hover,
.pro-dp-year:hover {
    background-color: #f1f5f9;
}

.pro-dp-year {
    width: 60px;
    text-align: center;
    -moz-appearance: textfield;
}

.pro-dp-year::-webkit-inner-spin-button,
.pro-dp-year::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Weekdays */
.pro-dp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 8px;
}

.pro-dp-weekdays span {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
}

/* Days */
.pro-dp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.pro-dp-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #334155;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    cursor: pointer;
}

.pro-dp-day:not(.empty):hover {
    background-color: #f1f5f9;
}

.pro-dp-day.empty {
    cursor: default;
}

.pro-dp-day.today {
    font-weight: bold;
    color: #2563eb;
    background-color: #eff6ff;
}

.pro-dp-day.selected {
    background-color: #2563eb;
    color: #ffffff;
    font-weight: bold;
}

/* Footer */
.pro-dp-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.pro-dp-btn {
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 500;
    color: #2563eb;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.pro-dp-btn:hover {
    background-color: #eff6ff;
}

/* Time Picker Specific */
.pro-tp-selectors {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.pro-tp-hours,
.pro-tp-minutes {
    width: 60px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    color: #0f172a;
}

.pro-tp-separator {
    font-size: 20px;
    font-weight: bold;
    color: #64748b;
}

.pro-tp-hours:focus,
.pro-tp-minutes:focus {
    border-color: #2563eb;
    outline: none;
    background: #ffffff;
}

/* ============================================================
   LOCATION FIELDS & TOMSELECT OVERRIDES
   ============================================================ */
.pro-form-br-location-wrapper {
    display: flex;
    gap: 16px;
    width: 100%;
}
.pro-form-br-location-wrapper .pro-form-col-6 {
    flex: 1;
    min-width: 0;
}
@media (max-width: 600px) {
    .pro-form-br-location-wrapper {
        flex-direction: column;
        gap: 16px;
    }
    .pro-form-br-location-wrapper .pro-form-col-6 + .pro-form-col-6 {
        margin-top: 16px;
    }
}

/* TomSelect Override para forçar estilo idêntico aos inputs text */
.pro-forms-container .ts-wrapper .ts-control {
    padding: 12px 16px !important;
    min-height: 48px !important;
    font-size: 15px !important;
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02) !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    color: #1e293b !important;
}
/* Removido o display:none do item ativo para que ele continue aparecendo ao ser selecionado
.pro-forms-container .ts-wrapper.single.input-active .ts-control .item {
    display: none !important;
} */
.pro-forms-container .ts-wrapper.focus .ts-control {
    background-color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}
.pro-forms-container .ts-wrapper:hover .ts-control {
    border-color: #94a3b8 !important;
}
.pro-forms-container .ts-wrapper .ts-control input {
    font-size: 15px !important;
}

/* Dropdown options styling */
.pro-forms-container .ts-dropdown {
    font-size: 15px !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    margin-top: 4px !important;
}
.pro-forms-container .ts-dropdown .option {
    padding: 10px 16px !important;
    font-size: 15px !important;
    color: #1e293b !important;
    cursor: pointer !important;
    transition: background-color 0.1s ease !important;
}
.pro-forms-container .ts-dropdown .option.active {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

/* Loading state animation */
.pf-ts-loading {
    position: relative;
}
.pf-ts-loading .ts-control {
    background-color: #f1f5f9 !important;
    opacity: 0.9;
    pointer-events: none;
    transition: background-color 0.2s ease;
}
.pf-ts-loading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #3b82f6 50%, transparent 100%);
    background-size: 200% 100%;
    animation: pfTsLinearLoading 1.5s infinite linear;
    border-radius: 0 0 6px 6px;
    z-index: 10;
}
@keyframes pfTsLinearLoading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.pro-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: proSpinnerSpin 0.8s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes proSpinnerSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   GRID DE COLUNAS (LAYOUT ROW SYSTEM)
   ============================================================ */
.pro-form-row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -8px;
    margin-right: -8px;
    margin-bottom: 0;
}

.pro-form-row .pro-form-group {
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
    /* Reduz margin-bottom no form-group dentro da row porque a margem pode desalinhar 
       se tivermos linhas de tamanhos diferentes, ou usamos margin unificada */
    margin-bottom: 20px;
}

/* Tamanhos das Colunas */
.pro-form-group[data-col-size="1/2"] { flex: 0 0 50%; max-width: 50%; }
.pro-form-group[data-col-size="1/3"] { flex: 0 0 33.33333%; max-width: 33.33333%; }
.pro-form-group[data-col-size="2/3"] { flex: 0 0 66.66667%; max-width: 66.66667%; }
.pro-form-group[data-col-size="1/4"] { flex: 0 0 25%; max-width: 25%; }
.pro-form-group[data-col-size="3/4"] { flex: 0 0 75%; max-width: 75%; }

/* Responsividade: Tablet */
@media (max-width: 768px) {
    .pro-form-group[data-col-size="1/3"],
    .pro-form-group[data-col-size="1/4"] {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .pro-form-group[data-col-size="2/3"],
    .pro-form-group[data-col-size="3/4"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Responsividade: Mobile */
@media (max-width: 480px) {
    .pro-form-row {
        margin-left: 0;
        margin-right: 0;
    }
    .pro-form-row .pro-form-group {
        padding-left: 0;
        padding-right: 0;
    }
    
    .pro-form-group[data-col-size="1/2"],
    .pro-form-group[data-col-size="1/3"],
    .pro-form-group[data-col-size="2/3"],
    .pro-form-group[data-col-size="1/4"],
    .pro-form-group[data-col-size="3/4"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
