/* Modal Base */
.legacy-modal-overlay {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.legacy-modal-overlay.active {
    display: flex;
}

.legacy-modal-backdrop {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0.75rem;
}

.legacy-modal-container {
    background: linear-gradient(135deg, #fef3c7 0%, #ffffff 50%, #dbeafe 100%);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 32rem;
    width: 100%;
    max-height: 38rem;
    margin: 0 auto;
    z-index: 10;
    transform: scale(1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Background Pattern Elements */
.legacy-modal-bg-pattern {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -10;
    border-radius: 1rem;
}

.legacy-modal-bg-circle-1 {
    top: -5rem;
    right: -4rem;
    width: 10rem;
    height: 10rem;
    background: linear-gradient(135deg, #fbbf24 0%, #60a5fa 100%);
    border-radius: 50%;
    opacity: 0.3;
    filter: blur(3rem);
}

.legacy-modal-bg-circle-2 {
    bottom: -5rem;
    left: -4rem;
    width: 10rem;
    height: 10rem;
    background: linear-gradient(45deg, #60a5fa 0%, #93c5fd 100%);
    border-radius: 50%;
    opacity: 0.3;
    filter: blur(3rem);
}

.legacy-modal-grid-pattern {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.05;
    height: 100%;
    width: 100%;
    background-image: radial-gradient(circle, #f59e0b 1px, transparent 1px);
    background-size: 25px 25px;
}

/* Header Section */
.legacy-modal-header {
    padding: 2rem 2rem 1rem 2rem;
    text-align: center;
    flex-shrink: 0;
}

.legacy-modal-header>*+* {
    margin-top: 2rem;
}

/* Content Section - Scrollable */
.legacy-modal-content {
    padding: 1rem 2rem;
    text-align: center;
    flex: 1;
    overflow-y: auto;
}

.legacy-modal-content>*+* {
    margin-top: 2rem;
}

/* Footer Section */
.legacy-modal-footer {
    padding: 1rem 2rem 2rem 2rem;
    text-align: center;
    flex-shrink: 0;
}

/* Icon Section */
.legacy-modal-icon-container {
    justify-content: center;
}

.legacy-modal-icon-wrapper {
    position: relative;
}

.legacy-modal-main-icon {
    width: 6rem;
    height: 6rem;
    background: linear-gradient(135deg, #f59e0b 0%, #3b82f6 100%);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.legacy-modal-main-icon i {
    color: white;
    font-size: 1.875rem;
}

.legacy-modal-badge {
    bottom: -0.5rem;
    right: -0.5rem;
    width: 2rem;
    height: 2rem;
    background-color: #10b981;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    animation: gentlePulse 2s infinite;
}

.legacy-modal-badge i {
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Title Section */
.legacy-modal-title-section {
    margin-top: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.legacy-modal-title-section>*+* {
    margin-top: 1rem;
}

.legacy-modal-title {
    font-size: 1.875rem;
    font-weight: bold;
    color: #111827;
    line-height: 2.25rem;
}

.legacy-modal-divider {
    height: 0.25rem;
    width: 5rem;
    background: linear-gradient(90deg, #f59e0b 0%, #3b82f6 100%);
    margin: 0 auto;
    border-radius: 9999px;
}

.legacy-modal-description {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.25rem;
}

/* Welcome Section */
.legacy-modal-welcome {
    background: linear-gradient(90deg, #fef3c7 0%, #dbeafe 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #fde68a;
}

.legacy-modal-welcome-title {
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #d97706;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.legacy-modal-welcome-list {
    margin-top: 0.5rem;
}

.legacy-modal-welcome-list>*+* {
    margin-top: 0.5rem;
}

.legacy-modal-welcome-item {
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #92400e;
}

.legacy-modal-welcome-item i.fa-check-circle {
    color: #10b981;
}

/* Button Section */
.legacy-modal-buttons {
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding-top: 1rem;
}

.legacy-modal-btn-primary {
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    color: white;
    background: linear-gradient(90deg, #f59e0b 0%, #3b82f6 100%);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
}

.legacy-modal-btn-primary:hover {
    background: linear-gradient(90deg, #d97706 0%, #2563eb 100%);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.legacy-modal-btn-secondary {
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: 2px solid #d1d5db;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    color: #374151;
    background-color: white;
    transition: all 0.2s ease;
    cursor: pointer;
}

.legacy-modal-btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.legacy-modal-btn-icon {
    margin-right: 0.5rem;
}

/* Info Section */
.legacy-modal-info {
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.legacy-modal-info-box {
    background-color: #eff6ff;
    border-left: 4px solid #3b82f6;
    border-radius: 0.5rem;
    padding: 1rem;
    align-items: flex-start;
    gap: 0.75rem;
}

.legacy-modal-info-box i {
    color: #3b82f6;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.legacy-modal-info-text {
    text-align: left;
    font-size: 0.875rem;
    color: #1e3a8a;
}

.legacy-modal-info-text strong {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.legacy-modal-info-text p {
    margin: 0;
    line-height: 1.5;
}

/* Security Info */
.legacy-modal-security {
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.legacy-modal-security-text {
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Close Button */
.legacy-modal-close-x {
    top: 1rem;
    right: 1rem;
    z-index: 1;
    color: #9ca3af;
    transition: color 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.legacy-modal-close-x:hover {
    color: #f59e0b;
}

.legacy-modal-close-x svg {
    height: 1.5rem;
    width: 1.5rem;
}

/* Animations */
.legacy-modal-overlay.active .legacy-modal-container {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes gentlePulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Responsive Design */
@media (min-width: 640px) {
    .legacy-modal-buttons {
        flex-direction: row;
    }

    .legacy-modal-btn-primary,
    .legacy-modal-btn-secondary {
        width: auto;
    }

    .legacy-modal-container {
        margin: 1rem;
    }
}

@media (max-width: 640px) {
    .legacy-modal-container {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .legacy-modal-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }

    .legacy-modal-content {
        padding: 1rem 1.5rem;
        max-height: calc(100vh - 10rem);
    }

    .legacy-modal-footer {
        padding: 1rem 1.5rem 1.5rem 1.5rem;
    }

    .legacy-modal-welcome {
        padding: 1rem;
    }

    .legacy-modal-title {
        font-size: 1.5rem;
        line-height: 2rem;
    }
}

/* Accessibility - Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}