.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s var(--transition);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal::-webkit-scrollbar { width: 5px; }
.modal::-webkit-scrollbar-track { background: transparent; margin: 16px 0; }
.modal::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.modal::-webkit-scrollbar-thumb:hover { background: var(--d8-green-300); }
.modal::-webkit-scrollbar-button { display: none; }

.modal {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
    border-radius: 16px 16px 0 0;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-body);
    border-color: var(--border-strong);
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 28px;
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    border-radius: 0 0 16px 16px;
}

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.confirm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    transform: translateY(16px) scale(0.96);
    transition: transform 0.2s var(--transition);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.confirm-overlay.active .confirm-dialog {
    transform: translateY(0) scale(1);
}

.confirm-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.confirm-icon svg {
    width: 26px;
    height: 26px;
}

.confirm-icon-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--red);
}

.confirm-icon-default {
    background: var(--d8-green-50);
    color: var(--d8-green-500);
}

.confirm-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-message {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-actions .btn {
    flex: 1;
    justify-content: center;
}

@media (max-width: 640px) {
    .modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .modal {
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
    }

    .modal-header {
        padding: 20px 20px;
        border-radius: 16px 16px 0 0;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 16px 20px;
        border-radius: 0;
    }

    .confirm-overlay {
        padding: 16px;
    }

    .confirm-dialog {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .confirm-actions {
        flex-direction: column;
    }
}

.discord-login-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    background: #5865F2;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.discord-login-btn:hover {
    background: #4752C4;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.4);
}

.discord-login-btn:active {
    transform: translateY(0);
}

.discord-login-btn svg {
    flex-shrink: 0;
}
