/* Stili messaggi popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1100;
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
/* Modal Container */
.modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 100%;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    /*background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);*/
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
}

.modal-header-content {
    flex: 1;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

/* Bootstrap Icons */
.modal-icon i {
    font-size: 18px;
    color: white;
    opacity: 0.95;
}

.close-button i {
    font-size: 20px;
}

.close-button {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    color: #666;
    flex-shrink: 0;
}

.close-button:hover {
    background-color: #f5f5f5;
    color: #1a1a1a;
}

/* Modal Body */
.modal-body {
    padding: 28px;
}

.modal-message {
    font-size: 17px;
    line-height: 1.6;
    color: #333;
    text-align: center;
}

/* Modal Footer */
.modal-footer {
    padding: 20px 28px;
    /*border-top: 1px solid #e5e5e5;*/
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Buttons */
.btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: #666;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

/* Demo button */
.demo-button {
    padding: 12px 32px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    transition: all 0.2s;
}

.demo-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}

/*.popup {
    display: none;
    top: 50%;
  	left: 50%;
    width: 500px;
    height: 450px;
    position: fixed;
    transform: translate(-50%, -50%);
    color: #000;
    background-color: white;
  	border-radius: 8px;
  	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 2rem;
}
.popup.active {
    display: block;
}
.popup .popup-content {
    padding: 0.5rem;
    padding-top: 0;
}
.popup .popup-content .popup-titolo {
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 0.9rem;
}
.popup .popup-content .msg div {
    padding: 10px 5px;
    list-style: none;
}
.popup .popup-content .msg div.msg-success {
    font-size: 14px;
    color: #000;
}
.popup .popup-content .msg div.msg-warning {
    font-size: 14px;
    color: #000;
}
.popup .popup-content .msg div.msg-error {
    font-size: 20px;
    color: #000;
}
.msg {
    text-align: center;
}
.popup .popup-chiudi {
    position: absolute;
    right: 10px;
    top: 0;
    font-size: 2em;
    cursor: pointer;
    color: black;
    background: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    border: 0;
}
.popup .popup-body {
	font-size: 0.8rem;
}
*/

/* ============================================
   RunAI Popup — Stili specifici
   Scopati sotto #modalWrapperRunAI per non
   interferire con gli altri popup modal.
   ============================================ */

#modalWrapperRunAI {
    --primary-text: #333;
    --secondary-text: #555;
    --border-color: #e5e7eb;
    --shield-bg: #f0fdf4;
    --shield-border: #86efac;
    --shield-text: #166534;
    --shield-glow: rgba(34, 197, 94, 0.5);
    --ocr-bg: #eff6ff;
    --ocr-border: #93c5fd;
    --ocr-text: #1e3a8a;
    --ocr-glow: rgba(59, 130, 246, 0.5);
}

/* Container — max-width leggermente più largo */
#modalWrapperRunAI .modal-container {
    max-width: 500px;
}

/* Header — override padding e border */
#modalWrapperRunAI .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    justify-content: flex-start;
}

#modalWrapperRunAI .modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-text);
    font-weight: 600;
}

/* Icona Bootstrap rotante nell'header */
#modalWrapperRunAI .header-icon {
    font-size: 24px;
    margin-right: 12px;
    color: #f97316;
    animation: runai-spin 2s linear infinite;
    flex-shrink: 0;
    line-height: 1;
}

/* Body — padding uniforme */
#modalWrapperRunAI .modal-body {
    padding: 24px;
}

/* Badge generico */
#modalWrapperRunAI .badge {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid transparent;
}

#modalWrapperRunAI .badge-icon {
    font-size: 22px;
    margin-right: 12px;
    flex-shrink: 0;
    line-height: 1;
}

#modalWrapperRunAI .badge-content {
    display: flex;
    flex-direction: column;
}

#modalWrapperRunAI .badge-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

#modalWrapperRunAI .badge-subtitle {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Badge ShieldLeges */
#modalWrapperRunAI .badge-shield {
    background-color: var(--shield-bg);
    border-color: var(--shield-border);
    color: var(--shield-text);
    animation: runai-pulse-shield 2s infinite;
}
#modalWrapperRunAI .badge-shield .badge-icon {
    color: var(--shield-text);
}

/* Badge OCR */
#modalWrapperRunAI .badge-ocr {
    background-color: var(--ocr-bg);
    border-color: var(--ocr-border);
    color: var(--ocr-text);
    animation: runai-pulse-ocr 2s infinite;
    animation-delay: 1s;
}
#modalWrapperRunAI .badge-ocr .badge-icon {
    color: var(--ocr-text);
}

/* Area specifiche */
#modalWrapperRunAI .specs-area {
    margin-top: 24px;
    background-color: #f9fafb;
    border-left: 4px solid #d1d5db;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
}

#modalWrapperRunAI .specs-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 600;
}

#modalWrapperRunAI .specs-text {
    margin: 0;
    font-size: 0.8rem;
    color: var(--secondary-text);
    text-align: justify;
    line-height: 1.5;
}

#modalWrapperRunAI .specs-text p {
    margin: 0 0 8px 0;
}

#modalWrapperRunAI .specs-text p:last-child {
    margin-bottom: 0;
}

/* Animazioni RunAI */
@keyframes runai-spin {
    100% { transform: rotate(360deg); }
}

@keyframes runai-pulse-shield {
    0%   { box-shadow: 0 0 0 0 var(--shield-glow); }
    70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes runai-pulse-ocr {
    0%   { box-shadow: 0 0 0 0 var(--ocr-glow); }
    70%  { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}