/* Reset e Base */
.popup-rm3-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: popup-rm3-fade-in 0.3s ease;
}

@keyframes popup-rm3-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal */
.popup-rm3-modal {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: popup-rm3-scale-in 0.3s ease;
}

@keyframes popup-rm3-scale-in {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Botão Fechar */
.popup-rm3-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.popup-rm3-close:hover {
    color: #111827;
}

/* Conteúdo */
.popup-rm3-content {
    padding: 2rem;
}

.popup-rm3-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    padding-right: 2rem;
}

/* Formulário */
.popup-rm3-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.popup-rm3-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.popup-rm3-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.4;
}

.popup-rm3-required {
    color: #ef4444;
    margin-left: 0.125rem;
}

/* Inputs */
.popup-rm3-input,
.popup-rm3-form input[type="text"],
.popup-rm3-form input[type="email"],
.popup-rm3-form input[type="tel"],
.popup-rm3-form input[type="number"],
.popup-rm3-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    color: #111827;
    background: #ffffff;
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1.5;
    height: 48px;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.popup-rm3-input:focus,
.popup-rm3-form input:focus,
.popup-rm3-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.popup-rm3-form textarea {
    min-height: 100px;
    height: auto;
    resize: vertical;
}

/* Radio e Checkbox */
.popup-rm3-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .popup-rm3-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

.popup-rm3-option-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    min-height: 48px;
    height: 48px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 400;
    font-size: 0.875rem;
    color: #374151;
    transition: all 0.2s;
    position: relative;
    box-sizing: border-box;
}

.popup-rm3-option-label:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.popup-rm3-option-label input[type="radio"],
.popup-rm3-option-label input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    accent-color: #3b82f6;
}

.popup-rm3-option-label input[type="radio"]:checked,
.popup-rm3-option-label input[type="checkbox"]:checked {
    accent-color: #3b82f6;
}

.popup-rm3-option-label:has(input:checked) {
    border-color: #3b82f6;
    background: #eff6ff;
}

/* Botão Submit */
.popup-rm3-submit-wrapper {
    margin-top: 0.5rem;
}

.popup-rm3-submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    height: 52px;
    box-sizing: border-box;
}

.popup-rm3-submit:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.popup-rm3-submit:active:not(:disabled) {
    transform: translateY(0);
}

.popup-rm3-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mensagens */
.popup-rm3-message {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    margin-top: 1rem;
}

.popup-rm3-message-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.popup-rm3-message-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Erro de Campo */
.popup-rm3-field-error .popup-rm3-input,
.popup-rm3-field-error input,
.popup-rm3-field-error textarea {
    border-color: #ef4444;
}

.popup-rm3-field-error .popup-rm3-label {
    color: #ef4444;
}

/* Responsivo */
@media (max-width: 640px) {
    .popup-rm3-modal {
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .popup-rm3-content {
        padding: 1.5rem;
    }
    
    .popup-rm3-title {
        font-size: 1.25rem;
    }
    
    .popup-rm3-close {
        top: 0.75rem;
        right: 0.75rem;
    }
}

/* Scrollbar personalizada */
.popup-rm3-modal::-webkit-scrollbar {
    width: 8px;
}

.popup-rm3-modal::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 8px;
}

.popup-rm3-modal::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 8px;
}

.popup-rm3-modal::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
