/**
 * NativeModal CSS - Stili per sistema modal nativo
 * Allineato al design Q&A del sito (variabili --qa-*)
 * @version 2.0.0
 */

/* ============================================
   Overlay Backdrop
   ============================================ */
.nm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(4px);
}

/* ============================================
   Modal Container
   ============================================ */
.nm-modal {
    background: #fff;
    border-radius: var(--qa-radius-lg, 14px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: 420px;
    width: 90%;
    padding: 32px 28px 24px;
    position: relative;
    transform: scale(0.9) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   Header
   ============================================ */
.nm-header {
    margin-bottom: 18px;
}

.nm-icon {
    text-align: center;
    margin-bottom: 14px;
    line-height: 1;
}

.nm-icon i {
    font-size: 44px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

/* Icon colors by type */
.nm-icon-success { color: var(--qa-green-badge, #059669); }
.nm-icon-error { color: #dc3545; }
.nm-icon-warning { color: #f59e0b; }
.nm-icon-info { color: #3b82f6; }
.nm-icon-question { color: var(--qa-gray-500, #6B7280); }

.nm-title {
    margin: 0;
    padding: 0;
    text-align: center;
    font-size: 17pt;
    font-weight: 700;
    color: var(--qa-gray-800, #1F2937);
    line-height: 1.3;
}

/* ============================================
   Body
   ============================================ */
.nm-body {
    margin-bottom: 24px;
    text-align: center;
    color: var(--qa-gray-600, #4B5563);
    line-height: 1.6;
    font-size: 12pt;
}

.nm-body p {
    margin: 0 0 10px;
}

.nm-body a {
    color: var(--qa-brand-orange, #ff5200);
    text-decoration: none;
    font-weight: 500;
}

.nm-body a:hover {
    color: var(--qa-brand-orange-hover, #D9621A);
    text-decoration: underline;
}

.nm-body strong,
.nm-body b {
    font-weight: 600;
    color: var(--qa-gray-700, #374151);
}

/* ============================================
   Footer con Buttons
   ============================================ */
.nm-footer {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.nm-btn {
    padding: 11px 24px;
    border-radius: var(--qa-radius-sm, 6px);
    cursor: pointer;
    font-weight: 600;
    font-size: 11pt;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    min-width: 100px;
    line-height: 1.3;
}

.nm-btn:focus-visible {
    outline: 2px solid var(--qa-brand-orange, #ff5200);
    outline-offset: 2px;
}

.nm-btn-confirm {
    background: var(--qa-brand-orange, #ff5200);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 82, 0, 0.25);
}

.nm-btn-confirm:hover {
    background: var(--qa-brand-orange-hover, #D9621A);
    box-shadow: 0 4px 12px rgba(255, 82, 0, 0.3);
    transform: translateY(-1px);
}

.nm-btn-confirm:active {
    background: #c04800;
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(255, 82, 0, 0.2);
}

.nm-btn-cancel {
    border: 1px solid var(--qa-gray-200, #E5E7EB);
    background: var(--qa-gray-50, #F9FAFB);
    color: var(--qa-gray-600, #4B5563);
}

.nm-btn-cancel:hover {
    background: var(--qa-gray-100, #F3F4F6);
    border-color: var(--qa-gray-300, #D1D5DB);
    color: var(--qa-gray-700, #374151);
}

.nm-btn-cancel:active {
    background: var(--qa-gray-200, #E5E7EB);
}

/* ============================================
   Close Button
   ============================================ */
.nm-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--qa-gray-50, #F9FAFB);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--qa-gray-400, #9CA3AF);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.nm-close:hover {
    background: var(--qa-gray-100, #F3F4F6);
    color: var(--qa-gray-700, #374151);
}

.nm-close:focus-visible {
    outline: 2px solid var(--qa-brand-orange, #ff5200);
    outline-offset: 2px;
}

/* ============================================
   Responsive - Mobile
   ============================================ */
@media (max-width: 768px) {
    .nm-modal {
        max-width: 92%;
        width: 92%;
        padding: 24px 20px 20px;
        margin: 16px;
    }

    .nm-icon {
        margin-bottom: 10px;
    }

    .nm-title {
        font-size: 15pt;
    }

    .nm-body {
        margin-bottom: 20px;
        font-size: 11pt;
    }

    .nm-footer {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .nm-btn {
        width: 100%;
        min-width: 0;
        padding: 13px 20px;
        font-size: 12pt;
    }

    .nm-close {
        top: 10px;
        right: 10px;
    }
}

/* ============================================
   Responsive - Tablet
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .nm-modal {
        max-width: 420px;
    }
}

/* ============================================
   Print Support
   ============================================ */
@media print {
    .nm-overlay,
    .nm-modal {
        display: none !important;
    }
}
